onsi / ginkgo

A Modern Testing Framework for Go
http://onsi.github.io/ginkgo/
MIT License
8.09k stars 643 forks source link

Add option to StandardReporter to display things better on github actions #1372

Closed lahabana closed 3 months ago

lahabana commented 4 months ago

We run some fairly big and verbose test suites on github actions (.e.g: https://github.com/kumahq/kuma/actions/runs/8245083767/job/22550558820).

We could use ::group:: to group the stdout output for example which would make things much easier to read see for docs: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#grouping-log-lines

That would be an example:

image

This would make the output a lot easier to read.

From a quick look at the code it should likely be somewhere there: https://github.com/onsi/ginkgo/blob/977bc6f813af032b7499f7876a963e6d3f20b685/reporters/default_reporter.go#L284-L306

It could either be a command line flag: --github-output or detect it using en env var like: GITHUB_ACTIONS=true.

lahabana commented 4 months ago

@onsi I'm happy to implement this if you think this feature could be useful.

onsi commented 4 months ago

hey @lahabana yeah this sounds like a definite improvement. The number of flags that control report output is kinda overwhelming in Ginkgo but I think it's best to add another one as at least the flags are self-documenting in the cli.

Can you also add docs both somewhere in this section on configuring output and especially in this section on the recommended CI configuration.

Thanks!