gotestsum icon indicating copy to clipboard operation
gotestsum copied to clipboard

feat: Add flag to disable `GITHUB_ACTIONS` override

Open clabby opened this issue 8 months ago • 3 comments

Overview

Adds a new --format-disable-gha flag to optionally disable the github-actions formatter override when running with --format testname or --format short-verbose in GitHub actions.

An existing workaround for this is to manually set GITHUB_ACTIONS=false, but this is a bit hacky. This PR makes disabling this functionality explicit, and adds some documentation to make this behavior less confusing for the next person.

clabby avatar Apr 14 '25 16:04 clabby

Hello, thanks for the PR!

Is there a problem with the github actions format? It should be a pretty direct upgrade of the testname format. I'd like to better understand the motivation for disabling it.

dnephin avatar Apr 15 '25 04:04 dnephin

@dnephin Our reason for wanting to disable it is primarily to reduce the size of the test logs. For our integration test suite, loading the GHA log output can take a few minutes as several hundreds of thousands of lines get streamed onto the page. Disabling it speeds up viewing the job output quite a bit for this case.

For the majority of usecases, though, it's a great improvement. Kept the default behavior as most people likely do want the "fold"-style output.

clabby avatar Apr 15 '25 22:04 clabby

Thanks for the explanation! I'm still a bit hesitant to take this approach given that you can accomplish the same thing with:

GITHUB_ACTIONS=  gotestsum ...

Maybe another option would be hide the output of successful tests? That's similar to the default behaviour of the pkgname-and-test-fails. Maybe that would allow us to remove that option and replace it with this new flag.

Something like --format-hide-passing-output ?

dnephin avatar May 06 '25 03:05 dnephin