Skip to content

Harness: one diff-mode test per scenario - #413

Open
agorischek wants to merge 3 commits into
mainfrom
harness/graph-diff-per-scenario
Open

agorischek wants to merge 3 commits into
mainfrom
harness/graph-diff-per-scenario

Conversation

@agorischek

Copy link
Copy Markdown
Collaborator

What changed

packages/renderers/harness/browser/diff.spec.ts now runs one diff-mode test per scenario (graph/<id>: diff mode marks every change in its own form, likewise for the other six renderers) instead of one test per renderer. Each test checks the light and dark color modes and gets the default per-test budget (120 s in CI), without test.slow().

The graph test walked all 34 graph scenarios in both color modes in a single test, and timed out at its 360 s budget on CI's Linux WebKit on #363 (webkit-desktop) and on #394 (webkit-mobile), which touches no rendering. Recent merges added heavy scenarios such as terraform-modules-nat-per-az (#377), and the walk now sits at the edge of its budget. One test per scenario gets one scenario's budget, and fullyParallel sharding spreads the walk across shards.

The bundled fonts aren't the cause. WebKit loads both faces without hitting the 3 s fallback in connectRenderer. Before #363 (56f1a06), opening all 34 graph scenarios once took 45.9 s; with it, 47.4 s (+3%, within run-to-run noise). The whole old test took 1.8 min locally either way.

Refs #363

Evidence

Measured on a 2-core Linux machine with CI=1:

  • Old single graph test, webkit-desktop: 1.8 min, both with and without the bundled fonts. CI's runner is over 3.3× slower, so it exceeded 360 s.
  • npx playwright test browser/diff.spec.ts -g "graph/.*diff mode" --project=webkit-desktop: 34 passed (2.3 min with 2 workers). Per scenario: median ~6 s; slowest terraform-modules-nat-per-az 21.4 s, module-graph-hub-heavy-now 17.2 s, npm-express-5 16.4 s.
  • npx playwright test browser/diff.spec.ts --project=chromium-desktop: 98 passed (4.6 min with 2 workers). Graph per scenario: 3.2–11.6 s (slowest terraform-modules-nat-per-az).
  • tools check --fast: pass.

Not run here: webkit-mobile, chromium-mobile, and the macOS jobs.

  • Documentation that this change affects is updated, and generated reference
    pages are regenerated (npm run docs:generate). (None affected.)
  • Fixes include a regression test. (Test-only change.)
  • A changelog fragment at changelog.d/<this PR's number>.md describes what
    users will notice, or the PR has the no changelog label (see
    changelog.d/README.md).
  • No credentials, private source or machine-specific paths are included.

A test per renderer walked all 34 graph scenarios in both color modes and
outgrew test.slow()'s 360 s on CI's Linux WebKit. One test per scenario
gets a scenario's budget, and the shards split the walk.

Refs #363

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@agorischek agorischek added the no changelog Users won't notice this change: no changelog.d/ fragment needed (changelog.d/README.md) label Dec 5, 2026
@agorischek
agorischek requested a balanced review from Copilot December 5, 2026 02:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

There are no active review issues blocking the per-scenario diff-mode test refactor.

No open issues 🎉

What changed in this PR

Splits the renderer harness’s diff-mode checks into per-scenario tests to address Linux WebKit timeouts as scenario coverage grows.

Changes:

  • Gives each scenario its own default test budget, removing test.slow().
  • Enables scenarios to be distributed across parallel shards.
  • Preserves light/dark checks, assertions, and optional screenshots.
File Description
packages/​renderers/​harness/​browser/​diff.spec.ts Registers one diff-mode test per scenario instead of per renderer.

Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no changelog Users won't notice this change: no changelog.d/ fragment needed (changelog.d/README.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants