Commit e44becee authored by Hannes Rosenögger's avatar Hannes Rosenögger

The Junit reports should always be uploaded

Without specifying `when:always` the junit reports
will only be uploaded if the job succeeds.
While this is documented behaviour, this causes confusion for
some users. As a simple solution we can just change the provided
examples to already include the relevant line.

Closes https://gitlab.com/gitlab-org/gitlab/-/issues/215901
parent a126ec82
...@@ -97,6 +97,7 @@ ruby: ...@@ -97,6 +97,7 @@ ruby:
- bundle install - bundle install
- bundle exec rspec --format progress --format RspecJunitFormatter --out rspec.xml - bundle exec rspec --format progress --format RspecJunitFormatter --out rspec.xml
artifacts: artifacts:
when: always
paths: paths:
- rspec.xml - rspec.xml
reports: reports:
...@@ -116,6 +117,7 @@ golang: ...@@ -116,6 +117,7 @@ golang:
- 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 -set-exit-code > report.xml - go test -v 2>&1 | go-junit-report -set-exit-code > report.xml
artifacts: artifacts:
when: always
reports: reports:
junit: report.xml junit: report.xml
``` ```
...@@ -137,6 +139,7 @@ java: ...@@ -137,6 +139,7 @@ java:
script: script:
- gradle test - gradle test
artifacts: artifacts:
when: always
reports: reports:
junit: build/test-results/test/**/TEST-*.xml junit: build/test-results/test/**/TEST-*.xml
``` ```
...@@ -156,6 +159,7 @@ java: ...@@ -156,6 +159,7 @@ java:
script: script:
- mvn verify - mvn verify
artifacts: artifacts:
when: always
reports: reports:
junit: junit:
- target/surefire-reports/TEST-*.xml - target/surefire-reports/TEST-*.xml
...@@ -173,6 +177,7 @@ pytest: ...@@ -173,6 +177,7 @@ pytest:
script: script:
- pytest --junitxml=report.xml - pytest --junitxml=report.xml
artifacts: artifacts:
when: always
reports: reports:
junit: report.xml junit: report.xml
``` ```
...@@ -194,6 +199,7 @@ cpp: ...@@ -194,6 +199,7 @@ cpp:
script: script:
- gtest.exe --gtest_output="xml:report.xml" - gtest.exe --gtest_output="xml:report.xml"
artifacts: artifacts:
when: always
reports: reports:
junit: report.xml junit: report.xml
``` ```
...@@ -208,6 +214,7 @@ cunit: ...@@ -208,6 +214,7 @@ cunit:
script: script:
- ./my-cunit-test - ./my-cunit-test
artifacts: artifacts:
when: always
reports: reports:
junit: ./my-cunit-test.xml junit: ./my-cunit-test.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