Skip to content

Latest commit

 

History

History
67 lines (52 loc) · 2.04 KB

README.md

File metadata and controls

67 lines (52 loc) · 2.04 KB

go-junit-report

Converts go test output to an xml report, suitable for applications that expect junit xml reports (e.g. Jenkins).

Build Status Report Card

Installation

Go version 1.11 or higher (with module support) is required. Install using the go get command:

go get github.com/hexon/go-junit-report

Usage

go-junit-report reads the go test verbose output from standard in and writes junit compatible XML to standard out.

go test -v ./... 2>&1 | go-junit-report -set-exit-code > report.xml

Note that it also can parse benchmark output with -bench flag:

go test -v -bench . ./... 2>&1 | go-junit-report > report.xml

Command line flags:

Usage of go-junit-report:
  -full-package-classname
        use the full package name as the test classname instead of just the last part
  -go-version string
        specify the value to use for the go.version property in the generated XML
  -no-xml-header
        do not print xml header
  -package-name string
        specify a package name (compiled test have no package name in output)
  -set-exit-code
        set exit code to 1 if tests failed
  -strip-ansi-escape-codes
        strip ANSI escape codes (terminal color codes)

Contribution

Create an Issue and discuss the fix or feature, then fork the package. Fix or implement feature. Test and then commit change. Specify #Issue and describe change in the commit message. Create Pull Request. It can be merged by owner or administrator then.

This is a fork of github.com/jstemmer/go-junit-report

Run Tests

go test ./...