Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/becheran/go-testreport
Generate a markdown test report from the go json test result
https://github.com/becheran/go-testreport
github-actions go markdown report unittest
Last synced: 3 months ago
JSON representation
Generate a markdown test report from the go json test result
- Host: GitHub
- URL: https://github.com/becheran/go-testreport
- Owner: becheran
- License: mit
- Created: 2022-12-27T19:24:33.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-09T17:23:50.000Z (10 months ago)
- Last Synced: 2024-06-20T03:42:37.242Z (8 months ago)
- Topics: github-actions, go, markdown, report, unittest
- Language: Go
- Homepage:
- Size: 107 KB
- Stars: 28
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Test Report
[![Pipeline Status](https://github.com/becheran/go-testreport/actions/workflows/go.yml/badge.svg)](https://github.com/becheran/go-testreport/actions/workflows/go.yml)
[![Go Report Card][go-report-image]][go-report-url]
[![PRs Welcome][pr-welcome-image]][pr-welcome-url]
[![License][license-image]][license-url][license-url]: https://github.com/becheran/go-testreport/blob/main/LICENSE
[license-image]: https://img.shields.io/badge/License-MIT-brightgreen.svg
[go-report-image]: https://goreportcard.com/badge/github.com/becheran/go-testreport
[go-report-url]: https://goreportcard.com/report/github.com/becheran/go-testreport
[pr-welcome-image]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg
[pr-welcome-url]: https://github.com/becheran/go-testreport/blob/main/CONTRIBUTING.mdGenerate a markdown test report from the go json test result.
Matches perfectly with [github job summaries](https://github.blog/2022-05-09-supercharging-github-actions-with-job-summaries/) to visualize *go* test results:
![ReportExample](./doc/GitHubReport.png)
The default output sorts the tests to show failing and slow tests at the top.
## Install
Install via the go install command:
``` sh
go install github.com/becheran/go-testreport@latest
```Or use the pre-compiled binaries from [github releases](https://github.com/becheran/go-testreport/releases).
## Run
Will use the standard input and return the result into a file:
``` sh
go test ./... -json | go-testreport $GITHUB_STEP_SUMMARY
```Customize by providing a own template file. See also the [default markdown template](./internal/report/templates/md.tmpl). With the `vars` options custom values can be passed to the template from the outside:
``` sh
go test ./... -json | go-testreport -template=./html.tmpl -vars="Title:Test Report Linux" $GITHUB_STEP_SUMMARY
```