Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Commit

Permalink
Merge pull request #759 from weaveworks/show-test-output
Browse files Browse the repository at this point in the history
Show output in test to aid debugging
  • Loading branch information
darkowlzz authored Jan 4, 2021
2 parents 3b74b08 + f8a98e9 commit b042445
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions e2e/util/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package util

import (
"fmt"
"os"
"os/exec"
"testing"

Expand Down Expand Up @@ -67,6 +68,13 @@ func (c *Command) Dir(path string) *Command {
return c
}

// PassThrough makes output from the command go to the same place as this process.
func (c *Command) PassThrough() *Command {
c.Cmd.Stderr = os.Stderr
c.Cmd.Stdout = os.Stdout
return c
}

// Run executes the command and performs an error check. It results in fatal
// exit of the test if an error is encountered. In order to continue the test
// on encountering an error, call Command.Cmd.CombinedOutput() or the
Expand Down
1 change: 1 addition & 0 deletions e2e/zconcurrent_vm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ func TestConcurrentVMCreation(t *testing.T) {
cmds = append(
cmds,
util.NewCommand(t, igniteBin).
PassThrough().
With("run").
With("--name="+name).
With("--ssh").
Expand Down

0 comments on commit b042445

Please sign in to comment.