|
| 1 | +"""The native Windows lane must run the suites written for native Windows. |
| 2 | +
|
| 3 | +#6356 hardened ten control-plane TypeScript suites so their assertions hold on |
| 4 | +native Windows, #6258 flushed the state-backup archive through writable handles |
| 5 | +and #6562 fixed the checkpoint durability flush; every one of those fixes |
| 6 | +changed behavior that only a native Windows host exercises. The curated |
| 7 | +``windows-powershell`` list still ran none of the suites, so the checkpoint |
| 8 | +regression shipped with green qualification. Pin the suites to that lane: a |
| 9 | +later edit that drops one, or a new one that arrives with the same Windows-only |
| 10 | +behavior, has to update this contract instead of silently losing the coverage. |
| 11 | +""" |
| 12 | + |
| 13 | +from __future__ import annotations |
| 14 | + |
| 15 | +import unittest |
| 16 | +from pathlib import Path |
| 17 | + |
| 18 | +import yaml |
| 19 | + |
| 20 | +ROOT = Path(__file__).resolve().parents[2] |
| 21 | +WORKFLOW = ROOT / ".github/workflows/python-tests.yml" |
| 22 | + |
| 23 | +# Suite -> the native Windows fix that made it host-qualified. |
| 24 | +WINDOWS_QUALIFIED_SUITES = ( |
| 25 | + "tests/control_plane_ts/agent_preferences.test.ts", # #6356 |
| 26 | + "tests/control_plane_ts/authority_archive.test.ts", # #6356 |
| 27 | + "tests/control_plane_ts/canonical_task_lease_renew.test.ts", # #6356 |
| 28 | + "tests/control_plane_ts/checkpoint_artifacts.test.ts", # #6562 |
| 29 | + "tests/control_plane_ts/checkpoint_provider_head.test.ts", # #6562 family |
| 30 | + "tests/control_plane_ts/cold_source_import.test.ts", # #6356 |
| 31 | + "tests/control_plane_ts/coordination_runtime_shadow.test.ts", # #6356 |
| 32 | + "tests/control_plane_ts/effect_runtime_snapshot.test.ts", # #6356 |
| 33 | + "tests/control_plane_ts/goal_acceptance_authority.test.ts", # #6356 |
| 34 | + "tests/control_plane_ts/quota_void_commit.test.ts", # #6356 |
| 35 | + "tests/control_plane_ts/shadow_entry_delivery.test.ts", # #6356 |
| 36 | + "tests/control_plane_ts/sqlite_backup.test.ts", # #6258 |
| 37 | +) |
| 38 | + |
| 39 | + |
| 40 | +def windows_lane() -> dict: |
| 41 | + workflow = yaml.load(WORKFLOW.read_text(encoding="utf-8"), Loader=yaml.BaseLoader) |
| 42 | + return workflow["jobs"]["windows-powershell"] |
| 43 | + |
| 44 | + |
| 45 | +class WindowsLaneCoverageTests(unittest.TestCase): |
| 46 | + def test_windows_lane_still_qualifies_every_code_change(self): |
| 47 | + # The lane is the only native Windows qualification, so it must keep |
| 48 | + # following the same change classification the other required jobs use. |
| 49 | + self.assertIn("needs.changes.outputs.python_tests", windows_lane()["if"]) |
| 50 | + |
| 51 | + def test_windows_qualified_suites_exist_and_run_in_the_windows_lane(self): |
| 52 | + tokens = {token for step in windows_lane()["steps"] for token in step.get("run", "").split()} |
| 53 | + for suite in WINDOWS_QUALIFIED_SUITES: |
| 54 | + with self.subTest(suite=suite): |
| 55 | + self.assertTrue((ROOT / suite).is_file(), f"{suite} is not a suite in this checkout") |
| 56 | + self.assertIn(suite, tokens, f"{suite} left the native Windows lane") |
| 57 | + |
| 58 | + |
| 59 | +if __name__ == "__main__": |
| 60 | + unittest.main() |
0 commit comments