-
Notifications
You must be signed in to change notification settings - Fork 182
check,run: add abort to interrupt tests on failure #90
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
base: v1
Are you sure you want to change the base?
Conversation
niemeyer
left a comment
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.
A few high-level changes, and we need a test for the feature.
check.go
Outdated
| c := runner.runTest(runner.tests[i]) | ||
| if c.status() == fixturePanickedSt { | ||
| status := c.status() | ||
| if status == fixturePanickedSt { |
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.
All of these are a single condition:
if status == fixturePanickedSt || runner.abort && (status == failedSt || status == panickedSt)
run.go
Outdated
| if !runConf.Abort { | ||
| continue | ||
| } | ||
| if res.Failed > 0 || res.Panicked > 0 { |
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.
Similarly:
run.go
Outdated
| for _, suite := range allSuites { | ||
| result.Add(Run(suite, runConf)) | ||
| var res *Result | ||
| // a test from one suite has failed and we loop through |
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.
Comment is misplaced (nothing has failed here). Should be below, perhaps shorter:
| var res *Result | ||
| // a test from one suite has failed and we loop through | ||
| // all suites to count all of the missed tests | ||
| if skipTests { |
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.
// Count missed tests.
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
|
I've updated the code. PTAL when you have the time. |
This PR implements support for
-check.abortto make suites stop when a test fails. The skipped tests from the suite where the first failure was encountered and those in all following suites are counted as MISSED.Closes #84