[#2499] Fixed Jest CI failure when no tests are present.#2503
Conversation
WalkthroughThe PR addresses a CI failure when no Jest tests exist by adding the ChangesJest No-Tests Scenario Handling
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
Code coverage (threshold: 90%) Per-class coverage |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.vortex/CLAUDE.md:
- Around line 79-81: Update the doc line about snapshot regeneration to state
that snapshots are generated from the code exported from git HEAD (the test
harness uses git archive --format=tar HEAD), so uncommitted working-tree changes
aren’t included; reference the command `ahoy update-snapshots` and the test
helper FunctionalTestCase::fixtureExportCodebase to make it clear the
export-from-HEAD behavior is what determines the baseline rather than a generic
“committed baseline” comparison.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: a0d75e18-8319-4f19-b4da-ad67c9882d93
⛔ Files ignored due to path filters (11)
.vortex/installer/tests/Fixtures/handler_process/_baseline/package.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/package.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/package.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint/package.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_circleci/package.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_no_theme/package.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_jest/package.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_jest_circleci/package.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint/package.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_circleci/package.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_no_theme/package.jsonis excluded by!.vortex/installer/tests/Fixtures/**
📒 Files selected for processing (4)
.vortex/CLAUDE.md.vortex/installer/CLAUDE.md.vortex/tests/phpunit/Traits/Subtests/SubtestAhoyTrait.phppackage.json
This comment has been minimized.
This comment has been minimized.
2 similar comments
This comment has been minimized.
This comment has been minimized.
|
Code coverage (threshold: 90%) Per-class coverage |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2503 +/- ##
==========================================
- Coverage 79.97% 79.51% -0.46%
==========================================
Files 129 122 -7
Lines 6895 6736 -159
Branches 47 3 -44
==========================================
- Hits 5514 5356 -158
+ Misses 1381 1380 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Closes #2499
Summary
CI failed when no Jest tests existed - most commonly after the demo content (
ys_demomodule) was deselected during install, removing the only seededys_demo.test.js.jest --coveragewould exit 1 with "No tests found", failing the "Test with Jest" step on both CircleCI and GitHub Actions. Added--passWithNoTestsso an empty Jest suite exits 0 while real test failures continue to fail the build.Also lifted the explicit-permission gate on
ahoy update-snapshotsin.vortex/CLAUDE.mdand.vortex/installer/CLAUDE.md, now that the parallel--jobs=8runner brings a full snapshot regeneration down to ~3 minutes.Changes
Jest CI fix
package.json:jest --coverage→jest --coverage --passWithNoTests..vortex/tests/phpunit/Traits/Subtests/SubtestAhoyTrait.php: added a sub-testAssert Jest passes when there are no teststosubtestAhoyTestJs(). The sub-test backs upys_demo.test.js, removes it from host and container, runsahoy test-js, and asserts the output containsNo tests found, exiting with code 0, then restores the file..vortex/installer/tests/Fixtures/handler_process/**/package.json: 11 fixture files regenerated viaahoy update-snapshotsto mirror the newtestscript.Documentation tidy
.vortex/CLAUDE.md: removed the "Commands Requiring Permission" section and the(REQUIRES PERMISSION)/(requires permission)annotations aroundahoy update-snapshots..vortex/installer/CLAUDE.md: replaced "the user will run the snapshot update themselves" with a direct instruction to runahoy update-snapshots, and decoupled the installer-video permission note from update-snapshots.Before / After
Summary by CodeRabbit
Documentation
Tests