Skip to content

test: 'All tests passed (N/N)' counts unit-only or unit+examples depending on cache state, with identical wording #3779

Closed

Description

@zackees

Split out of #3763 / PR #3778, which fixed the labelling half. This is the denominator half.

The ambiguity

bash test --cpp runs "unit tests and examples". Both feed the same headline:

✅ All tests passed (N/N in Xs)

N means unit tests + examples on a run where the examples actually executed, and unit tests only on a run where the examples fingerprint was already valid. The wording is byte-identical in both cases.

Measured on a clean checkout:

measure count
test sources from discover_test_files() (authoritative unit count) 274
test .dll binaries built 274
test_list_cache.txt entries 274
headline on a run where examples also execute 357

357 - 274 = 83 — the example targets. That 83 is exactly the discrepancy the reporter of #3763 computed independently ("83 test binaries were not part of that number").

Reproduction

rm .cache/fingerprint/cpp_test_quick.json   # force unit tests to run
bash test --cpp
# ✅ All tests passed (274/274 in 30.49s)   <- unit only

versus a run where examples execute too, which reports 357 under the same sentence. Neither number is wrong; the problem is that a reader — or an agent deciding whether to merge — cannot tell which set was counted.

Why it matters

This is the same failure class #3763 was filed over: a number that reads as authoritative full-suite health while silently covering a smaller set. #3778 fixed it for filtered runs and for entries of unknown provenance, but a reader still cannot distinguish "274 unit tests, examples cached" from "274 of 357 things I expected".

Suggested direction

Report the categories explicitly rather than summing them into one anonymous denominator, e.g.:

✅ All tests passed (274/274 unit, 83/83 examples in 48.0s)
✅ All tests passed (274/274 unit; examples cached, not re-run)

The second form matters most — it is the one that currently masquerades as a full pass. The category breakdown already exists in the results table at the end of a run; the headline just does not carry it.

Note the same reasoning applies to the replayed cache line, which #3778 now annotates with scope but still prints a single denominator.

Activity

  1. zackees commented on Jul 31, 2026

    @zackees
    MemberAuthor

    Scoped this out and stopped short of implementing, because the obvious fix is wrong. Recording the plumbing so the next attempt starts from facts.

    Where the headline is produced

    Three sites print the same string:

    • ci/meson/streaming_runner.py:450 (the usual path)
    • ci/meson/test_execution.py:254
    • ci/meson/sequential_runner.py:520

    The tempting fix, and why it is wrong

    streaming_runner.py:393 already computes what looks like the answer:

    include_examples = not (ctx.exclude_suites and "fastled:examples" in ctx.exclude_suites)

    and it is in scope at the summary, so labelling the headline unit + examples / unit only from it is a two-line change.

    That label would be wrong. exclude_suites=["fastled:examples"] is set at exactly one call site — ci/util/test_runner.py:1567, the unit-tests-only mode. The mixed --cpp path (:1639) never passes it, so include_examples is always True there. But I measured mixed --cpp reporting 274/274 while a clean run of the same tree reports 357. The label would therefore assert "unit + examples" over a count that plainly did not include the 83 example targets.

    That is the same defect this issue is about, just relocated into a label that now looks authoritative. Strictly worse than the status quo, which is at least ambiguous rather than confidently wrong.

    What the real fix needs

    The label has to come from what actually ran, not what was requested. Meson test names carry a suite prefix (fastled:<name> — see the comment at ci/meson/test_execution.py:213), so the attribution exists in the output and is simply discarded: StreamingResult keeps num_passed and failed_names only, and passed names are never retained.

    So the change is:

    1. Count by suite prefix in the streaming parse loop (ci/meson/streaming.py:727, where num_passed += 1 happens) — either retain passed names or keep a per-suite counter.
    2. Carry the breakdown on StreamingResult / MesonTestResult.
    3. Render it: 274/274 unit, 83/83 examples — and when a category contributed nothing because it was cached, say that explicitly rather than omitting it.

    Step 1 sits in the path every test run goes through, so it wants real validation: confirm the per-suite counts sum to the existing total across unit-only, mixed, and filtered runs before trusting the new denominator.

    Still open

    I did not chase down why mixed --cpp reported 274 rather than 357 when exclude_suites was never set. Either the example targets are not being run in that state, or they are excluded by some other route. Whoever implements the breakdown will likely surface the answer for free — a per-suite count of 0 examples in a run that requested them makes the discrepancy self-evident, which is itself a good argument for doing this properly rather than patching the label.

  2. moved this from Triage to Done in FastLED Trackeron Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions