Skip to content

ci(tests): run Vitest for the base baseline as well as head - #656

Merged
mergify[bot] merged 4 commits into
mainfrom
ci/tests-vitest-baseline
Nov 21, 2026
Merged

mergify[bot] merged 4 commits into
mainfrom
ci/tests-vitest-baseline

Conversation

@ashleyshaw

Copy link
Copy Markdown
Member

Summary

The compare job ("No new test failures") flagged pre-existing main failures as new, even on docs-only PRs (e.g. #649).

Root cause: the base matrix leg ran Jest. jest.config.js only matches **/*.test.js and has no TypeScript transform, so no .ts suite ever reached the base report. compare-jest-failures.cjs treats a file missing from the base report as 0 failures, so every head .ts failure counted as new. No suite in tests/, netlify/ or scripts/ uses jest.mock/jest.fn any more, so the Jest branch is no longer needed.

Changes

  • .github/workflows/tests.yml
    • Both targets now run npx vitest run --reporter=json --outputFile=jest-report.json --coverage=false. The Jest branch and the out-of-date cutover comment are gone, and the step is renamed Run Vitest.
    • The base leg uploads git ls-files output (base-files.txt) with its report. The compare step passes it as --base-files when it is present.
  • scripts/validation/compare-jest-failures.cjs
    • Format detection fix: Vitest's JSON report also has a top-level numFailedTests, so it was labelled [jest]. Detection now uses the Jest-only top-level keys (numRuntimeErrorTestSuites, wasInterrupted, openHandles) or legacy per-file numFailingTests.
    • New --base-files option: a failing head file that is missing from the base report but tracked at the base commit is listed as not comparable instead of new. A file the PR adds is not tracked at base, so it still counts as new.
  • scripts/validation/compare-jest-failures.test.js: 7 new tests covering format labels, not-comparable files, files the PR adds, a base file that passed, and a base file list that can't be read.

Path normalisation is unchanged. Both legs check out to $GITHUB_WORKSPACE, and Vitest reports absolute name paths in the same form as Jest, so path.relative matches across head and base.

Verification (local)

Scenario Result
Real Vitest report vs itself [vitest] on both lines, 0 new
Pre-existing .ts failure on both sides, Vitest baseline 0 new ✅
Same failure, old Jest baseline [jest] / [vitest], 1 "new" ❌ (reproduces the bug)
compare-jest-failures.test.js 20/20 pass

Full vitest run: 1066 passed, 1 failed. The failure is a 1 ms timing flake in tests/session/session.test.ts › renewSession, which this PR doesn't touch, and it passed on an earlier run.

Done when this PR's compare job summary shows [vitest] on both the base and head lines and no pre-existing main failures appear as new.

Follow-up (not in this PR)

jest.config.js and the Jest devDependencies (jest, jest-environment-node, @swc/jest, @types/jest) can't be removed yet. claude-guard-tests.yml and labeling-unified.yml still run npx jest -c jest.config.js, and two scripts carry @jest-environment docblocks. Removing Jest needs those workflows moved to Vitest first.


Generated by Claude Code

@vercel

vercel Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
thisonetimeonacidcom Ready Ready Preview Nov 21, 2026 11:26am UTC

@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 49 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between ed400c1 and 1d07d4b.

Files selected for processing: 4

  • .github/workflows/tests.yml
  • CHANGELOG.md
  • scripts/validation/compare-jest-failures.cjs
  • scripts/validation/compare-jest-failures.test.js
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions

Copy link
Copy Markdown

Drift Detection ✅

✅ No drift detected. Configuration is canonical.

Canonical governance files are correctly centralized in lightspeedwp/.github.

@github-actions

Copy link
Copy Markdown

✅ PR Template Routing

Branch prefix: ci
Template selected: pr_ci.md
Type: CI/CD PR


This PR's template has been automatically routed based on the canonical branching strategy defined in lightspeedwp/.github.

📋 Template routing rules:

✨ Automatic routing ensures all PRs follow the organization-wide governance structure.

@github-actions

Copy link
Copy Markdown

✅ Workflow Syntax Validation

All workflows in .github/workflows/ have been validated for YAML syntax.

Result: All workflows passed validation

@github-actions

Copy link
Copy Markdown

Drift Detection ✅

✅ No drift detected. Configuration is canonical.

Canonical governance files are correctly centralized in lightspeedwp/.github.

@github-actions

Copy link
Copy Markdown

✅ Workflow Syntax Validation

All workflows in .github/workflows/ have been validated for YAML syntax.

Result: All workflows passed validation

@github-actions

Copy link
Copy Markdown

📋 Changelog Quality Validation

Metric Count
✅ Passing 1
❌ Failing 0
🆕 New failures in this PR 0
📦 Pre-existing failures 0

Status

✅ Validation PASSED - No new failures introduced by this PR.

No action required.

@ashleyshaw
ashleyshaw marked this pull request as ready for review November 21, 2026 00:45
@mergify

mergify Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Queue requested — the merge queue status continues in this comment ↓.

The base job ran Jest, whose config only matches *.test.js and has no
TypeScript transform, so no .ts suite ever reached the baseline. The
compare script treats a file missing from the base report as zero
failures, so every pre-existing .ts failure on main showed up as new,
even on docs-only PRs. No suite uses jest.mock/jest.fn any more, so run
Vitest on both targets.

Also fix format detection in compare-jest-failures.cjs: Vitest's JSON
report carries numFailedTests too, so it was labelled [jest]. Use the
Jest-only top-level keys instead.

Add an optional --base-files list (git ls-files at base, uploaded by the
base job). A failing head file that exists at base but is missing from
the base report is now reported as "not comparable" rather than new;
files added by the PR still count as new.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CADHZgpqByUXMSV8M5d5HQ
@ashleyshaw
ashleyshaw force-pushed the ci/tests-vitest-baseline branch from 1ce639e to 1c8bbcb Compare November 21, 2026 02:16
@github-actions

Copy link
Copy Markdown

✅ Workflow Syntax Validation

All workflows in .github/workflows/ have been validated for YAML syntax.

Result: All workflows passed validation

@github-actions

Copy link
Copy Markdown

Drift Detection ✅

✅ No drift detected. Configuration is canonical.

Canonical governance files are correctly centralized in lightspeedwp/.github.

@github-actions

Copy link
Copy Markdown

Drift Detection ✅

✅ No drift detected. Configuration is canonical.

Canonical governance files are correctly centralized in lightspeedwp/.github.

@github-actions

Copy link
Copy Markdown

✅ Workflow Syntax Validation

All workflows in .github/workflows/ have been validated for YAML syntax.

Result: All workflows passed validation

@ashleyshaw

Copy link
Copy Markdown
Member Author

@Mergifyio rebase

@mergify

mergify Bot commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

rebase

✅ Branch has been successfully rebased

Signed-off-by: Ash Shaw <ashley@lightspeedwp.agency>
@github-actions

Copy link
Copy Markdown

Drift Detection ✅

✅ No drift detected. Configuration is canonical.

Canonical governance files are correctly centralized in lightspeedwp/.github.

@github-actions

Copy link
Copy Markdown

✅ Workflow Syntax Validation

All workflows in .github/workflows/ have been validated for YAML syntax.

Result: All workflows passed validation

@ashleyshaw

Copy link
Copy Markdown
Member Author

@Mergifyio rebase

@mergify

mergify Bot commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

rebase

✅ Branch has been successfully rebased

@ashleyshaw

Copy link
Copy Markdown
Member Author

@Mergifyio queue

@ashleyshaw ashleyshaw self-assigned this Nov 21, 2026
@mergify

mergify Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

✅ Merged into main as fbe053d at 11:28 UTC

Less than a minute in the queue, with no time running CI.

So far

  • ✅ Entered the queue Sat 21 Nov, 11:28 · rule default · triggered by @ashleyshaw with the @mergifyio queue command
  • ✅ Checks skipped · PR is already up-to-date
  • ✅ Merged 11:28 · fbe053d

Times in UTC · dashboard · how the merge queue works

@mergify mergify Bot added the queued label Nov 21, 2026
@mergify
mergify Bot merged commit fbe053d into main Nov 21, 2026
27 of 28 checks passed
@mergify
mergify Bot deleted the ci/tests-vitest-baseline branch November 21, 2026 11:28
@mergify mergify Bot removed the queued label Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants