opentelemetry-collector-contrib icon indicating copy to clipboard operation
opentelemetry-collector-contrib copied to clipboard

[chore] Use gotestsum wrapper for go tests

Open mx-psi opened this issue 6 months ago • 1 comments

Description: <Describe what has changed.>

Use https://github.com/gotestyourself/gotestsum for running tests.

This PR only adds the wrapper. A future PR could add --rerun-fails, but since that is, I presume, more controversial, I want to start just with the basics, which already improves readability.

Link to tracking Issue: Relates to #30880

mx-psi avatar Feb 09 '24 12:02 mx-psi

cc @open-telemetry/collector-contrib-approvers does this seem like a good idea to you? The main benefit from this PR is that the output format is nicer and it makes tests logs a bit more manageable. We could also introduce rerun on failed (see https://github.com/gotestyourself/gotestsum#documentation for more details)

mx-psi avatar Feb 09 '24 12:02 mx-psi

The only nit is that GOTEST used GOCMD, which (IIUC) could be used to set a different version of go, but I don't think we used this anyway?

I can't say with certainty that someone out there is not using this, but we don't use it on CI AFAICT, and we could add it back if needed by using gotestsum's --raw-command option

mx-psi avatar Feb 13 '24 23:02 mx-psi