Navigation Menu

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

feat: introduce retry option for tests #1929

Merged
merged 5 commits into from Sep 4, 2022
Merged

feat: introduce retry option for tests #1929

merged 5 commits into from Sep 4, 2022

Conversation

antfu
Copy link
Member

@antfu antfu commented Aug 29, 2022

close #1057

@sheremet-va
Copy link
Member

Can we show anything about retries in terminal for debugging?

@antfu
Copy link
Member Author

antfu commented Aug 29, 2022

What would the format be like in your mind? Like ✅ test name (x3) or ✅ test name (retry x3)?

@sheremet-va
Copy link
Member

What would the format be like in your mind? Like ✅ test name (x3) or ✅ test name (retry x3)?

I think we should give brief description about errors, not just the counter.

@antfu
Copy link
Member Author

antfu commented Aug 29, 2022

Can you share a more detailed layout/text design, or directly push/pr to this branch?

@sheremet-va
Copy link
Member

Can you share a more detailed layout/text design, or directly push/pr to this branch?

tbh this question is why I didn't start this PR by myself 😄

I feel like we need some kind of indicator, but I have poor imagination 😃

@antfu
Copy link
Member Author

antfu commented Aug 29, 2022

I will start with indicators and leave it for future improvements then

@sheremet-va
Copy link
Member

Can we add a global option for this?

@antfu
Copy link
Member Author

antfu commented Sep 2, 2022

I am not yet sure if we want the global option for this tbh. We already support describe level and it should be enough for now I think.

@sheremet-va sheremet-va merged commit 456079e into main Sep 4, 2022
@sheremet-va sheremet-va deleted the feat/test-retry branch September 4, 2022 07:53
antfu added a commit to poyoho/vitest that referenced this pull request Sep 4, 2022
@lnhrdt
Copy link

lnhrdt commented Feb 16, 2023

I am not yet sure if we want the global option for this tbh. We already support describe level and it should be enough for now I think.

Today I looked for a way to configure retries globally and I came across this PR. I was hoping to configure test retries globally in CI (where resources are limited and it makes my tests flakier). I had assumed there would be an option in my vite configuration where I could configure it based on something like process.env.CI. Would you reconsider providing a global configuration option @antfu?

@xsjcTony
Copy link
Contributor

Yeah, that would be awesome if we can have this option globally since CI is just unstable sometimes. The approach that Playwright takes is just ✨

@giovannivocale-molar
Copy link

Is there an option to specify retry in the global settings for vitest, so that automatically retries X number of times if a test is failing?

@sheremet-va
Copy link
Member

Is there an option to specify retry in the global settings for vitest, so that automatically retries X number of times if a test is failing?

I would recommend opening an enhancement issue if you need something,

@vitest-dev vitest-dev locked as resolved and limited conversation to collaborators Jun 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flaky test marking and retrying
5 participants