summaryrefslogtreecommitdiff
path: root/integrationtests/commandutils.go
diff options
context:
space:
mode:
Diffstat (limited to 'integrationtests/commandutils.go')
-rw-r--r--integrationtests/commandutils.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/integrationtests/commandutils.go b/integrationtests/commandutils.go
index 6dfe069..86feee2 100644
--- a/integrationtests/commandutils.go
+++ b/integrationtests/commandutils.go
@@ -2,6 +2,7 @@ package integrationtests
import (
"bufio"
+ "bytes"
"context"
"fmt"
"io"
@@ -36,7 +37,9 @@ func runCommand(ctx context.Context, t *testing.T, stdoutFile, cmdStr string,
cmd := exec.CommandContext(ctx, cmdStr, args...)
out, err := cmd.CombinedOutput()
t.Log("Done running command!", err)
- _, _ = fd.Write(out)
+ if _, copyErr := io.Copy(fd, bytes.NewReader(out)); copyErr != nil {
+ return exitCodeFromError(err), copyErr
+ }
return exitCodeFromError(err), err
}