Commit cc687bc8 authored by Marcel Amirault's avatar Marcel Amirault

Merge branch 'patch-1' into 'master'

junit_test_reports.md: add -set-exit-code to go example

See merge request gitlab-org/gitlab!34715
parents 61c6e2d5 b06c2dda
......@@ -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