Skip to content

scripts: name a failed stage's tests in the job log - #107

Merged
novelKR merged 1 commit into
mainfrom
claude/project-thread-71t5wo
Oct 15, 2026
Merged

novelKR merged 1 commit into
mainfrom
claude/project-thread-71t5wo

Conversation

@novelKR

@novelKR novelKR commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

Requested by Seongjae · project thread

Issue

None. Found while recording P1-RECOVERY's post-merge CI on the tracker #101.

Summary

Before: when a CI stage failed, its job log showed only the command that exited non-zero. The failed test, where it panicked and the test counts were only in <stage>.log inside the uploaded artifact, which a reader of the job log alone cannot see. Main's post-merge CI failed one job on its first attempt three times in a row, and each passed on one re-run: macOS server DevGuard tests on 1fda789 (run 38686514388), macOS runner DevGuard tests on 385e177 (run 38708302887) and Linux cargo test --locked --workspace on 950e2b2 (run 38718331468). In none of them did the job log say which test failed.

After: when a stage fails, scripts/validate-upstream.py also prints the lines of that stage's log that name what failed: the failed tests (test … ... FAILED, and libtest's slow-test notice), where they panicked (thread '…' panicked at file:line:col:), the test counts, the cargo target to re-run or the test process that died with its signal, and unittest's FAIL: and ERROR: names. At most 40 lines are printed; the log keeps everything.

A test's own output is never repeated. A line is printed only when its whole text has one of those formats, so a panic message, captured output or a child's environment stays in the log (the concern behind #94).

Contract changes

None. The report (report.json), stage results, exit status and the CI workflow are unchanged, and a passing stage prints nothing new.

Tests

Verified at dea6c47, based on main 950e2b2:

  • python3 -B -m unittest discover -s scripts/tests: 105 tests OK, 3 of them new: a failed stage prints its failures and not the secret in their messages; which formats are and are not matched; an unreadable log and the 40-line cap.
  • python3 -B -m unittest discover -s scripts/tests -p 'test_ci_*.py': OK.
  • python3 -B scripts/check_docs.py: 20 paired documents verified, after reviewing the upstream-update pair and recording its hashes.
  • The formats come from real output of cargo and rustc 1.97 (a unit test, a doctest, and a test binary killed by SIGABRT) and Python 3.13 unittest (a failure, an error, an import error and a subtest).
  • End to end: validate-upstream.py python with a planted failing test printed FAIL: test_probe_fails (…) and FAILED (failures=1), not the secret in its assertion message. Without the planted test the stage passed and printed nothing new.

Not verified locally: the docs-site build, which needs Node 24.21.0; the Docs workflow runs it. CI on this PR runs every leg, since the plan treats the script as a build input.

Security scenarios

Token logging: this repository's job logs are public, so the summary repeats only names, counts and source locations, never message text. A test checks that a secret in a panic message or an assertion message is not printed.

Out of scope

No test is changed, retried or skipped, and the flaky tests behind the three re-runs are not fixed here. Which stages run, the artifacts, and the DevGuard and Codex pins do not change.

A failed stage's tests were named only in its log, which CI uploads as
an artifact, so a reader of the job log saw the command that failed but
not the test. When a stage fails, validate-upstream.py now also prints
the lines of that log that name what failed: the failed tests and where
they panicked, the test counts, and the failed cargo or unittest target.
A test's own output is never repeated, since its messages can carry a
child's environment.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@novelKR novelKR self-assigned this Oct 15, 2026
@novelKR
novelKR marked this pull request as ready for review October 15, 2026 11:13
@novelKR
novelKR merged commit 3fac934 into main Oct 15, 2026
19 checks passed
novelKR pushed a commit that referenced this pull request Oct 15, 2026
#107 names a failed stage's tests in the job log, changing
scripts/validate-upstream.py and docs/upstream-update.md; both merge
cleanly with this branch's macOS operator tests and runbook.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
novelKR pushed a commit that referenced this pull request Oct 15, 2026
CI sets CARGO_TERM_COLOR=always, so cargo writes its own lines with
terminal colors, and the summary that #107 added did not match cargo's
"error: test failed, to rerun pass ..." line: #108's Integration failure
printed the failed test and its panic but not the target to re-run.
Colors are now removed before a line is matched.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants