Skip to content

fix: should rerun all tests when setup file changes#779

Merged
9aoy merged 2 commits intomainfrom
setup-rerun
Dec 17, 2025
Merged

fix: should rerun all tests when setup file changes#779
9aoy merged 2 commits intomainfrom
setup-rerun

Conversation

@9aoy
Copy link
Collaborator

@9aoy 9aoy commented Dec 17, 2025

Summary

should rerun all tests when setup file changes.

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings December 17, 2025 07:33
@netlify
Copy link

netlify bot commented Dec 17, 2025

Deploy Preview for rstest-dev ready!

Name Link
🔨 Latest commit 16b6906
🔍 Latest deploy log https://app.netlify.com/projects/rstest-dev/deploys/694265ea4b4d05000848f2eb
😎 Deploy Preview https://deploy-preview-779--rstest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

Copilot AI left a comment

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 an issue in watch mode where changes to setup files did not trigger all tests to rerun. The implementation adds setup file tracking through chunk hash comparison, similar to how test file changes are detected, ensuring that any setup file modification causes a complete test rerun.

Key changes:

  • Added isWatchMode parameter to control when affected entry calculation is performed
  • Enhanced calcEntriesToRerun to track setup file changes via chunk hashes and trigger full test reruns when detected
  • Refactored change detection logic into reusable processEntryChanges function

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
packages/core/src/core/runTests.ts Extracted isWatchMode flag and passed it to createRsbuildServer to enable conditional affected entry calculation
packages/core/src/core/rsbuild.ts Added setup file change tracking with separate chunk hash storage, early return logic to rerun all tests when setup changes, and refactored change detection into reusable helper function
packages/core/src/core/listTests.ts Added isWatchMode: false parameter to disable affected entry calculation in list command

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@9aoy 9aoy merged commit 077e3d0 into main Dec 17, 2025
16 checks passed
@9aoy 9aoy deleted the setup-rerun branch December 17, 2025 08:39
@9aoy 9aoy mentioned this pull request Dec 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant