Skip to content

Commit f36f7da

Browse files
Merge pull request circleci#1327 from circleci/add-when-always-to-test-data-examples
Update collect-test-data.md
2 parents 204aac0 + 080afd4 commit f36f7da

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

jekyll/_cci2/collect-test-data.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ Alternatively, if you want to use Cucumber's JSON formatter, be sure to name the
8585
- run: |
8686
mkdir -p /cucumber
8787
bundle exec cucumber pretty --format json --out /cucumber/tests.cucumber
88+
when: always
8889
- store_test_results:
8990
path: /cucumber
9091
- store_artifacts:
@@ -104,6 +105,7 @@ project.
104105
- run: |
105106
mkdir -p /junit/
106107
find . -type f -regex ".*/target/surefire-reports/.*xml" -exec cp {} /junit/ \;
108+
when: always
107109
- store_test_results:
108110
path: /junit
109111
- store_artifacts:
@@ -122,6 +124,7 @@ project.
122124
- run: |
123125
mkdir -p /junit/
124126
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} /junit/ \;
127+
when: always
125128
- store_test_results:
126129
path: /junit
127130
- store_artifacts:
@@ -143,6 +146,7 @@ A working `.circleci/config.yml` section for testing might look like this:
143146
command: mocha test --reporter mocha-junit-reporter
144147
environment:
145148
MOCHA_FILE: junit/test-results.xml
149+
when: always
146150
- store_test_results:
147151
path: /junit
148152
- store_artifacts:
@@ -161,6 +165,7 @@ A working `.circleci/config.yml` section for testing might look like the followi
161165
yarn add ava tap-xunit --dev # or you could use npm
162166
mkdir -p /reports
163167
ava --tap | tap-xunit > /reports/ava.xml
168+
when: always
164169
- store_test_results:
165170
path: /reports
166171
- store_artifacts:
@@ -179,6 +184,7 @@ A working `.circleci/config.yml` test section might look like this:
179184
- run: |
180185
mkdir -p /reports
181186
eslint ./src/ --format junit --output-file /reports/eslint.xml
187+
when: always
182188
- store_test_results:
183189
path: /reports
184190
- store_artifacts:
@@ -195,6 +201,7 @@ For PHPUnit tests, you should generate a file using the `--log-junit` command li
195201
- run: |
196202
mkdir -p /phpunit
197203
phpunit --log-junit /phpunit/junit.xml tests
204+
when: always
198205
- store_test_results:
199206
path: /phpunit
200207
- store_artifacts:
@@ -216,7 +223,9 @@ And modify your test command to this:
216223
- checkout
217224
- run: bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs=4 --retry=3
218225
- run: mkdir rspec
219-
- run: bundle exec rspec --format progress --format RspecJunitFormatter -o rspec/rspec.xml
226+
- run: |
227+
bundle exec rspec --format progress --format RspecJunitFormatter -o rspec/rspec.xml
228+
when: always
220229
- store_test_results:
221230
path: rspec
222231
````
@@ -236,7 +245,9 @@ And modify your test command to this:
236245
- checkout
237246
- run: bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs=4 --retry=3
238247
- run: mkdir reports
239-
- run: bundle exec rake test TESTOPTS="--ci-dir=./reports":
248+
- run:
249+
bundle exec rake test TESTOPTS="--ci-dir=./reports":
250+
when: always
240251
- store_test_results:
241252
path: reports
242253
````
@@ -262,6 +273,7 @@ A working `.circleci/config.yml` section might look like this:
262273
environment:
263274
JUNIT_REPORT_PATH: ./junit/
264275
JUNIT_REPORT_NAME: test-results.xml
276+
when: always
265277
- store_test_results:
266278
path: /junit
267279
- store_artifacts:

0 commit comments

Comments
 (0)