Skip to content

Commit 4305ba7

Browse files
author
Bryan C. Mills
committedDec 3, 2021
git-codereview: log stderr and stdout from successful commands
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>
1 parent 39ade5b commit 4305ba7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
 

‎git-codereview/util_test.go

+9
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,8 @@ func testMain(t *testing.T, args ...string) {
324324
mainCanDie = false // reset for next invocation
325325

326326
defer func() {
327+
t.Helper()
328+
327329
runLog = runLogTrap
328330
testStdout = stdoutTrap
329331
testStderr = stderrTrap
@@ -344,6 +346,13 @@ func testMain(t *testing.T, args ...string) {
344346
}
345347
t.Fatalf("%s\nstdout:\n%sstderr:\n%s", msg, testStdout, testStderr)
346348
}
349+
350+
if testStdout.Len() > 0 {
351+
t.Logf("stdout:\n%s", testStdout)
352+
}
353+
if testStderr.Len() > 0 {
354+
t.Logf("stderr:\n%s", testStderr)
355+
}
347356
}()
348357

349358
exitTrap = func() {

0 commit comments

Comments
 (0)