test: report which corpora a run actually had (#16 remedy 2) #19

Merged
fabi merged 2 commits from fix/corpus-report into main 2026-09-09 16:50:53 +00:00
Owner

Implements #16's remedy (2) — emit the mode unconditionally, which the issue's own
discussion settled as the only remedy that touches the report, and the report is the
defect. Remedies (1) and (3) improve the control and are deliberately left open.

What was wrong

cargo test --workspace reports the same tally whether the disc corpus was exercised or
entirely absent:

CI developer desktop
test execution 2.4 s, slowest suite 0.29 s 1 936 s, mesh_consistency_disc alone 1 220 s
reported tally 207 / 0 / 14, 30 suites identical

Two mechanisms compound, and either alone would be survivable:

  1. A skip is a passing test. The gated suites eprintln!("SKIP: …") and return early
    from a test that still passes, so a skipped suite and a fully exercised one both score
    1 passed. The totals are invariant.
  2. The message is invisible. cargo test captures a passing test's output, so
    neither log contains a SKIP: line. The absence of one proves nothing, which makes
    the obvious check useless too.

And 14 ignored cannot help: #[ignore] is static, so that column is the literal count of
attributes in the source and cannot move at runtime.

What this adds

crates/sylpheed-formats/tests/corpus_report.rs — always runs, never fails, resolves all
three corpora exactly as the per-suite helpers do, and records what was actually available.

It writes to a file rather than relying on stdout, because a passing test's stdout is
captured and would be invisible in exactly the CI log that needs it. The workflow then
prints that file, and the test also appends to GITHUB_STEP_SUMMARY when set.

Run on a machine that has the corpora, it immediately shows the thing the issue is about:

SYLPHEED_DISC   PRESENT via the HARDCODED fallback, NOT $SYLPHEED_DISC
SYLPHEED_RES3D  PRESENT via the HARDCODED fallback, NOT $SYLPHEED_RES3D
SYLPHEED_ISO    PRESENT via the HARDCODED fallback, NOT $SYLPHEED_ISO

SYLPHEED_DISC is not controlling anything here. That was invisible before.

The branch CI takes is the one that cannot be tested here

A machine with the corpora can never reach ABSENT, so it would have shipped unrun.
resolve_renders_every_branch exercises it directly — along with "set but does not
resolve"
, which is what a typo in the env var produces, and which is reported as a
different state from absent because the two want different fixes.

Scope, and one thing deliberately not fixed

This does not remove the hardcoded fallbacks or de-duplicate the 17 disc_root()
definitions — that is remedy (3), and doing it alone would make the desktop match CI by
doing less work
, which is the wrong direction. It also does not narrow the gating surface,
which is wider than #16 currently states: 46 files under examples/, 22 under tests/,
6 under src/, and five env vars, two of which (SYLPHEED_REST_RULE,
SYLPHEED_KF_TIME_SHIFT) are behaviour knobs rather than corpus locators. Worth folding
into #16 before anyone implements (3).

Verification

  • cargo fmt --all -- --check — clean (this branch adds no fmt debt to a tree that just
    reached zero)
  • both tests pass
  • clippy is unchanged by this: it is a test target, and CI's cargo clippy --workspace
    does not build test cfg. It fails identically on unmodified main on this desktop
    with only_used_in_recursion at vfs.rs:85 — the rustc 1.90.0 vs runner 1.98.1
    divergence, i.e. #15, not this PR.

The second commit corrects the first: 4057bee's message quoted output the code did not
produce, because a cleanup edit silently no-op'd before it was committed. Not squashed —
force-push is denied on this remote, and a visible correction beats rewritten history.

Refs #16

🤖 Generated with Claude Code

Implements **#16's remedy (2) — emit the mode unconditionally**, which the issue's own discussion settled as the only remedy that touches the *report*, and the report is the defect. Remedies (1) and (3) improve the *control* and are deliberately left open. ## What was wrong `cargo test --workspace` reports the same tally whether the disc corpus was exercised or entirely absent: | | CI | developer desktop | |---|---|---| | test execution | **2.4 s**, slowest suite 0.29 s | **1 936 s**, `mesh_consistency_disc` alone **1 220 s** | | reported tally | 207 / 0 / 14, 30 suites | **identical** | Two mechanisms compound, and either alone would be survivable: 1. **A skip is a passing test.** The gated suites `eprintln!("SKIP: …")` and return early from a test that *still passes*, so a skipped suite and a fully exercised one both score `1 passed`. The totals are invariant. 2. **The message is invisible.** `cargo test` captures a passing test's output, so **neither log contains a `SKIP:` line**. The absence of one proves nothing, which makes the obvious check useless too. And `14 ignored` cannot help: `#[ignore]` is static, so that column is the literal count of attributes in the source and cannot move at runtime. ## What this adds `crates/sylpheed-formats/tests/corpus_report.rs` — always runs, never fails, resolves all three corpora exactly as the per-suite helpers do, and records what was actually available. It writes to a **file** rather than relying on stdout, because a passing test's stdout is captured and would be invisible in exactly the CI log that needs it. The workflow then prints that file, and the test also appends to `GITHUB_STEP_SUMMARY` when set. Run on a machine that has the corpora, it immediately shows the thing the issue is about: ``` SYLPHEED_DISC PRESENT via the HARDCODED fallback, NOT $SYLPHEED_DISC SYLPHEED_RES3D PRESENT via the HARDCODED fallback, NOT $SYLPHEED_RES3D SYLPHEED_ISO PRESENT via the HARDCODED fallback, NOT $SYLPHEED_ISO ``` **`SYLPHEED_DISC` is not controlling anything here.** That was invisible before. ## The branch CI takes is the one that cannot be tested here A machine with the corpora can never reach `ABSENT`, so it would have shipped unrun. `resolve_renders_every_branch` exercises it directly — along with *"set but does not resolve"*, which is what a typo in the env var produces, and which is reported as a **different state** from absent because the two want different fixes. ## Scope, and one thing deliberately not fixed This does not remove the hardcoded fallbacks or de-duplicate the 17 `disc_root()` definitions — that is remedy (3), and doing it alone would make the desktop match CI *by doing less work*, which is the wrong direction. It also does not narrow the gating surface, which is wider than #16 currently states: **46 files under `examples/`**, 22 under `tests/`, 6 under `src/`, and **five** env vars, two of which (`SYLPHEED_REST_RULE`, `SYLPHEED_KF_TIME_SHIFT`) are behaviour knobs rather than corpus locators. Worth folding into #16 before anyone implements (3). ## Verification - `cargo fmt --all -- --check` — clean (this branch adds no fmt debt to a tree that just reached zero) - both tests pass - clippy is unchanged by this: it is a test target, and CI's `cargo clippy --workspace` does not build test cfg. It fails identically on **unmodified `main`** on this desktop with `only_used_in_recursion` at `vfs.rs:85` — the rustc 1.90.0 vs runner 1.98.1 divergence, i.e. **#15**, not this PR. The second commit corrects the first: `4057bee`'s message quoted output the code did not produce, because a cleanup edit silently no-op'd before it was committed. Not squashed — force-push is denied on this remote, and a visible correction beats rewritten history. Refs #16 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fabi added 2 commits 2026-09-09 05:40:46 +00:00
`cargo test --workspace` reports the same tally whether the disc corpus was
exercised or entirely absent. Measured: the disc suites RAN on a developer
desktop (1936 s, mesh_consistency_disc alone 1220 s) and SKIPPED on CI
(2.4 s total) -- and both reported 207 passed / 0 failed / 14 ignored across
30 suites.

Two mechanisms compound:

  * a skip is a PASSING test. The gated suites `eprintln!("SKIP: ...")` and
    return early from a test that still passes, so a skipped suite and a
    fully exercised one both score 1 passed. The totals are invariant.
  * the message is invisible. `cargo test` captures a passing test's output,
    so NEITHER log contains a `SKIP:` line. The absence of one proves
    nothing, which makes the obvious check useless too.

And `14 ignored` cannot help: `#[ignore]` is static, so that column is the
literal count of attributes in the source and cannot move at runtime. Ask
what this check would still report if the corpus were entirely absent, and
the answer is 207/0/14.

This is #16's remedy (2) -- the only one that touches the REPORT, which is
the defect. Remedies (1) and (3) improve the control and are left open.

Adds `tests/corpus_report.rs`: always runs, never fails, resolves all three
corpora exactly as the per-suite helpers do, and records what was available.
It writes to a FILE rather than relying on stdout, because a passing test's
stdout is captured and would be invisible in exactly the CI log that needs
it; the workflow then prints that file. It also appends to
GITHUB_STEP_SUMMARY when set.

Run here, it immediately shows the thing the issue is about -- all three
corpora resolve through the HARDCODED fallback, so SYLPHEED_DISC is not
controlling anything on this machine:

  SYLPHEED_DISC   PRESENT via the HARDCODED fallback, NOT $SYLPHEED_DISC
  SYLPHEED_RES3D  PRESENT via the HARDCODED fallback, NOT $SYLPHEED_RES3D
  SYLPHEED_ISO    PRESENT via the HARDCODED fallback, NOT $SYLPHEED_ISO

The ABSENT branch is the one CI takes and cannot be reached on a machine
that has the corpora, so `resolve_renders_every_branch` exercises it
directly rather than shipping it unrun -- along with "set but does not
resolve", which is what a typo in the env var produces and which is
deliberately reported as a DIFFERENT state from absent, since the two want
different fixes.

Verified: `cargo fmt --all -- --check` clean. Clippy is unchanged by this
(a test target; CI's `cargo clippy --workspace` does not build test cfg) --
it fails identically on unmodified main here with
`only_used_in_recursion` at vfs.rs:85, which is the rustc 1.90.0 vs the
runner's 1.98.1 divergence, i.e. #15, not this.

Refs #16

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
test: build the fallback message with format!, matching the commit before it
All checks were successful
CI / Native — linux (pull_request) Successful in 33m26s
CI / WASM — Web (pull_request) Successful in 29m10s
CI / Formatting (pull_request) Successful in 53s
f78e308ca7
`4057bee` claimed the report prints

  SYLPHEED_DISC   PRESENT via the HARDCODED fallback, NOT $SYLPHEED_DISC

and it did not. The string was built by `"...(not ${env})".replace("${env}",
env)` -- a placeholder substituted at runtime, which printed
`(not SYLPHEED_DISC)` and dropped the `$`. I had cleaned this up before
committing, but the edit silently no-op'd (rustfmt had already rewrapped the
line, so the pattern no longer matched) and the commit went ahead with the
message quoting output the code does not produce.

Now a plain `format!`, which is what it should have been: shorter, no
placeholder to keep in sync, and the `$` makes it read as the env var it is.
The quoted output in `4057bee` is accurate as of this commit.

Not squashed into it because force-push is denied on this remote, and a
visible correction is worth more than a rewritten history anyway.

Verified: `cargo fmt --all -- --check` clean, both tests pass, output matches
the text above exactly.

Refs #16

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
fabi merged commit 1ec2e4ca57 into main 2026-09-09 16:50:53 +00:00
Sign in to join this conversation.