@@ -383,6 +383,7 @@ def punittest(ars, report=False):
383
383
args = [] if ars is None else ars
384
384
@dataclass
385
385
class TestConfig :
386
+ identifier : str
386
387
args : list
387
388
useResources : bool
388
389
reportConfig : bool = report
@@ -402,24 +403,24 @@ def __str__(self):
402
403
# Note: we must use filters instead of --regex so that mx correctly processes the unit test configs,
403
404
# but it is OK to apply --regex on top of the filters
404
405
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 ))
405
407
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 ),
408
410
# 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 ),
411
412
# TCK suite is not compatible with the PythonMxUnittestConfig,
412
413
# 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 ),
414
415
]
415
416
if '--regex' not in args :
416
417
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 ))
418
419
419
420
for c in configs :
420
421
mx .log (f"Python JUnit tests configuration: { c } " )
421
422
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 ))
423
424
424
425
if skip_leak_tests :
425
426
return
0 commit comments