Skip to content
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

Make vitest actually bail after the first failure when --bail is set to 1 #3372

Closed
4 tasks done
gajus opened this issue May 14, 2023 · 2 comments
Closed
4 tasks done

Comments

@gajus
Copy link

gajus commented May 14, 2023

Clear and concise description of the problem

At the moment, running tests vitest run --bail 1 --single-thread allows tests to continue running after the first (and many more) failures.

 Test Files  8 failed | 36 passed (44)
      Tests  33 failed | 82 passed | 2 skipped | 2 todo (119)
   Start at  15:04:35
   Duration  16.44s (transform 179ms, setup 0ms, collect 2.71s, tests 13.04s, environment 1ms, prepare 147ms)

Suggested solution

If --bail is set to 1, vitest should terminate all runners are soon as possible and return information about the first failure.

Alternative

No response

Additional context

  • I tried --single-thread to no different effect
  • I tried --no-threads to no different effect

Validations

@github-actions
Copy link

Hello @gajus. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with need reproduction will be closed if they have no activity within 3 days.

@AriPerkkio
Copy link
Member

AriPerkkio commented May 15, 2023

Please use the bug report issue template for issues that are clearly bugs and not improvement ideas.

I'm unable to reproduce this bug with this information. It's really difficult to try to guess your environment, tests and settings. Here is example of working setup with --bail 1 --single-thread. You can use it as starting point for your reproduction case. https://stackblitz.com/edit/vitest-dev-vitest-mefosk?file=README.md

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 19, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jun 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants