-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
[Feature]: Add handler when tests are being retried #12600
Comments
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
We just landed #12201 yesterday, which adds optional logging, does that cover your use case? Note that this means you can use a custom reporter to do your That said, I think we now only pass the reasons if logging is enabled, that's probably the wrong way to do it... Might make more sense to always pass them, and just add some config to the reporter or something. Thoughts? (this is not shipped yet, but you can build the repo and play with it locally) |
What if these retry errors would be logged as warnings by default? Also always passed to reporters. The option of Still good time to do this. I can work, if the idea is acceptable. |
I don't think we should log by default, but we should always pass the reasons in the test results. Not sure how to communicate logging being on or off, tho. Separately, we should make sure |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
This issue was closed because it has been stalled for 7 days with no activity. Please open a new issue if the issue is still relevant, linking to this one. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
🚀 Feature Proposal
I would like to know when tests are being retried. The
retryTimes
feature is great, but it can effectively hide the fact that a test is flakey. The ideal solution would allow for providing a handler that gets called whenever a test is retried, and would be passed the test name.Note: I tried to use
addEventHandler
fromstate.js
and watch for thetest_retry
event but I couldn't get it working after ~30 minutes of playing around.Motivation
retryTimes
is necessary when running E2E tests on larger apps, but it can hide flakey tests. On large teams running scores of builds in CI a day, being able to centralize recording those flakey tests can give valuable insight to help stabilize test suites.Example
We could optionally augment
retryTimes
with a single handler:Or we could provide a list of handlers:
Pitch
Because I don't want to have to write my own runner to do this :) I want to keep using the default jest runner.
Also I don't know if this goes without saying, but I'm happy to do all the work here.
The text was updated successfully, but these errors were encountered: