-
Notifications
You must be signed in to change notification settings - Fork 15
proposal: better go test outputs #563
Comments
Hello! Author of jstemmer/go-junit-report has been around for a long time and predates the gotestfmt is very new. I tried it out once and found it still had a lot of rough edges. For example, if I look at the links you share, expanding the folds for the failed tests and some of the skipped tests does not show any output. From my understanding it also implements a custom parser, which seems to not be all that reliable yet. It's possible these bugs will be or can be fixed. In general I am weary of custom parsing of tests and like to rely on the stdlib test2json parsing of test output as much as possible. Both of these tools use pipes of the output stream to collect output. While that approach may sound appealing, I've found in practice (even before writing The second common problem with the pipe approach is that it's easier to lose the correct error code. If you really wanted to, you could use
But then you lose the reliability of the exit code. It is not something I would recommend, but it's essentially equivalent. |
This issue was transferred to ipdxco/unified-github-workflows#50 in preparation for archiving of this repository. |
During my work on metadata in gateway-conformance, I found a proposal for golang to add metadata during tests, the author parses test2json outputs to make go tests nicer in CI.
Turns out github provides many interesting workflow commands for outputs like debug message, log lines groupping, etc.
I started prototyping updating uci with a go output parser, which generates groups and nicer outputs. Example:
I tried this in kubo and go-libp2p.
I'd like to invest some more time on this, but would like input from other team members first.
Using gotestfmt
I am using gotestfmt. It has a few nice properties:
go test -json .... | tee testoutput.json | gotestfmt
) which means results can be rendered while the test is being processed (useful in CI and local dev). It's also well suited to chaining tools and transformations.It's not a test runner like
gotestsum
, which is more unix-ish like. (we could replace gotestsum with https://github.com/jstemmer/go-junit-report I think).(related #494)
Rough Plan
The text was updated successfully, but these errors were encountered: