Commit 40e9b568 authored by Scott Hampton's avatar Scott Hampton

Merge branch 'd.nephin-master-patch-69915' into 'master'

docs: Use gotestsum in Unit test reports Go example

See merge request gitlab-org/gitlab!66787
parents 965fd54b 399f33af
...@@ -114,16 +114,15 @@ ruby: ...@@ -114,16 +114,15 @@ ruby:
### Go example ### Go example
Use the following job in `.gitlab-ci.yml`, and ensure you use `-set-exit-code`, Use the following job in `.gitlab-ci.yml`:
otherwise the pipeline is marked successful, even if the tests fail:
```yaml ```yaml
## Use https://github.com/jstemmer/go-junit-report to generate a JUnit report format XML file with go ## Use https://github.com/gotestyourself/gotestsum to generate a JUnit report format XML file with go
golang: golang:
stage: test stage: test
script: script:
- go get -u github.com/jstemmer/go-junit-report - go get gotest.tools/gotestsum
- go test -v 2>&1 | go-junit-report -set-exit-code > report.xml - gotestsum --junitfile report.xml --format testname
artifacts: artifacts:
when: always when: always
reports: reports:
......
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