Skip to content

Commit

Permalink
git-codereview: log stderr and stdout from successful commands
Browse files Browse the repository at this point in the history
The reason for the failures in golang/go#49899 is not clear.
Perhaps the stderr output will shed some light on what is happening.

For golang/go#49899

Change-Id: I37c6339c8ebd4a37e4ff5b3b813572193903cee4
Reviewed-on: https://go-review.googlesource.com/c/review/+/368174
Trust: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
  • Loading branch information
Bryan C. Mills committed Dec 3, 2021
1 parent 39ade5b commit 4305ba7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions git-codereview/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,8 @@ func testMain(t *testing.T, args ...string) {
mainCanDie = false // reset for next invocation

defer func() {
t.Helper()

runLog = runLogTrap
testStdout = stdoutTrap
testStderr = stderrTrap
Expand All @@ -344,6 +346,13 @@ func testMain(t *testing.T, args ...string) {
}
t.Fatalf("%s\nstdout:\n%sstderr:\n%s", msg, testStdout, testStderr)
}

if testStdout.Len() > 0 {
t.Logf("stdout:\n%s", testStdout)
}
if testStderr.Len() > 0 {
t.Logf("stderr:\n%s", testStderr)
}
}()

exitTrap = func() {
Expand Down

0 comments on commit 4305ba7

Please sign in to comment.