From 4d29852a25f530f72dff6f899afc345d5dd1646a Mon Sep 17 00:00:00 2001 From: lorkydey Date: Mon, 12 Oct 2026 12:39:52 +0200 Subject: [PATCH] fix(ci): reject disabled CTest cases in skip validation --- tools/check_skips.py | 2 ++ tools/tests/test_check_skips.py | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/tools/check_skips.py b/tools/check_skips.py index 0afad4f27..e669234ee 100644 --- a/tools/check_skips.py +++ b/tools/check_skips.py @@ -12,6 +12,8 @@ WINDOWS_PREFIX = "agc" def skips(path): for case in ET.parse(path).getroot().iter("testcase"): + if case.get("status") == "disabled": + raise ValueError(f"{path}: testcase {case.get('name')!r} is disabled and was not run") skipped = case.find("skipped") if skipped is None: continue diff --git a/tools/tests/test_check_skips.py b/tools/tests/test_check_skips.py index d8ba15c75..ce1b34296 100644 --- a/tools/tests/test_check_skips.py +++ b/tools/tests/test_check_skips.py @@ -34,6 +34,20 @@ OTHER = [ class CheckSkipsTests(unittest.TestCase): + def test_disabled_tests_fail_in_both_jobs_including_agc(self): + xml = '' + with tempfile.TemporaryDirectory() as directory: + junit = Path(directory) / "junit.xml" + junit.write_text(xml, encoding="utf-8") + for job in ("linux", "windows"): + with self.subTest(job=job): + result = subprocess.run( + [sys.executable, "-I", str(TOOL), str(junit), "--job", job], + capture_output=True, text=True) + self.assertNotEqual(result.returncode, 0) + self.assertIn("agc_disabled", result.stderr) + self.assertIn("disabled", result.stderr) + def test_device_limitations_match(self): for message in LIMITATIONS: with self.subTest(message=message): @@ -69,6 +83,17 @@ class SkipReportTests(unittest.TestCase): path.write_text(content, encoding="utf-8") return list(check_skips.skips(path)) + def test_ctest_disabled_status_is_not_silently_ignored(self): + with self.assertRaisesRegex(ValueError, "disabled.*not run"): + self.skipped('') + + def test_device_message_does_not_excuse_a_disabled_test(self): + with self.assertRaisesRegex(ValueError, "disabled.*not run"): + self.skipped('') + + def test_running_test_without_skipped_marker_is_not_a_skip(self): + self.assertEqual(self.skipped(''), []) + def test_skip_message_preserves_the_device_reason(self): found = self.skipped('') self.assertEqual(len(found), 1)