diff options
| author | JJ Liebig <jonathan.liebig@gmail.com> | 2026-09-24 19:37:09 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-24 19:37:09 +0200 |
| commit | 11a7ab4ae21ab9427bcb44b3be01f62a4ab58c47 (patch) | |
| tree | a56b304c2951c0bfb6581b17ee7b0d747dd32d22 /scripts/test_windows_input.py | |
| parent | d11c0c34cf8f9c2dc0d6fb45c58c307aa5ce8a6b (diff) | |
test: qualify Win32 and Kitty input paths by default (#4587)
Diffstat (limited to 'scripts/test_windows_input.py')
| -rw-r--r-- | scripts/test_windows_input.py | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/scripts/test_windows_input.py b/scripts/test_windows_input.py index 63329134..09b60e2c 100644 --- a/scripts/test_windows_input.py +++ b/scripts/test_windows_input.py @@ -24,6 +24,11 @@ class WindowsInputGauntletTests(unittest.TestCase): self.assertTrue(bytes.fromhex(value)) self.assertEqual(self.cases["dead-acute"]["kind"], "layout-key") self.assertEqual(self.cases["altgr-euro"]["kind"], "manual") + for spec in self.matrix["release_plan"]: + for case_id in spec["cases"]: + self.assertIn(spec["mode"], self.cases[case_id]["expected"]) + self.assertNotIn(self.cases[case_id]["kind"], {"manual", "qualification"}) + self.assertFalse({"page-up", "page-down"} & {case_id for spec in self.matrix["release_plan"] for case_id in spec["cases"]}) def test_default_catalogue_does_not_inject_terminal_host_actions(self): for case_id in ["ctrl-v", "alt-enter", "ctrl-shift-up", "ctrl-shift-down", "ctrl-shift-home", "ctrl-shift-end"]: @@ -200,6 +205,53 @@ class WindowsInputGauntletTests(unittest.TestCase): rows = {row[0]: row[1:] for row in qualification_matrix(result)} self.assertEqual(rows["Shift+Enter"][0], "PARTIAL") + def test_release_matrix_uses_its_paired_hosts(self): + observations = [{"host": spec["channel"], "path": spec["path"], "mode": spec["mode"], + "case": case, "status": "pass", "width": width} + for spec in self.matrix["release_plan"] for width in (120, 80) for case in spec["cases"]] + nominal_only = [row for row in observations if row["width"] == 120] + rows = {row[0]: row[1:] for row in qualification_matrix({"campaign": "release", "observations": nominal_only})} + self.assertEqual(rows["Resize 120 -> 80"], ("PARTIAL", "PARTIAL")) + rows = {row[0]: row[1:] for row in qualification_matrix({"campaign": "release", "observations": observations})} + for name, cells in rows.items(): + self.assertEqual(cells, ("MANUAL", "MANUAL") if name in {"PageUp/PageDown scroll", "AltGr", "IME composition"} + else ("PASS", "PASS"), name) + failure = next(row for row in observations if row["host"] == "stable" and row["mode"] == "mok2" + and row["case"] == "letter-a" and row["width"] == 120) + failure["status"] = "fail" + rows = {row[0]: row[1:] for row in qualification_matrix({"campaign": "release", "observations": observations})} + self.assertEqual(rows["Printable keys"][0], "FAIL") + self.assertEqual(rows["Resize 120 -> 80"][0], "FAIL") + self.assertEqual(rows["PageUp/PageDown scroll"], ("MANUAL", "MANUAL")) + failure["status"] = "pass" + missing_mode = [row for row in observations if not (row["host"] == "stable" and row["mode"] == "mok2" + and row["case"] == "paste-lf")] + rows = {row[0]: row[1:] for row in qualification_matrix({"campaign": "release", "observations": missing_mode})} + self.assertEqual(rows["Multiline paste"][0], "PARTIAL") + stable_partial = next(row for row in observations if row["host"] == "stable" and row["mode"] == "mok2" + and row["case"] == "paste-lf" and row["width"] == 120) + for status, expected in (("inconclusive", "INCONCLUSIVE"), ("unsupported", "UNSUPPORTED"), + ("not_run", "PARTIAL")): + stable_partial["status"] = status + rows = {row[0]: row[1:] for row in qualification_matrix({"campaign": "release", "observations": observations})} + self.assertEqual(rows["Multiline paste"][0], expected) + stable_partial["status"] = "pass" + partial = next(row for row in observations if row["host"] == "preview" and row["mode"] == "kitty" + and row["case"] == "shift-enter" and row["width"] == 80) + partial["status"] = "inconclusive" + rows = {row[0]: row[1:] for row in qualification_matrix({"campaign": "release", "observations": observations})} + self.assertEqual(rows["Shift+Enter"][1], "INCONCLUSIVE") + + def test_run_spec_planning_does_not_require_other_combinations(self): + document = {"channels": ["stable"], "widths": [80], "heights": [24], + "run_specs": [{"channel": "stable", "path": "herdr", "mode": "legacy", "cases": ["letter-a"]}], + "observations": [{"host": "stable", "path": "herdr", "mode": "legacy", "phase": 1, + "width": 120, "height": 30, "case": "letter-a", "status": "not_run"}]} + self.assertEqual(summarize(document)["coverage_missing"], 2) + document["observations"][0]["mode"] = "kitty" + with self.assertRaisesRegex(ValueError, "outside the declared run matrix"): + summarize(document) + def test_direct_legacy_limit_requires_unsupported_from_every_channel(self): observations = [{"host": host, "case": "shift-enter", "path": "direct", "mode": "legacy", "status": status} for host, status in (("stable", "unsupported"), ("preview", "not_run"))] @@ -241,6 +293,25 @@ class WindowsInputGauntletTests(unittest.TestCase): result["hosts"].append({"channel": "preview", "runs": [{"nonce": "one", "path": "herdr", "mode": "native"}]}) self.assertEqual(herdr_protocol_label(result), "Herdr default (UNKNOWN)*") + def test_release_success_requires_stable_win32_runtime_evidence(self): + observations = [{**self.evidence, "case": "letter-a", "host": "stable", "path": "herdr", "mode": "legacy", + "hex": "61", "phase": phase, "width": width, "height": height, + "outer_geometry": [width, height], "final_outer_geometry": [width, height], + "nonce": "owned", "capture_id": str(phase)} + for phase, (width, height) in enumerate(((120, 30), (80, 24), (80, 30)), 1)] + run = {"nonce": "owned", "path": "herdr", "mode": "legacy", "pid": 123, "hwnd": 456, + "elevated": False, "image_identity": "image-s", "installation_identity": "install-s"} + document = {"campaign": "release", "channels": ["stable"], "widths": [80], "heights": [24], + "run_specs": [{"channel": "stable", "path": "herdr", "mode": "legacy", "cases": ["letter-a"]}], + "observations": observations, "hosts": [{"channel": "stable", "runs": [run]}], + "controller_elevated": False} + incomplete = summarize(document) + self.assertEqual(incomplete["counts"]["pass"], 3) + self.assertEqual(incomplete["coverage_missing"], 0) + self.assertFalse(incomplete["observed_checks_passed"]) + observations[0].update(input_reader="windows-console", input_transport="win32-serialized") + self.assertTrue(summarize(document)["observed_checks_passed"]) + def test_empty_partial_and_duplicate_reports_never_become_green(self): self.assertFalse(summarize({})["observed_checks_passed"]) row = {**self.evidence, "case": "letter-a", "host": "stable", "path": "herdr", "mode": "legacy", "hex": "61", "phase": 1, |
