go-testreport
go-testreport copied to clipboard
Generate a markdown test report from the go json test result
Test Report
Generate a markdown test report from the go json test result.
Matches perfectly with github job summaries to visualize go test results:

The default output sorts the tests to show failing and slow tests at the top.
Install
Install via the go install command:
go install github.com/becheran/go-testreport@latest
Or use the pre-compiled binaries from github releases.
Run
Will use the standard input and return the result into a file:
go test ./... -json | go-testreport $GITHUB_STEP_SUMMARY
Customize by providing a own template file. See also the default markdown template. With the vars options custom values can be passed to the template from the outside:
go test ./... -json | go-testreport -template=./html.tmpl -vars="Title:Test Report Linux" $GITHUB_STEP_SUMMARY