Skip to content

Commit a263eb3

Browse files
committed
test: disambiguate log files for flakybot
1 parent 0363e87 commit a263eb3

File tree

2 files changed

+71
-3
lines changed

2 files changed

+71
-3
lines changed

noxfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def default(session, tests_path):
103103
session.run(
104104
"py.test",
105105
"--quiet",
106-
f"--junitxml=unit_{session.python}_sponge_log.xml",
106+
f"--junitxml={os.path.split(tests_path)[-1]}_{session.python}_sponge_log.xml",
107107
"--cov=db_dtypes",
108108
"--cov=tests/unit",
109109
"--cov-append",
@@ -179,7 +179,7 @@ def prerelease(session, tests_path):
179179
session.run(
180180
"py.test",
181181
"--quiet",
182-
f"--junitxml=prerelease_unit_{session.python}_sponge_log.xml",
182+
f"--junitxml={os.path.split(tests_path)[-1]}_prerelease_{session.python}_sponge_log.xml",
183183
"--cov=db_dtypes",
184184
"--cov=tests/unit",
185185
"--cov-append",

owlbot.py

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,80 @@
8484
s.replace(
8585
["noxfile.py"],
8686
r'''
87+
def default\(session, tests_path\):
88+
# Install all test dependencies, then install this package in-place.
89+
90+
constraints_path = str\(
91+
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
92+
\)
93+
session.install\(
94+
"mock",
95+
"asyncmock",
96+
"pytest",
97+
"pytest-cov",
98+
"pytest-asyncio",
99+
"-c",
100+
constraints_path,
101+
\)
102+
103+
session.install\("-e", ".", "-c", constraints_path\)
104+
105+
# Run py.test against the unit tests.
106+
session.run\(
107+
"py.test",
108+
"--quiet",
109+
f"--junitxml={os.path.split\(tests_path\)[-1]}_{session.python}_sponge_log.xml",
110+
"--cov=db_dtypes",
111+
"--cov=tests/unit",
112+
"--cov-append",
113+
"--cov-config=.coveragerc",
114+
"--cov-report=",
115+
"--cov-fail-under=0",
116+
tests_path,
117+
*session.posargs,
118+
\)
119+
120+
87121
@nox.session\(python=UNIT_TEST_PYTHON_VERSIONS\)
88122
def unit\(session\):
89123
"""Run the unit test suite."""
90124
default\(session\)
91125
''',
92126
r'''
127+
def default(session, tests_path):
128+
# Install all test dependencies, then install this package in-place.
129+
130+
constraints_path = str(
131+
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
132+
)
133+
session.install(
134+
"mock",
135+
"asyncmock",
136+
"pytest",
137+
"pytest-cov",
138+
"pytest-asyncio",
139+
"-c",
140+
constraints_path,
141+
)
142+
143+
session.install("-e", ".", "-c", constraints_path)
144+
145+
# Run py.test against the unit tests.
146+
session.run(
147+
"py.test",
148+
"--quiet",
149+
f"--junitxml={os.path.split(tests_path)[-1]}_{session.python}_sponge_log.xml",
150+
"--cov=db_dtypes",
151+
"--cov=tests/unit",
152+
"--cov-append",
153+
"--cov-config=.coveragerc",
154+
"--cov-report=",
155+
"--cov-fail-under=0",
156+
tests_path,
157+
*session.posargs,
158+
)
159+
160+
93161
def prerelease(session, tests_path):
94162
constraints_path = str(
95163
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
@@ -154,7 +222,7 @@ def prerelease(session, tests_path):
154222
session.run(
155223
"py.test",
156224
"--quiet",
157-
f"--junitxml=prerelease_unit_{session.python}_sponge_log.xml",
225+
f"--junitxml={os.path.split(tests_path)[-1]}_prerelease_{session.python}_sponge_log.xml",
158226
"--cov=db_dtypes",
159227
"--cov=tests/unit",
160228
"--cov-append",

0 commit comments

Comments
 (0)