Skip to content

chore: use isFirstCompile instead of isFirstRun#506

Merged
fi3ework merged 1 commit intomainfrom
isFirstCompile
Aug 25, 2025
Merged

chore: use isFirstCompile instead of isFirstRun#506
fi3ework merged 1 commit intomainfrom
isFirstCompile

Conversation

@9aoy
Copy link
Copy Markdown
Collaborator

@9aoy 9aoy commented Aug 25, 2025

Summary

simplify isFirstRun check when run tests.

Related Links

Checklist

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

Copilot AI review requested due to automatic review settings August 25, 2025 08:17
@netlify
Copy link
Copy Markdown

netlify bot commented Aug 25, 2025

Deploy Preview for rstest-dev ready!

Name Link
🔨 Latest commit 830f4f4
🔍 Latest deploy log https://app.netlify.com/projects/rstest-dev/deploys/68ac1c342c9c730008dcd2e6
😎 Deploy Preview https://deploy-preview-506--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
Copy Markdown
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 simplifies the first run test logic by removing the isFirstRun tracking mechanism and instead using the existing isFirstCompile flag to determine when to run all tests versus on-demand tests.

  • Removes isFirstRun tracking logic and related variables
  • Uses isFirstCompile flag to conditionally set test mode to 'all' or 'on-demand'
  • Updates test expectations to reflect the new "Run all tests" message

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
packages/core/src/core/runTests.ts Removes isFirstRun parameter usage and simplifies conditional logic for test mode selection
packages/core/src/core/rsbuild.ts Removes isFirstRun tracking variables and related logic from the rsbuild server
e2e/watch/shortcuts.test.ts Updates test expectations from "Fully run test files for first run" to "Run all tests"
e2e/watch/index.test.ts Updates test expectations from "Fully run test files for first run" to "Run all tests"

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines 131 to +132
if (mode === 'on-demand') {
if (isFirstRun) {
logger.debug(color.yellow('Fully run test files for first run.\n'));
if (affectedEntries.length === 0) {
Copy link

Copilot AI Aug 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removal of the isFirstRun condition creates a logic error. Previously, the first run would skip the on-demand filtering and run all tests. Now, even on the first run with mode 'on-demand', if there are no affected entries, no tests will run at all.

Copilot uses AI. Check for mistakes.
@9aoy 9aoy requested a review from fi3ework August 25, 2025 08:21
@fi3ework fi3ework merged commit bed5097 into main Aug 25, 2025
17 checks passed
@fi3ework fi3ework deleted the isFirstCompile branch August 25, 2025 08:46
@9aoy 9aoy mentioned this pull request Aug 27, 2025
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.

3 participants