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

Support Markdown formatted output. #386

Open
jeschkies opened this issue Feb 2, 2024 · 3 comments
Open

Support Markdown formatted output. #386

jeschkies opened this issue Feb 2, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@jeschkies
Copy link

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

@dnephin dnephin added the enhancement New feature or request label Feb 3, 2024
@dnephin
Copy link
Member

dnephin commented Feb 3, 2024

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:

  • gotestsum should print its summary as it does today to the regular step output
  • if the GITHUB_STEP_SUMMARY environment variable is set to the path of a file that exists, write a markdown summary to that file
  • add a new flag to specify what the summary should look like, or to disable it entirely. I imagine that flag would work similar to the existing --hide-summary flag, but that will depend on exactly what's in the summary.

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
Copy link
Author

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
Copy link
Contributor

afbjorklund commented Mar 14, 2024

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

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

No branches or pull requests

3 participants