-
-
Notifications
You must be signed in to change notification settings - Fork 5.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
Test: Add fail-fast mechanism #45317
Test: Add fail-fast mechanism #45317
Conversation
72241b6
to
81a7bce
Compare
81a7bce
to
226566f
Compare
One use case of this is to help with this.. It's common for packages to do testsets sequentially like this
but that reports each testset individually, meaning it's always verbose and the test reports aren't nicely collated & formatted together, which can be especially awkward in noisy test suites. So the logical thing to do is to wrap all the testsets into a parent package testset, so that everything is pulled into a single report at the end that is formatted and timed together.
And if all passes, you get a small tidy success report (or the full thing if
However, while the first setup fails fast as soon as one of the testsets fails, this new setup won't and will run all testsets. So you're stuck either with:
This option allows you to do the following, which gives you a tidy report at the end, but fails fast.
|
Co-authored-by: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com>
This is great! A big headache when running tests in a loop (e.g. to cover combinations of options) is that if the test fails, it may report hundreds of nearly identical errors. |
@aviatesk thanks for the review. Do you think this is good to go? My finger's been hovering over merge but a second opinion would be appreciated |
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.
Yes, looks good to go!
Sometimes it's helpful to get a testset to return from a failure/error early.
This adds the option to fail-fast in two ways:
Via a
@testset
kwargfailfast
Via an env var
JULIA_TEST_FAILFAST
, so that CI can be easily switched to fail-fastWithout fail-fast the tests are run as per normal