From ffb44b5700c39e385e71b81ffd63788541870031 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 20 Nov 2026 11:51:24 +0000 Subject: [PATCH] ci(tests): run Vitest on base as well as head The comparison job ran Jest on the PR base and Vitest on the head. Jest's testMatch only covers *.test.js, so TypeScript suites never ran on base and every failure in them was reported as new on each PR (e.g. 66 "new" failures on #652 that already existed on main). main now passes the full Vitest suite (1060 passed, 0 failed locally), so the Jest baseline the cutover comment relied on is no longer needed. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01CADHZdpaiuKYHLz2mX9por --- .github/workflows/tests.yml | 19 ++++++------------- CHANGELOG.md | 1 + 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8e6c2765..60583c96 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -95,23 +95,16 @@ jobs: - name: Install dependencies run: npm ci --ignore-scripts --prefer-offline --no-audit --no-fund - - name: Run tests (Jest on base, Vitest on head during cutover) + - name: Run tests (Vitest on head and base) env: EVENT_NAME: ${{ github.event_name }} - TARGET: ${{ matrix.target }} run: | - # During Jest-to-Vitest cutover: base contains jest.mock() calls, - # head contains vi.* mocks. Use Jest baseline to ensure head comparison - # is valid. Once base catches up, simplify to Vitest everywhere. + # Head and base must use the same runner, or the comparison job + # reports every failure that only one runner can see as "new". + # Jest's testMatch covers *.test.js only, so a Jest base never ran + # the TypeScript suites. The base branch now runs under Vitest. test_status=0 - - if [ "$TARGET" = "base" ]; then - # Base revision still has jest.mock() — must run Jest - npx jest --config jest.config.js --ci --json --outputFile=jest-report.json || test_status=$? - else - # Head revision has vi.* mocks — run Vitest - npx vitest run --reporter=json --outputFile=jest-report.json --coverage=false || test_status=$? - fi + npx vitest run --reporter=json --outputFile=jest-report.json --coverage=false || test_status=$? # Report summary and detect empty suites num_suites=$(jq '.numTotalTestSuites // (.testResults | length)' jest-report.json 2>/dev/null || echo 0) diff --git a/CHANGELOG.md b/CHANGELOG.md index 98c13cc9..fdbba97f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- **CI: Vitest runs on both sides of the test comparison** — `.github/workflows/tests.yml` ran Jest on the base branch and Vitest on the PR head. Jest's `testMatch` covers `*.test.js` only, so TypeScript suites never ran on base, and any failure in them was reported as new on every PR. Base now runs Vitest too; `main` passes the full Vitest suite. - **Reader access: Restricted chapter bundling** (RA-T054) — Temporarily set `BOOK_SOURCE_DIRECTORIES` to empty array to prevent protected chapters from being bundled in the client. Chapters are now served exclusively through `/api/reader/chapters/{chapterId}` pending implementation of server-side delivery (RA-T035/RA-T037). Satisfies RA-001 (verified access only) and SC-004 (authorization required for direct chapter access). - **Constitution Amendment v1.0.1** — Updated Principle IV (Protected Content & Data Rules) to reflect `src/content/` as canonical editorial content location per PR #608. Aligns repository practice with governance framework. - Repository governance configuration now fetched from canonical `lightspeedwp/.github` (Phase 2 consolidation — v1.0.0 release verification)