Commit b06c2dda authored by Louis's avatar Louis Committed by Marcel Amirault

junit_test_reports.md: add -set-exit-code

If you don't set it, then the pipeline will succeed even if the tests fail.
parent e874bbb9
......@@ -103,7 +103,8 @@ ruby:
### Go example
Use the following job in `.gitlab-ci.yml`:
Use the following job in `.gitlab-ci.yml`, and ensure you use `-set-exit-code`,
otherwise the pipeline will be marked successful, even if the tests fail:
```yaml
## Use https://github.com/jstemmer/go-junit-report to generate a JUnit report with go
......@@ -111,7 +112,7 @@ golang:
stage: test
script:
- go get -u github.com/jstemmer/go-junit-report
- go test -v 2>&1 | go-junit-report > report.xml
- go test -v 2>&1 | go-junit-report -set-exit-code > report.xml
artifacts:
reports:
junit: report.xml
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment