Skip to content

Commit b61b86b

Browse files
committed
Update README and contributing guidelines
- Add new section for installing go-junit-report from pre-built binaries. - The instructions for installing from source have been updated to use `go install`, now that `go get` is being deprecated, see #124. - Move contributing guidelines to separate `CONTRIBUTING.md` file.
1 parent 26cb193 commit b61b86b

File tree

2 files changed

+50
-22
lines changed

2 files changed

+50
-22
lines changed

CONTRIBUTING.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Contributing
2+
3+
## Bug reports
4+
5+
- Before reporting a bug, have a look at the [issue
6+
list](https://github.com/jstemmer/go-junit-report/issues) to see if an issue
7+
already exists for your problem.
8+
- Include as much information as you can in the bug report, e.g.: the versions
9+
of go-junit-report and the Go compiler, how go-junit-report was called, what
10+
input was given to go-junit-report, what the actual output was, was the
11+
expected output was.
12+
13+
## Pull requests
14+
15+
- Before sending a pull request for new features, open an issue to discuss it.
16+
- Run `go fmt` to format your code.
17+
- Add test coverage and run all tests.
18+
- Prefer small PRs, avoid making unrelated changes in the same PR.
19+
- Limit the first line of the commit message to 72 characters.
20+
- Write commit messages in the imperative mood ("Fix bug", not "Fixed bug" or
21+
"Fixes bug") .

README.md

+29-22
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,56 @@
11
# go-junit-report
22

3-
Converts `go test` output to an xml report, suitable for applications that
4-
expect junit xml reports (e.g. [Jenkins](http://jenkins-ci.org)).
3+
go-junit-report is a tool that converts [`go test`] output to an XML report,
4+
suitable for applications that expect JUnit-style XML reports (e.g.
5+
[Jenkins](http://jenkins-ci.org)).
6+
7+
The test output [parser] and JUnit report [formatter] are also available as Go
8+
packages.
59

610
[![Build Status][travis-badge]][travis-link]
7-
[![Report Card][report-badge]][report-link]
811

9-
## Installation
12+
## Install from package (recommended)
13+
14+
Pre-built packages for Windows, macOS and Linux are found on the [Releases]
15+
page.
16+
17+
## Install from source
1018

11-
Go version 1.2 or higher is required. Install or update using the `go get`
12-
command:
19+
Download and install the latest stable version from source by running:
1320

1421
```bash
15-
go get -u github.com/jstemmer/go-junit-report
22+
go install github.com/jstemmer/go-junit-report@latest
1623
```
1724

1825
## Usage
1926

20-
go-junit-report reads the `go test` verbose output from standard in and writes
21-
junit compatible XML to standard out.
27+
go-junit-report reads the full `go test` output from stdin and writes JUnit
28+
compatible XML to stdout. In order to capture build errors as well as test
29+
output, redirect both stdout and stderr to go-junit-report.
2230

2331
```bash
2432
go test -v 2>&1 | go-junit-report > report.xml
2533
```
2634

27-
Note that it also can parse benchmark output with `-bench` flag:
35+
Parsing benchmark output is also supported, for example:
36+
2837
```bash
2938
go test -v -bench . -count 5 2>&1 | go-junit-report > report.xml
3039
```
3140

32-
## Contribution
41+
If you want go-junit-report to exit with a non-zero exit code when it encounters
42+
build errors or test failures, set the `-set-exit-code` flag.
3343

34-
Create an Issue and discuss the fix or feature, then fork the package.
35-
Clone to github.com/jstemmer/go-junit-report. This is necessary because go import uses this path.
36-
Fix or implement feature. Test and then commit change.
37-
Specify #Issue and describe change in the commit message.
38-
Create Pull Request. It can be merged by owner or administrator then.
44+
Run `go-junit-report -help` for a list of all supported flags.
3945

40-
### Run Tests
46+
## Contributing
4147

42-
```bash
43-
go test
44-
```
48+
See [CONTRIBUTING.md].
4549

50+
[`go test`]: https://pkg.go.dev/cmd/go#hdr-Test_packages
51+
[parser]: https://pkg.go.dev/github.com/jstemmer/go-junit-report/parser
52+
[formatter]: https://pkg.go.dev/github.com/jstemmer/go-junit-report/formatter
4653
[travis-badge]: https://travis-ci.org/jstemmer/go-junit-report.svg?branch=master
4754
[travis-link]: https://travis-ci.org/jstemmer/go-junit-report
48-
[report-badge]: https://goreportcard.com/badge/github.com/jstemmer/go-junit-report
49-
[report-link]: https://goreportcard.com/report/github.com/jstemmer/go-junit-report
55+
[Releases]: https://github.com/jstemmer/go-junit-report/releases
56+
[CONTRIBUTING.md]: https://github.com/jstemmer/go-junit-report/blob/master/CONTRIBUTING.md

0 commit comments

Comments
 (0)