Skip to content

Conversation

@unclejack
Copy link
Contributor

@unclejack unclejack commented Dec 7, 2016

This PR implements support for -check.abort to 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

Copy link
Contributor

@niemeyer niemeyer left a 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 {
Copy link
Contributor

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 {
Copy link
Contributor

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
Copy link
Contributor

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 {
Copy link
Contributor

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>
@unclejack
Copy link
Contributor Author

I've updated the code. PTAL when you have the time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants