diff options
| author | Ethan Reesor <ethan.reesor@gmail.com> | 2024-11-16 08:42:53 -0700 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2026-03-09 11:02:05 -0700 |
| commit | d82eb907f3ef66e99d1ef08c0b34ffffbd49de5e (patch) | |
| tree | 5277470c46168798a3b61c53ada7408404c355ac /src/cmd/internal/test2json/testdata/issue23920.json | |
| parent | f5d830d57ae0e490d73442d2e04f73322266dbc6 (diff) | |
| download | go-d82eb907f3ef66e99d1ef08c0b34ffffbd49de5e.tar.xz | |
testing: annotate output text type
Provides a way to disambiguate output produced by (*testing.T).Error{,f}
and (*testing.T).Fatal{,f} from other test logging. This allows test
tooling such as CI systems to identify which part of the output is most
pertinent for constructing summaries of test failures.
This is achieved by adding an OutputType field to output events. The
output type for an error is "error" for the first line and
"error-continue" for subsequentlines. The output type for framing is
"frame". This is achieved by bracketing error output with ^O and ^N,
escaped with ^[.
Fixes golang/go#62728.
Change-Id: Ib09c18ed5f729e1ae6d335cd1ec7d818c71532e0
Reviewed-on: https://go-review.googlesource.com/c/go/+/601535
Reviewed-by: Michael Matloob <matloob@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
Diffstat (limited to 'src/cmd/internal/test2json/testdata/issue23920.json')
| -rw-r--r-- | src/cmd/internal/test2json/testdata/issue23920.json | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/cmd/internal/test2json/testdata/issue23920.json b/src/cmd/internal/test2json/testdata/issue23920.json index 17e8de6e91..9e49a1c612 100644 --- a/src/cmd/internal/test2json/testdata/issue23920.json +++ b/src/cmd/internal/test2json/testdata/issue23920.json @@ -1,15 +1,15 @@ {"Action":"start"} {"Action":"run","Test":"TestWithColons"} -{"Action":"output","Test":"TestWithColons","Output":"=== RUN TestWithColons\n"} +{"Action":"output","Test":"TestWithColons","Output":"=== RUN TestWithColons\n","OutputType":"frame"} {"Action":"run","Test":"TestWithColons/[::1]"} -{"Action":"output","Test":"TestWithColons/[::1]","Output":"=== RUN TestWithColons/[::1]\n"} +{"Action":"output","Test":"TestWithColons/[::1]","Output":"=== RUN TestWithColons/[::1]\n","OutputType":"frame"} {"Action":"run","Test":"TestWithColons/127.0.0.1:0"} -{"Action":"output","Test":"TestWithColons/127.0.0.1:0","Output":"=== RUN TestWithColons/127.0.0.1:0\n"} -{"Action":"output","Test":"TestWithColons","Output":"--- PASS: TestWithColons (0.00s)\n"} -{"Action":"output","Test":"TestWithColons/[::1]","Output":" --- PASS: TestWithColons/[::1] (0.00s)\n"} +{"Action":"output","Test":"TestWithColons/127.0.0.1:0","Output":"=== RUN TestWithColons/127.0.0.1:0\n","OutputType":"frame"} +{"Action":"output","Test":"TestWithColons","Output":"--- PASS: TestWithColons (0.00s)\n","OutputType":"frame"} +{"Action":"output","Test":"TestWithColons/[::1]","Output":" --- PASS: TestWithColons/[::1] (0.00s)\n","OutputType":"frame"} {"Action":"pass","Test":"TestWithColons/[::1]"} -{"Action":"output","Test":"TestWithColons/127.0.0.1:0","Output":" --- PASS: TestWithColons/127.0.0.1:0 (0.00s)\n"} +{"Action":"output","Test":"TestWithColons/127.0.0.1:0","Output":" --- PASS: TestWithColons/127.0.0.1:0 (0.00s)\n","OutputType":"frame"} {"Action":"pass","Test":"TestWithColons/127.0.0.1:0"} {"Action":"pass","Test":"TestWithColons"} -{"Action":"output","Output":"PASS\n"} +{"Action":"output","Output":"PASS\n","OutputType":"frame"} {"Action":"pass"} |
