diff options
| author | Russ Cox <rsc@golang.org> | 2022-11-07 11:58:45 -0500 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2022-11-09 17:33:07 +0000 |
| commit | 7a92c4fc637621368eb26a7e72bb027b29568e50 (patch) | |
| tree | 820c68aa8b5e1f43dfe337cb10ddd908bac5b838 /src/cmd/internal/test2json/testdata | |
| parent | 9ff2a6677fd34084295172aff0848ab9a4f5b76e (diff) | |
| download | go-7a92c4fc637621368eb26a7e72bb027b29568e50.tar.xz | |
cmd/go: print test2json start events
Add a new "Action":"start" test2json event to mark the
start of the test binary execution. This adds useful information
to the JSON traces, and it also lets programs watching test
execution see the order in which the tests are being run,
because we arrange for the starts to happen sequentially.
Change-Id: I9fc865a486a55a7e9315f8686f59a2aa06455884
Reviewed-on: https://go-review.googlesource.com/c/go/+/448357
Run-TryBot: Russ Cox <rsc@golang.org>
Auto-Submit: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Diffstat (limited to 'src/cmd/internal/test2json/testdata')
16 files changed, 16 insertions, 0 deletions
diff --git a/src/cmd/internal/test2json/testdata/ascii.json b/src/cmd/internal/test2json/testdata/ascii.json index 67fccfc112..94695a10c5 100644 --- a/src/cmd/internal/test2json/testdata/ascii.json +++ b/src/cmd/internal/test2json/testdata/ascii.json @@ -1,3 +1,4 @@ +{"Action":"start"} {"Action":"run","Test":"TestAscii"} {"Action":"output","Test":"TestAscii","Output":"=== RUN TestAscii\n"} {"Action":"output","Test":"TestAscii","Output":"I can eat glass, and it doesn't hurt me. I can eat glass, and it doesn't hurt me.\n"} diff --git a/src/cmd/internal/test2json/testdata/bench.json b/src/cmd/internal/test2json/testdata/bench.json index 69e417eb14..102e189ed7 100644 --- a/src/cmd/internal/test2json/testdata/bench.json +++ b/src/cmd/internal/test2json/testdata/bench.json @@ -1,3 +1,4 @@ +{"Action":"start"} {"Action":"output","Output":"goos: darwin\n"} {"Action":"output","Output":"goarch: 386\n"} {"Action":"output","Output":"BenchmarkFoo-8 \t2000000000\t 0.00 ns/op\n"} diff --git a/src/cmd/internal/test2json/testdata/benchfail.json b/src/cmd/internal/test2json/testdata/benchfail.json index ad3ac9e179..d2d968191c 100644 --- a/src/cmd/internal/test2json/testdata/benchfail.json +++ b/src/cmd/internal/test2json/testdata/benchfail.json @@ -1,3 +1,4 @@ +{"Action":"start"} {"Action":"output","Test":"BenchmarkFoo","Output":"--- FAIL: BenchmarkFoo\n"} {"Action":"output","Test":"BenchmarkFoo","Output":"\tx_test.go:8: My benchmark\n"} {"Action":"fail","Test":"BenchmarkFoo"} diff --git a/src/cmd/internal/test2json/testdata/benchshort.json b/src/cmd/internal/test2json/testdata/benchshort.json index 34b03b9362..6c4e193573 100644 --- a/src/cmd/internal/test2json/testdata/benchshort.json +++ b/src/cmd/internal/test2json/testdata/benchshort.json @@ -1,3 +1,4 @@ +{"Action":"start"} {"Action":"output","Output":"# This file ends in an early EOF to trigger the Benchmark prefix test,\n"} {"Action":"output","Output":"# which only happens when a benchmark prefix is seen ahead of the \\n.\n"} {"Action":"output","Output":"# Normally that's due to the benchmark running and the \\n coming later,\n"} diff --git a/src/cmd/internal/test2json/testdata/empty.json b/src/cmd/internal/test2json/testdata/empty.json index e69de29bb2..198f8d7b55 100644 --- a/src/cmd/internal/test2json/testdata/empty.json +++ b/src/cmd/internal/test2json/testdata/empty.json @@ -0,0 +1 @@ +{"Action":"start"} diff --git a/src/cmd/internal/test2json/testdata/frame.json b/src/cmd/internal/test2json/testdata/frame.json index d2a65fc36b..9dd29ae977 100644 --- a/src/cmd/internal/test2json/testdata/frame.json +++ b/src/cmd/internal/test2json/testdata/frame.json @@ -1,3 +1,4 @@ +{"Action":"start"} {"Action":"run","Test":"TestAscii"} {"Action":"output","Test":"TestAscii","Output":"=== RUN TestAscii\n"} {"Action":"output","Test":"TestAscii","Output":"=== RUN TestNotReally\n"} diff --git a/src/cmd/internal/test2json/testdata/framebig.json b/src/cmd/internal/test2json/testdata/framebig.json index ebb9bdf3f1..54a8a524fe 100644 --- a/src/cmd/internal/test2json/testdata/framebig.json +++ b/src/cmd/internal/test2json/testdata/framebig.json @@ -1,3 +1,4 @@ +{"Action":"start"} {"Action":"run","Test":"TestIndex"} {"Action":"output","Test":"TestIndex","Output":"=== RUN TestIndex\n"} {"Action":"output","Test":"TestIndex","Output":"--- PASS: TestIndex (0.00s)\n"} diff --git a/src/cmd/internal/test2json/testdata/framefuzz.json b/src/cmd/internal/test2json/testdata/framefuzz.json index ea2eafa717..25869ee740 100644 --- a/src/cmd/internal/test2json/testdata/framefuzz.json +++ b/src/cmd/internal/test2json/testdata/framefuzz.json @@ -1,3 +1,4 @@ +{"Action":"start"} {"Action":"run","Test":"TestAddrStringAllocs"} {"Action":"output","Test":"TestAddrStringAllocs","Output":"=== RUN TestAddrStringAllocs\n"} {"Action":"run","Test":"TestAddrStringAllocs/zero"} diff --git a/src/cmd/internal/test2json/testdata/issue23036.json b/src/cmd/internal/test2json/testdata/issue23036.json index 935c0c5fc0..bfdc3e5e0f 100644 --- a/src/cmd/internal/test2json/testdata/issue23036.json +++ b/src/cmd/internal/test2json/testdata/issue23036.json @@ -1,3 +1,4 @@ +{"Action":"start"} {"Action":"run","Test":"TestActualCase"} {"Action":"output","Test":"TestActualCase","Output":"=== RUN TestActualCase\n"} {"Action":"output","Test":"TestActualCase","Output":"--- FAIL: TestActualCase (0.00s)\n"} diff --git a/src/cmd/internal/test2json/testdata/issue23920.json b/src/cmd/internal/test2json/testdata/issue23920.json index 28f7bd56ac..17e8de6e91 100644 --- a/src/cmd/internal/test2json/testdata/issue23920.json +++ b/src/cmd/internal/test2json/testdata/issue23920.json @@ -1,3 +1,4 @@ +{"Action":"start"} {"Action":"run","Test":"TestWithColons"} {"Action":"output","Test":"TestWithColons","Output":"=== RUN TestWithColons\n"} {"Action":"run","Test":"TestWithColons/[::1]"} diff --git a/src/cmd/internal/test2json/testdata/issue29755.json b/src/cmd/internal/test2json/testdata/issue29755.json index 2e8ba48629..c49bf92ce2 100644 --- a/src/cmd/internal/test2json/testdata/issue29755.json +++ b/src/cmd/internal/test2json/testdata/issue29755.json @@ -1,3 +1,4 @@ +{"Action":"start"} {"Action":"run","Test":"TestOutputWithSubtest"} {"Action":"output","Test":"TestOutputWithSubtest","Output":"=== RUN TestOutputWithSubtest\n"} {"Action":"run","Test":"TestOutputWithSubtest/sub_test"} diff --git a/src/cmd/internal/test2json/testdata/panic.json b/src/cmd/internal/test2json/testdata/panic.json index f7738142e6..1cd4384629 100644 --- a/src/cmd/internal/test2json/testdata/panic.json +++ b/src/cmd/internal/test2json/testdata/panic.json @@ -1,3 +1,4 @@ +{"Action":"start"} {"Action":"output","Test":"TestPanic","Output":"--- FAIL: TestPanic (0.00s)\n"} {"Action":"output","Test":"TestPanic","Output":"panic: oops [recovered]\n"} {"Action":"output","Test":"TestPanic","Output":"\tpanic: oops\n"} diff --git a/src/cmd/internal/test2json/testdata/smiley.json b/src/cmd/internal/test2json/testdata/smiley.json index f49180d520..858843f3af 100644 --- a/src/cmd/internal/test2json/testdata/smiley.json +++ b/src/cmd/internal/test2json/testdata/smiley.json @@ -1,3 +1,4 @@ +{"Action":"start"} {"Action":"run","Test":"Test☺☹"} {"Action":"output","Test":"Test☺☹","Output":"=== RUN Test☺☹\n"} {"Action":"output","Test":"Test☺☹","Output":"=== PAUSE Test☺☹\n"} diff --git a/src/cmd/internal/test2json/testdata/timeout.json b/src/cmd/internal/test2json/testdata/timeout.json index 162a5bde44..dc225262f7 100644 --- a/src/cmd/internal/test2json/testdata/timeout.json +++ b/src/cmd/internal/test2json/testdata/timeout.json @@ -1,3 +1,4 @@ +{"Action":"start"} {"Action":"run","Test":"Test"} {"Action":"output","Test":"Test","Output":"=== RUN Test\n"} {"Action":"output","Test":"Test","Output":"panic: test timed out after 1s\n"} diff --git a/src/cmd/internal/test2json/testdata/unicode.json b/src/cmd/internal/test2json/testdata/unicode.json index 9cfb5f2d49..2cc3e7322d 100644 --- a/src/cmd/internal/test2json/testdata/unicode.json +++ b/src/cmd/internal/test2json/testdata/unicode.json @@ -1,3 +1,4 @@ +{"Action":"start"} {"Action":"run","Test":"TestUnicode"} {"Action":"output","Test":"TestUnicode","Output":"=== RUN TestUnicode\n"} {"Action":"output","Test":"TestUnicode","Output":"Μπορώ να φάω σπασμένα γυαλιά χωρίς να πάθω τίποτα. Μπορώ να φάω σπασμένα γυαλιά χωρίς να πάθω τίποτα.\n"} diff --git a/src/cmd/internal/test2json/testdata/vet.json b/src/cmd/internal/test2json/testdata/vet.json index 2558d61e74..5b09104522 100644 --- a/src/cmd/internal/test2json/testdata/vet.json +++ b/src/cmd/internal/test2json/testdata/vet.json @@ -1,3 +1,4 @@ +{"Action":"start"} {"Action":"run","Test":"TestVet"} {"Action":"output","Test":"TestVet","Output":"=== RUN TestVet\n"} {"Action":"output","Test":"TestVet","Output":"=== PAUSE TestVet\n"} |
