Skip to content

ci(coverage): build website before running cli coverage tests - #472

Merged
macalbert merged 1 commit into
mainfrom
ci/fix-coverage-website-build
Jul 31, 2026
Merged

ci(coverage): build website before running cli coverage tests#472
macalbert merged 1 commit into
mainfrom
ci/fix-coverage-website-build

Conversation

@macalbert

Copy link
Copy Markdown
Owner

Problem

The test-cli job in 🏰 Star Castle Coverage failed on the last push to main:

The report file 'coverage/lcov.info' is invalid. File does not exist.
Error: Failed to execute ReportGenerator global tool

Root cause

Commit 8c4be06e (#470) added tests/website/static-site.test.ts, which reads built
output from src/website/dist. That PR added the website build to the root test and
test:ci scripts in package.json, but the test-cli job invokes pnpm vitest run
directly and never goes through those scripts.

Without src/website/dist, the SEO tests throw ENOENT and vitest never writes
coverage/lcov.info, so ReportGenerator has nothing to consume.

Fix

Add a 🏗️ Build website step before the coverage run in the test-cli job.

Verification

  • Reproduced locally by temporarily removing src/website/dist: the SEO tests fail with
    ENOENT and no lcov.info is produced.
  • With the website built, tests/website/ passes (54/54) and lcov.info is generated.
  • Audited every workflow: tests.yml (pnpm test:ci) and publish-npm.yml (pnpm test)
    already build the website via the package scripts. The test-iac job only runs
    tests/iac/, which uses a tmpDir fixture rather than the real dist.
  • pnpm lint passes.

Trade-off

An alternative is to make the job call pnpm test:ci so 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 definitions
drift again.

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.
Copilot AI review requested due to automatic review settings July 31, 2026 09:32
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • .github/workflows/coverage-report.yml is excluded by none and included by none

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: cdfd95a8-0b35-4d6a-aad9-c9d76f1a833d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added github-actions Updates to GitHub Actions / CI workflows size/XS Trivial change — up to 9 lines / 1 file labels Jul 31, 2026
@macalbert macalbert self-assigned this Jul 31, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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-cli job.
  • Ensure pnpm vitest run --coverage has the expected src/website/dist build output available so coverage/lcov.info is produced for ReportGenerator.

@macalbert
macalbert merged commit 32eb300 into main Jul 31, 2026
29 checks passed
@macalbert
macalbert deleted the ci/fix-coverage-website-build branch July 31, 2026 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github-actions Updates to GitHub Actions / CI workflows size/XS Trivial change — up to 9 lines / 1 file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants