CI-18 review: --head needs B checked out; guard the CI image against CI_ONLY
checks / unit (pull_request) Successful in 20m22s
infra-pin / fresh (pull_request) Successful in 1s

The selector reads the graph, and run-affected.sh runs the tests, from the
working tree, so a --base/--head range is only right with the head checked
out. The CI image is built from the merged tree, so an ENV CI_ONLY in its
Dockerfile would make the gate partial; test_affected_tests.py now fails on it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
glenn schrooyen
2026-11-15 23:29:34 +01:00
co-authored by Claude Opus 5.5
parent b2d3066966
commit 22ef89bf10
4 changed files with 10 additions and 5 deletions
+7 -2
View File
@@ -13,8 +13,8 @@ here are the ones whose failure would be a missed test:
run-tests.sh select ALL, a changed test file is chosen.
4. THE MUTANT: break a real module in a private copy of the tree; the
selector must choose a test that goes red, and the unbroken copy is green.
5. The merge gate cannot be partial: checks.yml never mentions CI_ONLY and
still runs the unfiltered run-tests.sh line.
5. The merge gate cannot be partial: checks.yml and the CI image never
mention CI_ONLY, and checks.yml still runs the unfiltered run-tests.sh line.
Read MUTATION.md before you report a survivor.
"""
@@ -256,6 +256,11 @@ with open(os.path.join(REPO, ".gitea", "ci", "run-tests.sh"),
rt = fh.read()
check("run-tests.sh takes CI_ONLY from the environment only and says PARTIAL",
"PARTIAL RUN" in rt and 'set -- test_*.py' in rt)
with open(os.path.join(REPO, ".gitea", "ci", "Dockerfile"),
encoding="utf-8") as fh:
df = fh.read()
check("the CI image (built from the merged tree) never sets CI_ONLY",
"CI_ONLY" not in df)
for d in tmps:
shutil.rmtree(d, ignore_errors=True)