Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make "test cases" have tags for easier selection of what subset is being considered. #24834

Merged
merged 16 commits into from
Feb 6, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions scripts/tests/chiptest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,21 @@ class ManualTest:
}


def _IsValidYamlTest(name: str) -> bool:
"""Check if the given file name is a valid YAML test.

This returns invalid for examples, simulated and other specific tests.
"""

# Simulated tests are not runnable by repl tests, need
# separate infrastructure. Exclude theml completely (they are
andy31415 marked this conversation as resolved.
Show resolved Hide resolved
# not even manual)
if name.endswith('_Simulated.yaml'):
return False

return name not in INVALID_TESTS


def _LoadManualTestsJson(json_file_path: str) -> Iterator[str]:
with open(json_file_path, 'rt') as f:
data = json.load(f)
Expand Down Expand Up @@ -174,12 +189,6 @@ def _AllYamlTests():
if not path.is_file():
continue

if path.name.endswith('_Simulated.yaml'):
# Simulated tests are not runnable by repl tests, need
# separate infrastructure. Exclude theml completely (they are
# not even manual)
continue

yield path


Expand Down Expand Up @@ -229,7 +238,7 @@ def _hardcoded_python_yaml_tests():
in_development_tests = _GetInDevelopmentTests()

for path in _AllYamlTests():
if path.name in INVALID_TESTS:
if not _IsValidYamlTest(path.name):
continue

tags = set()
Expand Down