Skip to content

Commit 7c98511

Browse files
committed
Fix retagger to not tag duplicate tests that fail in one instance
1 parent db82658 commit 7c98511

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

graalpython/com.oracle.graal.python.test/src/tests/test_tagged_unittests.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,18 +225,22 @@ def main():
225225
print("*stderr*")
226226
print(p.stderr)
227227

228-
passing_tests = []
228+
passing_tests = set()
229+
failing_tests = set()
229230

230231
# n.b.: we add a '*' in the front, so that unittests doesn't add
231232
# its own asterisks, because now this is already a pattern
232233
for funcname, classname, result in parse_unittest_output(p.stderr):
233234
# We consider skipped tests as passing in order to avoid a situation where a Linux run
234235
# untags a Darwin-only test and vice versa
236+
pattern = f"*{classname}.{funcname}"
235237
if result == 'ok' or result.startswith('skipped'):
236-
passing_tests.append(f"*{classname}.{funcname}")
238+
passing_tests.add(pattern)
239+
else:
240+
failing_tests.add(pattern)
237241

238242
with open(tagfile, "w") as f:
239-
for passing_test in sorted(passing_tests):
243+
for passing_test in sorted(passing_tests - failing_tests):
240244
f.write(passing_test)
241245
f.write("\n")
242246
if not passing_tests:

0 commit comments

Comments
 (0)