Skip to content

ci: allow vitest to pass when no tests are present - #7

Open
Marcelo-Rosas wants to merge 1 commit into
thaleslaray:mainfrom
Marcelo-Rosas:patch-2
Open

ci: allow vitest to pass when no tests are present#7
Marcelo-Rosas wants to merge 1 commit into
thaleslaray:mainfrom
Marcelo-Rosas:patch-2

Conversation

@Marcelo-Rosas

@Marcelo-Rosas Marcelo-Rosas commented Dec 28, 2025

Copy link
Copy Markdown
  • Add --passWithNoTests to Vitest run in GitHub Actions
  • Prevent artifact upload from failing when test-results/ is missing

Summary by CodeRabbit

  • Chores
    • Updated GitHub Actions workflow configuration for improved test handling and formatting consistency.
    • Enhanced CI/CD pipeline to gracefully handle scenarios with no tests.
    • Standardized workflow syntax formatting.

✏️ Tip: You can customize this high-level summary in your review settings.

- Add --passWithNoTests to Vitest run in GitHub Actions
- Prevent artifact upload from failing when test-results/ is missing
@coderabbitai

coderabbitai Bot commented Dec 28, 2025

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Updated .github/workflows/test.yml with standardized YAML formatting, enhanced test handling configuration, and improved readability. Changes include converting quotation marks to double quotes, appending --passWithNoTests flag to npm test command, and adding if-no-files-found: ignore parameter to test results upload step.

Changes

Cohort / File(s) Summary
GitHub Actions Workflow Configuration
.github/workflows/test.yml
Standardized YAML quote formatting (single to double quotes), added --passWithNoTests flag to npm test command to handle scenarios with no tests, added if-no-files-found: ignore to test results upload step, minor whitespace consistency improvements

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 Our workflow now gleams with consistent style,
Double quotes march across each YAML tile,
Tests pass with grace when none are found,
Upload steps falter not, safe and sound! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: adding --passWithNoTests to the vitest command to allow CI to pass when no tests are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3221a89 and 54b92b8.

📒 Files selected for processing (1)
  • .github/workflows/test.yml
🔇 Additional comments (2)
.github/workflows/test.yml (2)

33-39: LGTM! Graceful handling of missing test results.

Adding if-no-files-found: ignore is the correct approach to prevent the artifact upload from failing when the test-results/ directory doesn't exist. This works in tandem with the --passWithNoTests flag to ensure the CI pipeline succeeds even when no tests are present.


30-31: LGTM! The addition of --passWithNoTests is correct and aligns with the PR objective. Vitest will exit with a pass status when no tests are found, preventing CI failures in repositories without test files.


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.

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