Skip to content

Commit 076822d

Browse files
committed
TEMP: disable cases.py staleness check and ALWAYS_RUN_ALL to test pruning
1 parent b4dca71 commit 076822d

2 files changed

Lines changed: 21 additions & 16 deletions

File tree

toolchain/mfc/test/coverage.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@
4949
"src/common/include/macros.fpp",
5050
"src/common/include/case.fpp",
5151
"toolchain/mfc/test/case.py",
52-
"toolchain/mfc/test/cases.py",
52+
# TEMP: cases.py removed to test pruning on this PR — restore before merge
53+
# "toolchain/mfc/test/cases.py",
5354
"toolchain/mfc/test/coverage.py",
5455
"toolchain/mfc/params/definitions.py",
5556
"toolchain/mfc/run/input.py",
@@ -664,17 +665,17 @@ def load_coverage_cache(root_dir: str) -> Optional[dict]:
664665
cons.print("[yellow]Warning: Coverage cache has unexpected format.[/yellow]")
665666
return None
666667

667-
cases_py = Path(root_dir) / "toolchain/mfc/test/cases.py"
668-
try:
669-
current_hash = hashlib.sha256(cases_py.read_bytes()).hexdigest()
670-
except OSError as exc:
671-
cons.print(f"[yellow]Warning: Cannot read cases.py for cache staleness check: {exc}[/yellow]")
672-
return None
673-
stored_hash = cache.get("_meta", {}).get("cases_hash", "")
674-
675-
if current_hash != stored_hash:
676-
cons.print("[yellow]Warning: Coverage cache is stale (cases.py changed).[/yellow]")
677-
return None
668+
# TEMP: staleness check disabled to test pruning on this PR — restore before merge
669+
# cases_py = Path(root_dir) / "toolchain/mfc/test/cases.py"
670+
# try:
671+
# current_hash = hashlib.sha256(cases_py.read_bytes()).hexdigest()
672+
# except OSError as exc:
673+
# cons.print(f"[yellow]Warning: Cannot read cases.py for cache staleness check: {exc}[/yellow]")
674+
# return None
675+
# stored_hash = cache.get("_meta", {}).get("cases_hash", "")
676+
# if current_hash != stored_hash:
677+
# cons.print("[yellow]Warning: Coverage cache is stale (cases.py changed).[/yellow]")
678+
# return None
678679

679680
cache = _normalize_cache(cache)
680681

toolchain/mfc/test/test_coverage_unit.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,8 @@ def test_macros_fpp_triggers_all(self):
233233
assert should_run_all_tests({"src/common/include/macros.fpp"}) is True
234234

235235
def test_cases_py_triggers_all(self):
236-
assert should_run_all_tests({"toolchain/mfc/test/cases.py"}) is True
236+
# TEMP: cases.py removed from ALWAYS_RUN_ALL for testing — restore before merge
237+
assert should_run_all_tests({"toolchain/mfc/test/cases.py"}) is False
237238

238239
def test_case_py_triggers_all(self):
239240
assert should_run_all_tests({"toolchain/mfc/test/case.py"}) is True
@@ -467,7 +468,8 @@ def test_non_fpp_always_run_all_detected(self):
467468
_parse_diff_files includes it -> should_run_all_tests fires.
468469
"""
469470
files = _parse_diff_files("toolchain/mfc/test/cases.py\n")
470-
assert should_run_all_tests(files) is True
471+
# TEMP: cases.py removed from ALWAYS_RUN_ALL for testing — restore before merge
472+
assert should_run_all_tests(files) is False
471473

472474
def test_niche_feature_pruning(self):
473475
"""
@@ -775,9 +777,11 @@ def test_corrupt_gzip_returns_none(self):
775777
assert self._run() is None
776778

777779
def test_stale_cache_returns_none(self):
778-
"""Cache with wrong cases_hash -> None."""
780+
"""Cache with wrong cases_hash -> None (staleness check).
781+
TEMP: staleness check disabled for testing — restore assertion before merge."""
779782
self._write_cache({"_meta": {"cases_hash": "wrong_hash"}, "TEST1": ["src/simulation/m_rhs.fpp"]})
780-
assert self._run() is None
783+
# TEMP: staleness check disabled, so stale cache is accepted
784+
assert self._run() is not None
781785

782786
def test_empty_cache_returns_none(self):
783787
"""Cache with only _meta and no test entries -> None."""

0 commit comments

Comments
 (0)