Skip to content

Commit 4d0ddb7

Browse files
authored
Sync test2json from upstream Go (#4261)
Sync test2json from upstream Go. All the code changes are from golang/go. Only the comment was changed by this PR. I tried to do that in #4250, but was blocked by a flaky test that was fixed in #4257. Retrying...
1 parent 2cb00ec commit 4d0ddb7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

go/tools/bzltestutil/test2json.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
// See the cmd/test2json documentation for details of the JSON encoding.
99
//
1010
// The file test2json.go was copied from upstream go at
11-
// src/cmd/internal/test2json/test2json.go, revision
12-
// https://github.com/golang/go/commit/1c72ee7f13831b215b8744f6b35bc4fd53aba5e2.
11+
// https://github.com/golang/go/blob/go1.23.6/src/cmd/internal/test2json/test2json.go.
1312
// At the time of writing this was
1413
// deemed the best way of depending on this code that is otherwise not exposed
1514
// outside of the go toolchain. These files should be kept in sync.
@@ -127,6 +126,7 @@ func NewConverter(w io.Writer, pkg string, mode Mode) *Converter {
127126
part: c.writeOutputEvent,
128127
},
129128
}
129+
c.writeEvent(&event{Action: "start"})
130130
return c
131131
}
132132

@@ -139,7 +139,9 @@ func (c *Converter) Write(b []byte) (int, error) {
139139
// Exited marks the test process as having exited with the given error.
140140
func (c *Converter) Exited(err error) {
141141
if err == nil {
142-
c.result = "pass"
142+
if c.result != "skip" {
143+
c.result = "pass"
144+
}
143145
} else {
144146
c.result = "fail"
145147
}

0 commit comments

Comments
 (0)