Keep test files on assertion failure

We were pretty careful to keep the test directory around if the test ever
exited early due to a panic or error return. But if the test ran to
completion and failed -- for example, if ExtraRuntimeValidation caused the
test to fail -- we would end up deleting the test directory.

Fixes #868
This commit is contained in:
Matthew Riley 2018-02-01 23:35:49 -08:00
parent 818246a708
commit 606c45ffea

View file

@ -399,7 +399,9 @@ func (pt *programTester) testLifeCycleInitAndDestroy() error {
return errors.Wrap(err, "running test preview, update, and edits")
}
keepTestDir = false
// Ran to completion. Delete the test directory if the test passed.
keepTestDir = pt.t.Failed()
return nil
}