-
-
Notifications
You must be signed in to change notification settings - Fork 14
feat: support bail tests #684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for rstest-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this 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 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 <[email protected]>
Co-authored-by: Copilot <[email protected]>
support abort the test run after the specified number of test failures via
bailconfiguration.Summary
Related Links
Checklist