]> Cypherpunks repositories - gostls13.git/commit
cmd/dist: add -json flag
authorAustin Clements <austin@google.com>
Thu, 11 May 2023 20:20:36 +0000 (16:20 -0400)
committerAustin Clements <austin@google.com>
Wed, 17 May 2023 18:18:37 +0000 (18:18 +0000)
commit93477f0770a1a0514916e458d077d767787d72f5
treea98573a8a0443b084b5a13bd0305d17c2b2e9de1
parentdf9f043d10cd2b84635dd7707550d00a74ddcad5
cmd/dist: add -json flag

This enables JSON output for all tests run by dist.

Most the complexity here is that, in order to disambiguate JSON
records from different package variants, we have to rewrite the JSON
stream on the fly to include variant information. We do this by
rewriting the Package field to be pkg:variant so existing CI systems
will naturally pick up the disambiguated test name.

Fixes #37486.

Change-Id: I0094e5e27b3a02ffc108534b8258c699ed8c3b87
Reviewed-on: https://go-review.googlesource.com/c/go/+/494958
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
src/cmd/dist/test.go
src/cmd/dist/testjson.go [new file with mode: 0644]
src/cmd/dist/testjson_test.go [new file with mode: 0644]