mfridman / tparse

CLI tool for summarizing go test output. Pipe friendly. CI/CD friendly.
MIT License
998 stars 22 forks source link

Incorporate upcoming go1.20 improvements #84

Closed mfridman closed 1 year ago

mfridman commented 1 year ago

Creating an issue to track upstream changes to test2json and making sure nothing in tparse breaks as a result.

A related change to go test -json is the addition of an event with Action set to start at the beginning of each test program's execution. When running multiple tests using the go command, these start events are guaranteed to be emitted in the same order as the packages named on the command line.

Link

Might need to explicitly handle the Action set to start. Also this might enable us to display packages in the order they were run (in addition to the options available today).

mfridman commented 1 year ago

From the docs for go1.20

The implementation of go test -json has been improved to make it more robust. Programs that run go test -json do not need any updates. Programs that invoke go tool test2json directly should now run the test binary with -v=test2json (for example, go test -v=test2json or ./pkg.test -test.v=test2json) instead of plain -v.

Nice, tparse parses input and doesn't invoke the toolchain.

A related change to go test -json is the addition of an event with Action set to start at the beginning of each test program's execution. When running multiple tests using the go command, these start events are guaranteed to be emitted in the same order as the packages named on the command line.

This field might be useful to better reporting how long an individual test within a package took to run. But I'll need to double-check the current implementation. More details to come...