https://github.com/kitproj/junit2html
Convert junit.xml into gorgeous HTML reports
https://github.com/kitproj/junit2html
junit xml
Last synced: 5 months ago
JSON representation
Convert junit.xml into gorgeous HTML reports
- Host: GitHub
- URL: https://github.com/kitproj/junit2html
- Owner: kitproj
- License: mit
- Created: 2022-05-06T05:26:27.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-03-13T14:40:00.000Z (over 3 years ago)
- Last Synced: 2024-06-20T07:49:17.607Z (almost 2 years ago)
- Topics: junit, xml
- Language: HTML
- Homepage:
- Size: 116 KB
- Stars: 8
- Watchers: 0
- Forks: 9
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# junit2html
Convert Junit XML reports (`junit.xml`) into HTML reports using a single standalone binary.
* Standalone binary.
* Failed tests are top, that's what's important.
* No JavaScript.
* Look gorgeous.
## Screenshot

## Install
Like `jq`, `junit2html` is a tiny (8Mb) standalone binary. You can download it from the [releases page](https://github.com/kitproj/junit2html/releases/latest).
If you're on MacOS, you can use `brew`:
```bash
brew tap kitproj/junit2html --custom-remote https://github.com/kitproj/junit2html
brew install junit2html
```
Otherwise, you can use `curl`:
```bash
curl -q https://raw.githubusercontent.com/kitproj/junit2html/main/install.sh | sh
```
## Usage
Here is an example that uses trap to always created the test report:
```bash
go install github.com/alexec/junit2html@latest
trap 'go-junit-report < test.out > junit.xml && junit2html < junit.xml > test-report.html' EXIT
go test -v -cover ./... 2>&1 > test.out
```
💡 Don't use pipes (i.e. `|`) in shell, pipes swallow exit codes. Use `<` and `>` which is POSIX compliant.
## Test
How to test this locally:
```bash
go test -v -cover ./... 2>&1 > test.out
go-junit-report < test.out > junit.xml
go run . < junit.xml > test-report.html
```