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: ...@@ -103,7 +103,8 @@ ruby:
### Go example ### 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 ```yaml
## Use https://github.com/jstemmer/go-junit-report to generate a JUnit report with go ## Use https://github.com/jstemmer/go-junit-report to generate a JUnit report with go
...@@ -111,7 +112,7 @@ golang: ...@@ -111,7 +112,7 @@ golang:
stage: test stage: test
script: script:
- go get -u github.com/jstemmer/go-junit-report - 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: artifacts:
reports: reports:
junit: report.xml 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