From e056e1487e3a76b887406a07e716f71045c16fe1 Mon Sep 17 00:00:00 2001 From: bsodfather Date: Sat, 21 Nov 2026 14:39:29 +0000 Subject: [PATCH] test(ci): align Crank policy checks with Epic PR routing --- tests/unit/test_ci_deploy_policy.py | 9 ++++----- tests/unit/test_ci_release_tooling_scope.py | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/unit/test_ci_deploy_policy.py b/tests/unit/test_ci_deploy_policy.py index b4c4218..0356d4c 100644 --- a/tests/unit/test_ci_deploy_policy.py +++ b/tests/unit/test_ci_deploy_policy.py @@ -156,11 +156,10 @@ class DeployPolicyTests(unittest.TestCase): self.assertIn("default: none", block) self.assertIn("required: true", block) - def test_push_main_source_ci_stays_enabled(self): - self.assertRegex( - workflow_text(), - r"(?m)^ push:\n branches:\n - main$", - ) + def test_full_ci_targets_main_pull_requests(self): + workflow = workflow_text() + self.assertRegex(workflow, r"(?m)^ pull_request:\n branches: \[main\]$") + self.assertNotRegex(workflow, r"(?m)^ push:") def test_deploy_requires_successful_required_checks(self): deploy = job_block("deploy") diff --git a/tests/unit/test_ci_release_tooling_scope.py b/tests/unit/test_ci_release_tooling_scope.py index c6cc0ea..5202a6f 100644 --- a/tests/unit/test_ci_release_tooling_scope.py +++ b/tests/unit/test_ci_release_tooling_scope.py @@ -112,7 +112,7 @@ class WorkflowScopeTests(unittest.TestCase): def test_only_four_heavy_rust_steps_are_skippable(self): workflow = WORKFLOW.read_text(encoding="utf-8") self.assertIn("run: python3 scripts/ci-release-tooling-scope.py", workflow) - self.assertIn("FORCE_FULL: ${{ inputs.validation_level == 'feature' || contains(gitea.event.pull_request.labels.*.name, 'feature-ready') }}", workflow) + self.assertIn("FORCE_FULL: ${{ gitea.event_name == 'pull_request' || inputs.validation_level == 'feature' }}", workflow) conditional = "if: steps.release_tooling.outputs.ci_only != 'true'" for name in ( "Check typed runtime configuration contract",