diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index dbabc1ff3b9763..7770cb5e70c0d0 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -174,7 +174,7 @@ jobs: run: | ./scripts/run_in_build_env.sh \ "./scripts/tests/run_test_suite.py \ - --target-skip-glob 'tv-*' \ + --target-skip-glob 'TV_*' \ run \ --iterations 2 \ --chip-tool ./out/debug/standalone/chip-tool \ diff --git a/scripts/tests/chiptest/__init__.py b/scripts/tests/chiptest/__init__.py index 0e7223e01d4af9..2d72bc2b43a4da 100644 --- a/scripts/tests/chiptest/__init__.py +++ b/scripts/tests/chiptest/__init__.py @@ -32,17 +32,15 @@ def AllTests(root: str): logging.debug('Found YAML: %s' % path) # grab the name without the extension - name = path.stem.lower() + name = path.stem - if 'simulated' in name: + if 'Simulated' in name: continue - if name.startswith('tv_'): + if name.startswith('TV_'): target = TestTarget.TV - name = 'tv-' + name[3:] - elif name.startswith('test_'): + elif name.startswith('Test'): target = TestTarget.ALL_CLUSTERS - name = 'app-' + name[5:] else: continue diff --git a/scripts/tests/run_test_suite.py b/scripts/tests/run_test_suite.py index 6022d6d50e5dcd..133e9213ba7ca4 100755 --- a/scripts/tests/run_test_suite.py +++ b/scripts/tests/run_test_suite.py @@ -110,18 +110,31 @@ def main(context, log_level, target, target_glob, target_skip_glob, no_log_times coloredlogs.install(level=__LOG_LEVELS__[log_level], fmt=log_fmt) # Figures out selected test that match the given name(s) - tests = [test for test in chiptest.AllTests(root)] + all_tests = [test for test in chiptest.AllTests(root)] + tests = all_tests if 'all' not in target: - target = set([name.lower() for name in target]) - tests = [test for test in tests if test.name in target] + tests = [] + for name in target: + targeted = [test for test in all_tests if test.name.lower() + == name.lower()] + if len(targeted) == 0: + logging.error("Unknown target: %s" % name) + tests.extend(targeted) if target_glob: - matcher = GlobMatcher(target_glob) - tests = [test for test in tests if matcher.matches(test.name)] + matcher = GlobMatcher(target_glob.lower()) + tests = [test for test in tests if matcher.matches(test.name.lower())] + + if len(tests) == 0: + logging.error("No targets match, exiting.") + logging.error("Valid targets are (case-insensitive): %s" % + (", ".join(test.name for test in all_tests))) + exit(1) if target_skip_glob: - matcher = GlobMatcher(target_skip_glob) - tests = [test for test in tests if not matcher.matches(test.name)] + matcher = GlobMatcher(target_skip_glob.lower()) + tests = [test for test in tests if not matcher.matches( + test.name.lower())] tests.sort(key=lambda x: x.name)