Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
lahabana opened this issue Mar 12, 2024 · 2 comments · Fixed by #1373
Closed

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

lahabana opened this issue Mar 12, 2024 · 2 comments · Fixed by #1373

Comments

@lahabana
Copy link
Contributor

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:

//Emit Stdout/Stderr Output
if showSeparateStdSection {
r.emitBlock("\n")
r.emitBlock(r.fi(1, "{{gray}}Captured StdOut/StdErr Output >>{{/}}"))
r.emitBlock(r.fi(1, "%s", report.CapturedStdOutErr))
r.emitBlock(r.fi(1, "{{gray}}<< Captured StdOut/StdErr Output{{/}}"))
}
if showSeparateVisibilityAlwaysReportsSection {
r.emitBlock("\n")
r.emitBlock(r.fi(1, "{{gray}}Report Entries >>{{/}}"))
for _, entry := range report.ReportEntries.WithVisibility(types.ReportEntryVisibilityAlways) {
r.emitReportEntry(1, entry)
}
r.emitBlock(r.fi(1, "{{gray}}<< Report Entries{{/}}"))
}
if showTimeline {
r.emitBlock("\n")
r.emitBlock(r.fi(1, "{{gray}}Timeline >>{{/}}"))
r.emitTimeline(1, report, timeline)
r.emitBlock(r.fi(1, "{{gray}}<< Timeline{{/}}"))
}

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

@lahabana
Copy link
Contributor Author

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

@onsi
Copy link
Owner

onsi commented Mar 12, 2024

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants