jstemmer / go-junit-report

Convert Go test output to JUnit XML
MIT License
764 stars 222 forks source link

Add Package Prefix option for report namespacing #102

Open bbrks opened 4 years ago

bbrks commented 4 years ago

Closes #100

Adds a -package-prefix flag, that can be used to namespace packages in reports.

This opens up the opportunity to use go-junit-report to generate unique XML reports for various combinations of $GOOS/$GOARCH (and other build tags) that won't conflict with each other.

More detail about this use-case is included in #100

Example usage:

export GOOS=linux
export GOARCH=arm64
go test -v 2>&1 | go-junit-report -package-prefix="${GOOS}/${GOARCH}" > report-${GOOS}-${GOARCH}.xml