Skip to content

Group parametrized tests in the report - #1

Merged
jmduke merged 1 commit into
mainfrom
parametrized-test-grouping
Sep 18, 2026
Merged

jmduke merged 1 commit into
mainfrom
parametrized-test-grouping

Conversation

@jmduke

@jmduke jmduke commented Sep 18, 2026

Copy link
Copy Markdown
Member

The tests table printed one row per parametrize case, each one a full nodeid that wrapped mid-path. A single parametrized test could push everything else out of view.

Labels

split_nodeid() splits path::Class::test[case] into its three parts, reading the id from the first [ to the trailing ] so ids that contain :: or brackets survive. _test_label() then renders a nodeid as a dim path, the test name, and the parametrize id in its own chip, with the whole nodeid as the tooltip.

Labels no longer wrap. Deep paths drop leading directories in Python (…/dmarc-report--test.py::), and under further pressure the path clips before the name does — code.tid is an inline-flex where only the path shrinks.

_nodeid_short(), which writes nodeids into the TODO prose, had the opposite bug: it cut from the left and kept the tail, so a parametrized test lost its name and kept its id. The name now survives every cut.

Grouping

The cases of one parametrized test collapse into a family row that totals them (3 cases, summed wall/setup/call/cpu/queries/db/http, plus a red k failed pill if any case failed). Click the row to open its cases; the toggle in the Tests heading flattens the whole table into one row per case. Grouping is the default. Sorting understands both views: grouped, it orders families and keeps each family's cases underneath; ungrouped, it sorts every case globally.

Also

  • The wall-time bar is gone from the test rows. The other tables keep theirs.
  • The GC TODO needed only a 2% share of CPU, so 4ms of collection in a fast suite raised it. It now needs GC_MIN_S = 1.0 seconds as well.

Testing

mise run test (50 passed) and mise run lint. New tests cover the nodeid split, the shortening, and the grouped markup. Rendering was checked by generating a report over a demo suite with stacked parametrize, a class, a very long id, and a deep path — not by clicking through a browser, since the Chrome extension was not connected here.

🤖 Generated with Claude Code

The tests table printed one row per parametrize case, each one a full
nodeid that wrapped mid-path, so a single parametrized test could push
everything else out of view.

Parse the nodeid instead of printing it whole: the path is dim and drops
leading directories when it is long, the test name is never clipped, and
the parametrize id gets its own chip. The cases of one test collapse into
a family row that totals them, expandable per family or flattened for the
whole table with the toggle in the Tests heading. Sorting understands
both views.

Also drop the wall-time bar from the test rows, and stop raising the GC
TODO for a few milliseconds of collection — it now needs a second of GC
as well as its share of CPU.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@jmduke
jmduke marked this pull request as ready for review September 18, 2026 14:33
@jmduke
jmduke merged commit efd507d into main Sep 18, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant