Skip to content

Conversation

@9aoy
Copy link
Contributor

@9aoy 9aoy commented Nov 11, 2025

support abort the test run after the specified number of test failures via bail configuration.

import { defineConfig } from '@rstest/core';

export default defineConfig({
  bail: 1,
});

Summary

Related Links

Checklist

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

Copilot AI review requested due to automatic review settings November 11, 2025 03:21
@netlify
Copy link

netlify bot commented Nov 11, 2025

Deploy Preview for rstest-dev ready!

Name Link
🔨 Latest commit c963621
🔍 Latest deploy log https://app.netlify.com/projects/rstest-dev/deploys/6912ae3f54e14a0008760044
😎 Deploy Preview https://deploy-preview-684--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 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 bail configuration 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.

@9aoy 9aoy merged commit d5159f2 into main Nov 11, 2025
16 checks passed
@9aoy 9aoy deleted the bail branch November 11, 2025 06:01
@9aoy 9aoy mentioned this pull request Nov 11, 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.

2 participants