Skip to content

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

@lahabana

Description

@lahabana

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions