Tweaked test/bench id globbing to avoid duplicating cases

Before, globs that match both the suite name and case name would cause
end up running the case twice. Which is a bit of a problem, since all
cases contain their suite name as a prefix...

  test_f* => run test_files
             |-> run test_files_hello
             |-> run test_files_trunc
             ...
             run test_files_hello
             run test_files_trunc
             ...

Now we only run matching test cases if no suites were found.

This has the side-effect of making the universal glob, "*", equivalent
to no test ids, which is nice:

  $ ./scripts/test.py -j -b '*'  # equivalent
  $ ./scripts/test.py -j -b      #

This is useful for running a specific problematic test first before
running the all of the tests:

  $ ./scripts/test.py -j -b test_files_trunc '*'
This commit is contained in:
Christopher Haster
2024-05-29 14:33:01 -05:00
parent c648f96dc5
commit 3c5319e125
2 changed files with 8 additions and 6 deletions
+1
View File
@@ -816,6 +816,7 @@ def find_ids(runner, bench_ids=[], **args):
bench_ids__.extend(suite bench_ids__.extend(suite
for suite in expected_suite_perms.keys() for suite in expected_suite_perms.keys()
if fnmatch.fnmatch(suite, name)) if fnmatch.fnmatch(suite, name))
if not bench_ids__:
bench_ids__.extend(case_ bench_ids__.extend(case_
for case_ in expected_case_perms.keys() for case_ in expected_case_perms.keys()
if fnmatch.fnmatch(case_, name)) if fnmatch.fnmatch(case_, name))
+1
View File
@@ -833,6 +833,7 @@ def find_ids(runner, test_ids=[], **args):
test_ids__.extend(suite test_ids__.extend(suite
for suite in expected_suite_perms.keys() for suite in expected_suite_perms.keys()
if fnmatch.fnmatch(suite, name)) if fnmatch.fnmatch(suite, name))
if not test_ids__:
test_ids__.extend(case_ test_ids__.extend(case_
for case_ in expected_case_perms.keys() for case_ in expected_case_perms.keys()
if fnmatch.fnmatch(case_, name)) if fnmatch.fnmatch(case_, name))