Skip to content

Commit

Permalink
Make it so that if --down is requested in kubetest2, it executes even…
Browse files Browse the repository at this point in the history
… if --up fails.
  • Loading branch information
RonWeber authored and amwat committed Jul 7, 2020
1 parent 375c0bd commit d9ca6c8
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions pkg/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,7 @@ func RealMain(opts types.Options, d types.Deployer, tester types.Tester) (result
}
}

// up a cluster
if opts.ShouldUp() {
// TODO(bentheelder): this should write out to JUnit
if err := writer.WrapStep("Up", d.Up); err != nil {
// we do not continue to test if build fails
return err
}
}

// ensure tearing down the cluster happens last
// ensure tearing down the cluster happens last, even if up or test fails.
defer func() {
if opts.ShouldDown() {
// TODO(bentheelder): instead of keeping the first error, consider
Expand All @@ -110,6 +101,15 @@ func RealMain(opts types.Options, d types.Deployer, tester types.Tester) (result
}
}()

// up a cluster
if opts.ShouldUp() {
// TODO(bentheelder): this should write out to JUnit
if err := writer.WrapStep("Up", d.Up); err != nil {
// we do not continue to test if build fails
return err
}
}

// and finally test, if a test was specified
if opts.ShouldTest() {
if err := writer.WrapStep("Test", tester.Test); err != nil {
Expand Down

0 comments on commit d9ca6c8

Please sign in to comment.