Run npm tests in CI for PRs and master pushes#925
Run npm tests in CI for PRs and master pushes#925PeterDaveHello merged 1 commit intoChatGPTBox-dev:masterfrom
Conversation
Update the pr-tests workflow to run when test files and package manifests change, and when matching changes are pushed to master. Run npm test before lint and build so CI validates Node unit tests automatically for both pre-merge and post-merge flows.
|
Note Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported. |
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||
📝 WalkthroughWalkthroughThe pull request updates the GitHub Actions workflow to automatically trigger on test-related file changes and adds an npm test execution step to the continuous integration pipeline following dependency installation. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||||
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a075e95b53
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
This PR updates the pr-tests GitHub Actions workflow so CI runs Node unit tests for both pull requests and pushes to master, and triggers when test files or npm manifests change.
Changes:
- Expand
pull_requestpath filters to includetests/**,package.json,package-lock.json, and the workflow file itself. - Add a
pushtrigger for themasterbranch with the same path filters. - Run
npm testafternpm ciand before lint/build.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/pr-tests.yml (1)
37-39: Considercontinue-on-errorso lint/build failures are always visible.With the current ordering, a
npm testfailure will short-circuit the job and skipnpm run lintandnpm run build. If the goal is to surface all failure types in a single run, addcontinue-on-error: trueto the test step (or setif: always()on subsequent steps).⚙️ Option A – allow lint/build to always report
- - run: npm test + - run: npm test + continue-on-error: true - run: npm run lint - run: npm run build⚙️ Option B – unconditionally run lint and build regardless of prior step outcome
- run: npm test - - run: npm run lint - - run: npm run build + - run: npm run lint + if: always() + - run: npm run build + if: always()🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/pr-tests.yml around lines 37 - 39, The workflow currently stops after a failing "npm test" step so "npm run lint" and "npm run build" may be skipped; update the job steps so failures are all reported by either adding continue-on-error: true to the "npm test" step or by adding if: always() to the "npm run lint" and "npm run build" steps so those commands always run and surface lint/build failures (refer to the steps that run "npm test", "npm run lint", and "npm run build").
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/pr-tests.yml:
- Around line 37-39: The workflow currently stops after a failing "npm test"
step so "npm run lint" and "npm run build" may be skipped; update the job steps
so failures are all reported by either adding continue-on-error: true to the
"npm test" step or by adding if: always() to the "npm run lint" and "npm run
build" steps so those commands always run and surface lint/build failures (refer
to the steps that run "npm test", "npm run lint", and "npm run build").
User description
Update the pr-tests workflow to run when test files and package manifests change, and when matching changes are pushed to master.
Run npm test before lint and build so CI validates Node unit tests automatically for both pre-merge and post-merge flows.
PR Type
Enhancement
Description
Add npm test execution to CI workflow before lint and build
Trigger workflow on test file and package manifest changes
Run workflow on master branch pushes with relevant changes
Validate Node unit tests in both pre-merge and post-merge flows
Diagram Walkthrough
File Walkthrough
pr-tests.yml
Add npm test execution and master branch trigger.github/workflows/pr-tests.yml
tests/**,package.json,package-lock.json, and workflow file topull request trigger paths
pushtrigger for master branch with same path filtersnpm teststep before lint and build steps in job workflowSummary by CodeRabbit