tests: mark failed test for log collection

The logs are only collected by default if a test failed.
Ensure that we collect the logs if the test setup step
failed.

Signed-off-by: travisn <tnielsen@redhat.com>
This commit is contained in:
travisn committed 2019-10-15 17:13:25 -06:00
1 parent a178cccd77
commit 98c21950aa
1 file changed
+2
@@ -194,12 +194,14 @@ func (o MCTestOperations) Teardown() {
func (o MCTestOperations) startCluster(namespace, store string, errCh chan error) {
logger.Infof("starting cluster %s", namespace)
if err := o.installer.CreateK8sRookCluster(namespace, o.systemNamespace, store); err != nil {
o.T().Fail()
o.installer.GatherAllRookLogs(o.T().Name(), namespace, o.systemNamespace)
errCh <- fmt.Errorf("failed to create cluster %s. %+v", namespace, err)
return
}
if err := o.installer.CreateK8sRookToolbox(namespace); err != nil {
o.T().Fail()
o.installer.GatherAllRookLogs(o.T().Name(), namespace, o.systemNamespace)
errCh <- fmt.Errorf("failed to create toolbox for %s. %+v", namespace, err)
return