Skip to content

Added github-actions reporter to vitest CI runs#28008

Merged
9larsons merged 1 commit into
mainfrom
vitest-ci-reporter
May 21, 2026
Merged

Added github-actions reporter to vitest CI runs#28008
9larsons merged 1 commit into
mainfrom
vitest-ci-reporter

Conversation

@9larsons
Copy link
Copy Markdown
Contributor

vitest's dot reporter writes its progress and its failure summary as one continuous single-line stream. GitHub Actions truncates long log lines, so when a vitest test fails in CI the summary block (⎯⎯ Failed Tests ⎯⎯, the test name, the assertion diff) gets cut off — the logs show the step exited 1, but not which test failed.

This adds the github-actions reporter alongside dot, gated on GITHUB_ACTIONS so local runs keep the compact dot-only output. The reporter emits inline ::error:: annotations pinned to the failing file and line, which surface directly on the job and the PR diff.

Found while debugging a unit-test failure on another PR, where the truncated log made it impossible to identify the failing test without reproducing the whole suite locally.

🤖 Generated with Claude Code

- vitest's `dot` reporter emits its progress and failure summary as one
  huge single-line stream; GitHub truncates it, so CI logs never show
  which test actually failed
- the `github-actions` reporter emits inline `::error::` annotations
  pinned to the failing file and line; gated on GITHUB_ACTIONS so local
  runs keep the compact dot-only output
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 21, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7d70fdf9-a1f2-4a5a-9645-92887326fe47

📥 Commits

Reviewing files that changed from the base of the PR and between 585cb3f and 543d05d.

📒 Files selected for processing (1)
  • ghost/core/vitest.config.ts

Walkthrough

This PR modifies the Vitest configuration in ghost/core/vitest.config.ts to dynamically select test reporters based on the GitHub Actions environment variable. When running in GitHub Actions CI, the configuration now includes both the dot and github-actions reporters; in other environments, it uses only the dot reporter. No other test execution or configuration settings were changed.

Possibly related PRs

  • TryGhost/Ghost#27898: Modifies test.reporters setup in ghost/core/vitest.config.ts to configure test reporters.
  • TryGhost/Ghost#27901: Adds a CI step that executes the test:vitest target, which will utilize the conditional reporter configuration.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and accurately summarizes the main change: adding the github-actions reporter to vitest CI runs.
Description check ✅ Passed The description is clearly related to the changeset, explaining the motivation for adding the github-actions reporter to handle GitHub Actions log truncation issues.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch vitest-ci-reporter

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 and usage tips.

@9larsons 9larsons merged commit 5158440 into main May 21, 2026
43 checks passed
@9larsons 9larsons deleted the vitest-ci-reporter branch May 21, 2026 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant