diff --git a/.github/workflows/cbz-g11-auditor.yml b/.github/workflows/cbz-g11-auditor.yml index 6c8047a4c..3a7cab52d 100644 --- a/.github/workflows/cbz-g11-auditor.yml +++ b/.github/workflows/cbz-g11-auditor.yml @@ -19,9 +19,9 @@ jobs: with: python-version: '3.11' - name: Run census controls normally - run: env -u PYTHONPATH -u PYTHONHOME -u PYTHONPYCACHEPREFIX -u PYTHONSTARTUP -u PYTHONUSERBASE python3 -B -S -m unittest tests.test_g11_census tests.test_g11_current_architecture_references + run: env -u PYTHONPATH -u PYTHONHOME -u PYTHONPYCACHEPREFIX -u PYTHONSTARTUP -u PYTHONUSERBASE python3 -B -S -m unittest tests.test_g11_census tests.test_g11_current_architecture_references tests.test_g11_current_atlas_formal_bridge_reference - name: Run census controls with optimization - run: env -u PYTHONPATH -u PYTHONHOME -u PYTHONPYCACHEPREFIX -u PYTHONSTARTUP -u PYTHONUSERBASE python3 -B -S -O -m unittest tests.test_g11_census tests.test_g11_current_architecture_references + run: env -u PYTHONPATH -u PYTHONHOME -u PYTHONPYCACHEPREFIX -u PYTHONSTARTUP -u PYTHONUSERBASE python3 -B -S -O -m unittest tests.test_g11_census tests.test_g11_current_architecture_references tests.test_g11_current_atlas_formal_bridge_reference - name: Run mutation self-test normally run: env -u PYTHONPATH -u PYTHONHOME -u PYTHONPYCACHEPREFIX -u PYTHONSTARTUP -u PYTHONUSERBASE python3 -B -S tools/cbz/g11_mutation_selftest.py - name: Run mutation self-test with optimization diff --git a/tests/test_atlas_formal_source_bridge.py b/tests/test_atlas_formal_source_bridge.py index 61be8a2c6..df3aad79a 100644 --- a/tests/test_atlas_formal_source_bridge.py +++ b/tests/test_atlas_formal_source_bridge.py @@ -64,8 +64,10 @@ def tearDown(self): def run_cli(self,*extra): self.input.write_text(json.dumps(self.snapshot)) - mode=['-O'] if sys.flags.optimize else [] - return subprocess.run([sys.executable,'-B',*mode,str(TOOL),'--root',str(self.root), + flags=(['-B'] + + (['-O'] if sys.flags.optimize else []) + + (['-O'] if sys.flags.optimize > 1 else [])) + return subprocess.run([sys.executable]+flags+[str(TOOL),'--root',str(self.root), '--snapshot',str(self.input),*extra],capture_output=True,text=True) def test_current_bridge_reproduces_original_evidence_and_records_only_two_control_changes(self): diff --git a/tests/test_g11_current_atlas_formal_bridge_reference.py b/tests/test_g11_current_atlas_formal_bridge_reference.py new file mode 100644 index 000000000..79ec531e3 --- /dev/null +++ b/tests/test_g11_current_atlas_formal_bridge_reference.py @@ -0,0 +1,27 @@ +"""Repository integration control for the current Atlas formal bridge CLI.""" + +import sys +import unittest +from pathlib import Path + + +ROOT = Path(__file__).resolve().parents[1] +sys.path.insert(0, str(ROOT / "tools" / "cbz")) +import g11_census as g11 # noqa: E402 + + +class CurrentAtlasFormalBridgeReference(unittest.TestCase): + def test_atlas_formal_source_bridge_has_static_execution_reference(self): + paths = ( + "tools/atlas_formal_source_bridge.py", + "tests/test_atlas_formal_source_bridge.py", + ) + files = {path: (ROOT / path).read_bytes() for path in paths} + report = g11.census(files, sorted(files))["tools"] + self.assertTrue( + report["tools/atlas_formal_source_bridge.py"]["referenced"] + ) + + +if __name__ == "__main__": + unittest.main()