Skip to content

Commit 4454cbf

Browse files
committed
ci(windows): qualify host-hardened control-plane suites on native Windows
The required windows-powershell lane ran a curated subset of tests/control_plane_ts, so the suites the project hardened or fixed specifically for native Windows (#6356 host-hardened assertions, #6258 backup durability flush, #6562 checkpoint durability flush) never executed on a Windows host in CI; the checkpoint regression confirmed that gap by shipping with green qualification. Run those suites in the lane under its qualified SQLite runtime and pin the list with a contract test that fails when a suite leaves the lane. Signed-off-by: JasonBuildAI <jasonbuildai@gmail.com>
1 parent dda6f7e commit 4454cbf

2 files changed

Lines changed: 86 additions & 0 deletions

File tree

‎.github/workflows/python-tests.yml‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,32 @@ jobs:
859859
tests/control_plane_ts/local_authority_provider.test.ts
860860
tests/control_plane_ts/sqlite_runtime_admission.test.ts
861861
862+
- name: Install the TypeScript suite dependencies
863+
# The host-qualified suites import real packages (for example the
864+
# skipped PostgreSQL provider still imports `pg`), and this lane never
865+
# installed the root dependencies before.
866+
run: npm ci --ignore-scripts
867+
868+
- name: Qualify host-hardened control-plane suites on native Windows
869+
# These suites carry the native Windows branches, durability flushes and
870+
# host-independent path assertions written by #6258, #6356 and #6562:
871+
# the curated lane omitted them, so a Windows-only regression in their
872+
# behavior could pass qualification.
873+
run: >-
874+
node --no-warnings --experimental-sqlite --experimental-strip-types --test
875+
tests/control_plane_ts/agent_preferences.test.ts
876+
tests/control_plane_ts/authority_archive.test.ts
877+
tests/control_plane_ts/canonical_task_lease_renew.test.ts
878+
tests/control_plane_ts/checkpoint_artifacts.test.ts
879+
tests/control_plane_ts/checkpoint_provider_head.test.ts
880+
tests/control_plane_ts/cold_source_import.test.ts
881+
tests/control_plane_ts/coordination_runtime_shadow.test.ts
882+
tests/control_plane_ts/effect_runtime_snapshot.test.ts
883+
tests/control_plane_ts/goal_acceptance_authority.test.ts
884+
tests/control_plane_ts/quota_void_commit.test.ts
885+
tests/control_plane_ts/shadow_entry_delivery.test.ts
886+
tests/control_plane_ts/sqlite_backup.test.ts
887+
862888
- name: Install the frontend dependencies for a source rebuild
863889
working-directory: apps/presentation/dashboard
864890
run: npm ci --ignore-scripts
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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

Comments
 (0)