mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-11-01 15:51:37 -05:00
The repo mixed variants such as center/centre and color/colour, so a name could be spelled either way and searches missed half the hits. Standardize on the US spelling, matching .NET's own APIs (Color, Center). Wire values owned by other systems keep their spelling: the material ledger's "Cancelled" hold status and GitHub's "cancelled" job status. No behavior change beyond the spelling of a few status messages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
56 lines
2.0 KiB
Python
56 lines
2.0 KiB
Python
#!/usr/bin/env python3
|
|
"""Fail-closed tests for the exact command used by the final CI check."""
|
|
|
|
from pathlib import Path
|
|
import subprocess
|
|
import unittest
|
|
|
|
|
|
CHECK = Path(__file__).resolve().with_name("check-ci-results.sh")
|
|
|
|
|
|
class CIResultsTests(unittest.TestCase):
|
|
def check(self, *results):
|
|
return subprocess.run(
|
|
["bash", str(CHECK), *results],
|
|
capture_output=True,
|
|
text=True,
|
|
timeout=5,
|
|
)
|
|
|
|
def test_both_required_jobs_successful(self):
|
|
self.assertEqual(self.check("success", "success").returncode, 0)
|
|
|
|
def test_unit_matrix_failure_blocks_aggregate(self):
|
|
self.assertNotEqual(self.check("failure", "success").returncode, 0)
|
|
|
|
def test_synthetic_failure_blocks_aggregate(self):
|
|
self.assertNotEqual(self.check("success", "failure").returncode, 0)
|
|
|
|
def test_canceled_dependency_blocks_aggregate(self):
|
|
for results in [("cancelled", "success"), ("success", "cancelled")]:
|
|
with self.subTest(results=results):
|
|
self.assertNotEqual(self.check(*results).returncode, 0)
|
|
|
|
def test_skipped_dependency_blocks_aggregate(self):
|
|
for results in [("skipped", "success"), ("success", "skipped")]:
|
|
with self.subTest(results=results):
|
|
self.assertNotEqual(self.check(*results).returncode, 0)
|
|
|
|
def test_empty_unknown_and_nonliteral_results_block_aggregate(self):
|
|
for result in ["", "unknown", "SUCCESS", "success failure", "success\nsuccess"]:
|
|
with self.subTest(result=result):
|
|
self.assertNotEqual(self.check(result, "success").returncode, 0)
|
|
self.assertNotEqual(self.check("success", result).returncode, 0)
|
|
|
|
def test_missing_required_result_blocks_aggregate(self):
|
|
self.assertNotEqual(self.check().returncode, 0)
|
|
self.assertNotEqual(self.check("success").returncode, 0)
|
|
|
|
def test_extra_result_blocks_aggregate(self):
|
|
self.assertNotEqual(self.check("success", "success", "success").returncode, 0)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|