A Golang library for generating HTML reports from go test results.
- Generates a good looking single page HTML report from Go test results, using Tailwind CSS for the UI.
- Test Report includes summary statistics (number of tests, passed/failed, total test duration), test case details, and relevant test output.
- Failed tests are highlighted at the top for easy identification.
- Support for reading test results from a JSON file or standard input, which makes it easy to use with
go testcommand. - No external dependencies besides
testify.
You can find a full page screenshot of the resulting report here and a full HTML example here.
Binary install
The simplest way to install this tool is by using the binary release. See Releases for details.
Go install
go install github.com/brpaz/go-test-html-report/cmd/go-test-html-report@latestNix
Coming soon...
After installing go-test-html-report, you can use it to generate an HTML report from your Go test results.
The tool supports reading test results from a JSON file or directly from standard input.
From file
go-test-html-report -i path/to/test-results.json -o path/to/report.html -t "Test Report"From standard input
go test -json ./... | go-test-html-report -i - -o path/to/report.html -t "Test Report"| Flag | Short | Description | Default Value |
|---|---|---|---|
--input |
-i |
Input file containing Go test results (use '-' for stdin) | test_results.json |
--output |
-o |
Output file for the HTML report | report.html |
--title |
-t |
Title for the HTML report | Go Test Report |
--help |
-h |
Show help information | - |
--version |
-v |
Show version information | - |
Contributions are welcome! If you find a bug or have a feature request, please open an issue or submit a pull request.
If you find this project helpful and would like to support its development, there are a few ways you can contribute:
✉️ Email - [email protected]
🖇️ Source code: (https://github.com/brpaz/go-test-html-report)
Distributed under the MIT License. See LICENSE file for details.

