Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
10 changes: 7 additions & 3 deletions toolchain/mfc/test/coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,13 @@

# Changes to these files trigger the full test suite.
# CPU coverage cannot tell us about GPU directive changes (macro files), and
# toolchain files define or change the set of tests themselves.
# toolchain files that affect .inp generation or test execution must run all.
#
# NOT included (safe to prune):
# - cases.py: adding a test doesn't invalidate existing coverage; new tests
# are conservatively included (not in cache -> always runs).
# - definitions.py: adding a parameter doesn't affect tests that don't use it;
# the PR's .fpp changes trigger the relevant tests via coverage overlap.
ALWAYS_RUN_ALL = frozenset(
[
"CMakeLists.txt",
Expand All @@ -48,9 +54,7 @@
"src/common/include/macros.fpp",
"src/common/include/case.fpp",
"toolchain/mfc/test/case.py",
"toolchain/mfc/test/cases.py",
"toolchain/mfc/test/coverage.py",
"toolchain/mfc/params/definitions.py",
"toolchain/mfc/run/input.py",
"toolchain/mfc/case_validator.py",
]
Expand Down
14 changes: 8 additions & 6 deletions toolchain/mfc/test/test_coverage_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,14 +223,16 @@ def test_shared_parallel_macros_triggers_all(self):
def test_macros_fpp_triggers_all(self):
assert should_run_all_tests({"src/common/include/macros.fpp"}) is True

def test_cases_py_triggers_all(self):
assert should_run_all_tests({"toolchain/mfc/test/cases.py"}) is True
def test_cases_py_does_not_trigger_all(self):
"""cases.py removed from ALWAYS_RUN_ALL: new tests are conservatively included."""
assert should_run_all_tests({"toolchain/mfc/test/cases.py"}) is False

def test_case_py_triggers_all(self):
assert should_run_all_tests({"toolchain/mfc/test/case.py"}) is True

def test_definitions_py_triggers_all(self):
assert should_run_all_tests({"toolchain/mfc/params/definitions.py"}) is True
def test_definitions_py_does_not_trigger_all(self):
"""definitions.py removed from ALWAYS_RUN_ALL: new params are covered by .fpp changes."""
assert should_run_all_tests({"toolchain/mfc/params/definitions.py"}) is False

def test_input_py_triggers_all(self):
assert should_run_all_tests({"toolchain/mfc/run/input.py"}) is True
Expand Down Expand Up @@ -448,10 +450,10 @@ def test_new_fpp_file_no_coverage_skips(self):

def test_non_fpp_always_run_all_detected(self):
"""
End-to-end: diff lists only cases.py (non-.fpp) ->
End-to-end: diff lists only case.py (non-.fpp, in ALWAYS_RUN_ALL) ->
_parse_diff_files includes it -> should_run_all_tests fires.
"""
files = _parse_diff_files("toolchain/mfc/test/cases.py\n")
files = _parse_diff_files("toolchain/mfc/test/case.py\n")
assert should_run_all_tests(files) is True

def test_niche_feature_pruning(self):
Expand Down
Loading