ci(coverage): build website before running cli coverage tests - #472
Conversation
The test-cli job invokes vitest directly instead of the package.json test script, so it skipped the website build that tests/website/static-site.test.ts depends on. A missing src/website/dist made those tests fail before vitest wrote coverage/lcov.info, which broke ReportGenerator.
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
There was a problem hiding this comment.
Pull request overview
This PR fixes coverage pipeline failures in the 🏰 Star Castle Coverage workflow by ensuring the website is built before running the CLI Vitest coverage run. This prevents tests/website/static-site.test.ts from failing due to missing src/website/dist, which previously caused Vitest to abort before writing coverage/lcov.info.
Changes:
- Add a dedicated website build step in the
test-clijob. - Ensure
pnpm vitest run --coveragehas the expectedsrc/website/distbuild output available socoverage/lcov.infois produced for ReportGenerator.
Problem
The
test-clijob in🏰 Star Castle Coveragefailed on the last push tomain:Root cause
Commit
8c4be06e(#470) addedtests/website/static-site.test.ts, which reads builtoutput from
src/website/dist. That PR added the website build to the roottestandtest:ciscripts inpackage.json, but thetest-clijob invokespnpm vitest rundirectly and never goes through those scripts.
Without
src/website/dist, the SEO tests throwENOENTand vitest never writescoverage/lcov.info, so ReportGenerator has nothing to consume.Fix
Add a
🏗️ Build websitestep before the coverage run in thetest-clijob.Verification
src/website/dist: the SEO tests fail withENOENTand nolcov.infois produced.tests/website/passes (54/54) andlcov.infois generated.tests.yml(pnpm test:ci) andpublish-npm.yml(pnpm test)already build the website via the package scripts. The
test-iacjob only runstests/iac/, which uses atmpDirfixture rather than the realdist.pnpm lintpasses.Trade-off
An alternative is to make the job call
pnpm test:ciso there is a single definition of"run the tests". That was not done here because the job needs fine-grained coverage flags
(
--exclude,--coverage.reportsDirectory). Worth reconsidering if the two definitionsdrift again.