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

Suggestion: Export to Markdown #38

Open
mowies opened this issue Dec 1, 2021 · 9 comments · May be fixed by #39
Open

Suggestion: Export to Markdown #38

mowies opened this issue Dec 1, 2021 · 9 comments · May be fixed by #39

Comments

@mowies
Copy link

mowies commented Dec 1, 2021

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.

@afbjorklund afbjorklund linked a pull request Dec 6, 2021 that will close this issue
@afbjorklund
Copy link
Contributor

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

@mowies
Copy link
Author

mowies commented Dec 7, 2021

@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.

@afbjorklund
Copy link
Contributor

afbjorklund commented Dec 7, 2021

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

@mowies
Copy link
Author

mowies commented Dec 14, 2021

Awesome! This is exactly what I needed

@minauteur
Copy link

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

@afbjorklund
Copy link
Contributor

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

@minauteur
Copy link

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

@afbjorklund
Copy link
Contributor

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

@afbjorklund
Copy link
Contributor

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.

3 participants