go-test-report icon indicating copy to clipboard operation
go-test-report copied to clipboard

Suggestion: Export to Markdown

Open mowies opened this issue 3 years ago • 9 comments

It would be amazing if this repo would also support exporting to Markdown so that PR comments and GitHub issue can be created from the reports.

mowies avatar Dec 01 '21 09:12 mowies

@mowies Added a patch to add --markdown, hopefully that is what you were looking for

afbjorklund avatar Dec 06 '21 18:12 afbjorklund

@afbjorklund Amazing! I just checked out the PR! One thing maybe to add: For bigger test suites, the report gets super long for me. Is it somehow possible to provide an option to pass in my own custom markdown template? I would like to put in a more condensed template where every test is just a single line or even a table with just test name and a checkmark or a cross.

mowies avatar Dec 07 '21 13:12 mowies

There is now a --template parameter as well:

go test -json | ./go-test-report --markdown --template short_report.md.template

test_report.md

go-test-report

Total: 17

✓ TestGenerateReport

✓ TestGroupOutputFlag

✓ TestGroupOutputFlagIfMissingValue

✓ TestGroupSizeFlag

✓ TestGroupSizeFlagIfMissingValue

✓ TestParseSizeFlagIfHeightValueIsNotInteger

✓ TestParseSizeFlagIfMalformedSize

✓ TestParseSizeFlagIfValueIsNotInteger

✓ TestParseSizeFlagIfWidthValueIsNotInteger

✓ TestReadTestDataFromStdIn

✓ TestSameTestName

✓ TestSizeFlag

✓ TestSizeFlagIfMissingValue

✓ TestSizeFlagWithFullDimensions

✓ TestTitleFlag

✓ TestTitleFlagIfMissingValue

✓ TestVersionCommand

✓ Passed: 17 | ‐ Skipped: 0 | ✗ Failed: 0

afbjorklund avatar Dec 07 '21 16:12 afbjorklund

Awesome! This is exactly what I needed

mowies avatar Dec 14 '21 09:12 mowies

was this deprecated by something else? Why didn't this ever get merged?

minauteur avatar Aug 17 '23 23:08 minauteur

  • https://github.com/vakenbolt/go-test-report/pull/39#issuecomment-997683958

There have been no new go-test-report releases in 2022, or in 2023.

afbjorklund avatar Aug 18 '23 05:08 afbjorklund

So forking is the right answer then, I suppose, unless you are aware of another ready made solution that exports to markdown?

minauteur avatar Aug 19 '23 00:08 minauteur

Plenty of tools write markdown, but not exactly similar for go test no.

afbjorklund avatar Aug 19 '23 07:08 afbjorklund

  • #60

afbjorklund avatar Aug 19 '23 09:08 afbjorklund