Skip to content

Commit 7cff480

Browse files
committed
Print logs before returning an error
1 parent 3e8f17b commit 7cff480

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cmd/octoterra_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,8 @@ func initialiseOctopus(t *testing.T, container *octopusContainer, terraformDir s
308308
cmnd.Dir = terraformProjectDir
309309
out, err := cmnd.Output()
310310

311+
t.Log(string(out))
312+
311313
if err != nil {
312314
exitError, ok := err.(*exec.ExitError)
313315
if ok {
@@ -318,8 +320,6 @@ func initialiseOctopus(t *testing.T, container *octopusContainer, terraformDir s
318320

319321
return err
320322
}
321-
322-
t.Log(string(out))
323323
}
324324

325325
// when initialising the new space, we need to define a new space name as a variable
@@ -343,6 +343,8 @@ func initialiseOctopus(t *testing.T, container *octopusContainer, terraformDir s
343343
cmnd.Dir = terraformProjectDir
344344
out, err := cmnd.Output()
345345

346+
t.Log(string(out))
347+
346348
if err != nil {
347349
exitError, ok := err.(*exec.ExitError)
348350
if ok {
@@ -353,8 +355,6 @@ func initialiseOctopus(t *testing.T, container *octopusContainer, terraformDir s
353355
return err
354356
}
355357

356-
t.Log(string(out))
357-
358358
// get the ID of any new space created, which will be used in the subsequent Terraform executions
359359
spaceId, err = getOutputVariable(t, terraformProjectDir, "octopus_space_id")
360360

0 commit comments

Comments
 (0)