CI-18 review: --head needs B checked out; guard the CI image against CI_ONLY
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:
co-authored by
Claude Opus 5.5
parent
b2d3066966
commit
22ef89bf10
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user