junit2html

command module
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2023 License: MIT Imports: 8 Imported by: 0

README

junit2html

Convert Junit XML reports (junit.xml) into HTML reports using Golang.

  • Standalone binary.
  • Failed tests are top, that's what's important.
  • No JavaScript.
  • Look gorgeous.

Screenshot

screenshot

Usage

Here is an example that uses trap to always created the test report:

go install github.com/jstemmer/go-junit-report@latest
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:

go test -v -cover ./... 2>&1 > test.out
go-junit-report < test.out > junit.xml 
go run . < junit.xml > test-report.html 

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL