Conversation
✅ Deploy Preview for rstest-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds a bail configuration option that allows users to abort test execution after a specified number of test failures. The implementation adds comprehensive support across configuration, CLI, runtime execution, and documentation.
- Added
bailconfiguration option with default value of 0 (run all tests) - Implemented test execution bailout logic in worker and runner components using a new TestStateManager
- Updated documentation in both English and Chinese, including CLI references and configuration pages
Reviewed Changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/core/src/core/stateManager.ts | New state manager to track running tests and count failures |
| packages/core/src/types/config.ts | Added bail property to RstestConfig and ProjectConfig |
| packages/core/src/types/worker.ts | Added getCountOfFailedTests RPC method and bail to RuntimeConfig |
| packages/core/src/types/runner.ts | Added getCountOfFailedTests hook to RunnerHooks |
| packages/core/src/types/core.ts | Added stateManager to RstestContext and removed unused Test import |
| packages/core/src/runtime/worker/index.ts | Implements bail check before running test files |
| packages/core/src/runtime/runner/runner.ts | Implements bail check during test execution to skip remaining tests |
| packages/core/src/pool/index.ts | Wires up stateManager callbacks and RPC methods |
| packages/core/src/core/rstest.ts | Initializes stateManager and propagates bail config to projects |
| packages/core/src/core/runTests.ts | Resets state manager before each test run |
| packages/core/src/config.ts | Sets default bail value to 0 |
| packages/core/src/cli/init.ts | Adds bail to CommonOptions |
| packages/core/src/cli/commands.ts | Adds --bail CLI option |
| website/docs/en/config/test/bail.mdx | English documentation for bail configuration |
| website/docs/zh/config/test/bail.mdx | Chinese documentation for bail configuration |
| website/docs/en/config/test/_meta.json | Adds bail to English config navigation |
| website/docs/zh/config/test/_meta.json | Adds bail to Chinese config navigation |
| website/docs/en/config/test/projects.mdx | Excludes bail from ProjectConfig type |
| website/docs/zh/config/test/projects.mdx | Excludes bail from ProjectConfig type |
| website/docs/en/guide/basic/cli.mdx | Documents --bail CLI option in English |
| website/docs/zh/guide/basic/cli.mdx | Documents --bail CLI option in Chinese |
| website/theme/components/ConfigOverview.tsx | Adds bail to runtime section of config overview |
| e2e/bail/index.test.ts | E2E test verifying bail functionality |
| e2e/bail/fixtures/index.test.ts | Test fixture with failing test for bail verification |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
support abort the test run after the specified number of test failures via
bailconfiguration.Summary
Related Links
Checklist