Repository navigation
ctest_skips: --root defaults to the repo, not the caller's cwd (a wrong root reads as a broken baseline) - #2749
Conversation
…e#2730) The row this PR adds runs at the repo root, where "." happens to be right. Run by hand from anywhere else it read a stranger's baseline and reported all 16 skipped tests as unbaselined -- a wrong --root is indistinguishable from a broken baseline, which is how I misread it for a while. Every sibling tool resolves its root from __file__ for this reason. Parser extracted as _parser() so the default is testable; the new arm fails when the default goes back to ".". Measured with a real 375-test CI log (16 skips): cwd=/ , no --root before: 16x 'does not name it', rc 1 after: 'all named in the baseline', rc 0 mutant (default='.') self-test FAILS on the new arm
|
VERDICT at 4665205: READY. The default is fixed the way the family does it, the arm asserts the value rather than the help text, and the reason is stated in one line that is worth keeping verbatim. One symmetric half is left: an explicit What is rightTOOL_ROOT = pathlib.Path(__file__).resolve().parents[2]
ap.add_argument("--root", default=str(TOOL_ROOT),
help="… (default: the repo this tool ships in, never the caller's cwd)")
The ask:
|
|
Undrafted —
|
…e's header (engine#2750) (#2756) --write is the documented way to maintain the baseline, and it did two things that let the check be satisfied without evidence: it baselined a new skip as '# TODO: why this cannot run here' and the check then passed, and it regenerated the file from three hard-coded lines, so the Apache notice every engine file carries disappeared after one run. Now a NEW name requires --reason; existing entries keep the reason they already carry, so the routine refresh is still one command; and the leading comment block is preserved verbatim. Measured on a real 375-test CI log: a new skip without --reason -> rc 1, nothing written, the test named on stderr; with --reason -> the caller's reason is recorded; the licence header survives. Mutants: dropping the --reason requirement fails 4 arms, regenerating the header fails 1. Held un-pushed while engine#2749 (same file) is open -- two open PRs to one file is the case two-open-prs-one-file warns about. Lands on top of #2749 once it merges. Co-authored-by: bong-water-water-bong <[email protected]>
Refs #2730 (that issue closed in #2736, which wired
ctest_skips.py --loginto CI; this is the footgun the wiring exposed).The defect
tools/ci/ctest_skips.py's--rootdefaulted to"."— the caller's cwd. Every sibling tool in this repo (registry_build.py,merged_tail_check.py) resolves its root from__file__, because a tool that reads "the tree I am in" answers differently depending on where you stand.The row #2736 added runs at the repo root, where
"."happens to be right, so CI was never wrong. Run by hand from anywhere else, the tool reads a stranger's baseline and reports every skipped test as unbaselined:That output is indistinguishable from a genuinely broken baseline — which is exactly how I misread it while wiring #2736, for long enough to believe #2726 had failed to merge.
The change
The parser is extracted as
_parser()so the default is testable — otherwise this fix would ship with no arm, which is the defect this repo has a policy about. One new arm:Measured
On a real 375-test CI log with 16 skips:
Mutant, so the arm is shown to fire: setting the default back to
"."makes--self-testFAIL with--self-testis 12/12 with the fix,scripts/pre-pr-checks.sh12 green / 3 skipped,git diff origin/mainis this one file (+14/−3).Opened as a draft: engine had 8 non-draft open PRs against the cap of three at 19:18Z, and a draft runs the same build, so it undrafts on green rather than adding a merge-eligible row now.