Repository navigation
ci(tests): run Vitest for the base baseline as well as head - #656
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reachedYou'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. View limit details
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. |
Drift Detection ✅✅ No drift detected. Configuration is canonical. Canonical governance files are correctly centralized in lightspeedwp/.github. |
✅ PR Template RoutingBranch prefix: 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. |
|
✅ Workflow Syntax Validation All workflows in Result: All workflows passed validation |
Drift Detection ✅✅ No drift detected. Configuration is canonical. Canonical governance files are correctly centralized in lightspeedwp/.github. |
|
✅ Workflow Syntax Validation All workflows in Result: All workflows passed validation |
📋 Changelog Quality Validation
Status✅ Validation PASSED - No new failures introduced by this PR. No action required. |
|
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
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CADHZgpqByUXMSV8M5d5HQ
1ce639e to
1c8bbcb
Compare
|
✅ Workflow Syntax Validation All workflows in Result: All workflows passed validation |
Drift Detection ✅✅ No drift detected. Configuration is canonical. Canonical governance files are correctly centralized in lightspeedwp/.github. |
Drift Detection ✅✅ No drift detected. Configuration is canonical. Canonical governance files are correctly centralized in lightspeedwp/.github. |
|
✅ Workflow Syntax Validation All workflows in Result: All workflows passed validation |
|
@Mergifyio rebase |
✅ Branch has been successfully rebased |
Signed-off-by: Ash Shaw <ashley@lightspeedwp.agency>
Drift Detection ✅✅ No drift detected. Configuration is canonical. Canonical governance files are correctly centralized in lightspeedwp/.github. |
|
✅ Workflow Syntax Validation All workflows in Result: All workflows passed validation |
|
@Mergifyio rebase |
✅ Branch has been successfully rebased |
|
@Mergifyio queue |
✅ Merged into
|
Summary
The
comparejob ("No new test failures") flagged pre-existingmainfailures as new, even on docs-only PRs (e.g. #649).Root cause: the
basematrix leg ran Jest.jest.config.jsonly matches**/*.test.jsand has no TypeScript transform, so no.tssuite ever reached the base report.compare-jest-failures.cjstreats a file missing from the base report as 0 failures, so every head.tsfailure counted as new. No suite intests/,netlify/orscripts/usesjest.mock/jest.fnany more, so the Jest branch is no longer needed.Changes
.github/workflows/tests.ymlnpx 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.git ls-filesoutput (base-files.txt) with its report. The compare step passes it as--base-fileswhen it is present.scripts/validation/compare-jest-failures.cjsnumFailedTests, so it was labelled[jest]. Detection now uses the Jest-only top-level keys (numRuntimeErrorTestSuites,wasInterrupted,openHandles) or legacy per-filenumFailingTests.--base-filesoption: 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 absolutenamepaths in the same form as Jest, sopath.relativematches across head and base.Verification (local)
[vitest]on both lines, 0 new.tsfailure on both sides, Vitest baseline[jest]/[vitest], 1 "new" ❌ (reproduces the bug)compare-jest-failures.test.jsFull
vitest run: 1066 passed, 1 failed. The failure is a 1 ms timing flake intests/session/session.test.ts › renewSession, which this PR doesn't touch, and it passed on an earlier run.Done when this PR's
comparejob summary shows[vitest]on both the base and head lines and no pre-existingmainfailures appear as new.Follow-up (not in this PR)
jest.config.jsand the Jest devDependencies (jest,jest-environment-node,@swc/jest,@types/jest) can't be removed yet.claude-guard-tests.ymlandlabeling-unified.ymlstill runnpx jest -c jest.config.js, and two scripts carry@jest-environmentdocblocks. Removing Jest needs those workflows moved to Vitest first.Generated by Claude Code