gotestyourself / gotestsum

'go test' runner with output optimized for humans, JUnit XML for CI integration, and a summary of the test results.
Apache License 2.0
1.99k stars 118 forks source link

Support Markdown formatted output. #386

Open jeschkies opened 5 months ago

jeschkies commented 5 months ago

Since GitHub Actions support job summaries it would be nice to support a Markdown formatted summary.

dnephin commented 5 months ago

Thank you for the feature suggestion! Job summaries (docs) seem like a great feature.

It looks like these summaries are printed separately from the test output, so the way I think this should work is something along these lines:

For the contents of the markdown summary, I guess it would be pretty similar to the existing summary, except maybe in reverse. Start with a DONE line that has counts of tests pass/fail/skipped/error/total. Followed by sections for errors, then failed output , and finally skipped test output. If the summary supports collapsed sections that might be nice to hide the full output by default, or maybe only when the output is longer than ~10 lines.

Anything else we could include in that summary?

jeschkies commented 5 months ago

Start with a DONE line that has counts of tests pass/fail/skipped/error/total. Followed by sections for errors, then failed output , and finally skipped test output.

That sounds pretty good to me.

As for where to write the summary I'm not sure. Now that you've mentioned it it seems like a separate output. Would an option like --summary-output-path $GITHUB_STEP_SUMMARY make sense?

afbjorklund commented 4 months ago

You can use go-test-report, to generate markdown (and HTML) summaries

There is a related issue on how to make the tools co-operation better, and a request to move the project to gotest.tools