Skip to content

Commit a23366e

Browse files
committed
Give a report tag based on the type of junit tests we run
1 parent 72ab5b6 commit a23366e

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

mx.graalpython/mx_graalpython.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,7 @@ def punittest(ars, report=False):
383383
args = [] if ars is None else ars
384384
@dataclass
385385
class TestConfig:
386+
identifier: str
386387
args: list
387388
useResources: bool
388389
reportConfig: bool = report
@@ -402,24 +403,24 @@ def __str__(self):
402403
# Note: we must use filters instead of --regex so that mx correctly processes the unit test configs,
403404
# but it is OK to apply --regex on top of the filters
404405
graalpy_tests = ['com.oracle.graal.python.test', 'com.oracle.graal.python.pegparser.test', 'org.graalvm.python.embedding.utils.test']
406+
has_compiler = bool(mx.suite('compiler', fatalIfMissing=False))
405407
configs += [
406-
TestConfig(vm_args + graalpy_tests + args, True),
407-
TestConfig(vm_args + graalpy_tests + args, False),
408+
TestConfig("junit", vm_args + graalpy_tests + args, True),
409+
TestConfig("junit", vm_args + graalpy_tests + args, False),
408410
# MultiContext cext tests should run by themselves so they aren't influenced by others
409-
TestConfig(vm_args + ['org.graalvm.python.embedding.cext.test'] + args + ["--use-graalvm"], True),
410-
TestConfig(vm_args + ['org.graalvm.python.embedding.cext.test'] + args + ["--use-graalvm"], False),
411+
TestConfig("multi-cext", vm_args + ['org.graalvm.python.embedding.cext.test'] + args + (["--use-graalvm"] if has_compiler else []), True),
411412
# TCK suite is not compatible with the PythonMxUnittestConfig,
412413
# so it must have its own run and the useResources config is ignored
413-
TestConfig(vm_args + ['com.oracle.truffle.tck.tests'] + args, False),
414+
TestConfig("tck", vm_args + ['com.oracle.truffle.tck.tests'] + args, False),
414415
]
415416
if '--regex' not in args:
416417
async_regex = ['--regex', r'com\.oracle\.graal\.python\.test\.integration\.advanced\.AsyncActionThreadingTest']
417-
configs.append(TestConfig(vm_args + ['-Dpython.AutomaticAsyncActions=false', 'com.oracle.graal.python.test', 'org.graalvm.python.embedding.utils.test'] + async_regex + args, True, False))
418+
configs.append(TestConfig("async", vm_args + ['-Dpython.AutomaticAsyncActions=false', 'com.oracle.graal.python.test', 'org.graalvm.python.embedding.utils.test'] + async_regex + args, True, False))
418419

419420
for c in configs:
420421
mx.log(f"Python JUnit tests configuration: {c}")
421422
PythonMxUnittestConfig.useResources = c.useResources
422-
mx_unittest.unittest(c.args, test_report_tags=({"task": "punittest"} if c.reportConfig else None))
423+
mx_unittest.unittest(c.args, test_report_tags=({"task": f"punittest-{c.identifier}-{'w' if c.useResources else 'wo'}-resources"} if c.reportConfig else None))
423424

424425
if skip_leak_tests:
425426
return

0 commit comments

Comments
 (0)