@@ -53,7 +53,7 @@ export annotation_input="tests/tmp/annotation.input"
53
53
" annotate --context \* --style \* : cat >'${annotation_input} '; echo Annotation added with context \$ 3 and style \$ 5, content saved"
54
54
55
55
stub docker \
56
- " --log-level error run --rm --volume \* --volume \* --env \* --env \* --env \* ruby:2.7-alpine ruby /src/bin/annotate /junits : echo '<details>Failure</details>' && exit 64"
56
+ " --log-level error run --rm --volume \* --volume \* --env \* --env \* --env \* ruby:2.7-alpine ruby /src/bin/annotate /junits : cat tests/2-tests-1-failure.output && exit 64"
57
57
58
58
run " $PWD /hooks/command"
59
59
@@ -80,7 +80,7 @@ export annotation_input="tests/tmp/annotation.input"
80
80
" annotate --context \* --style \* : cat >'${annotation_input} '; echo Annotation added with context \$ 3 and style \$ 5, content saved"
81
81
82
82
stub docker \
83
- " --log-level error run --rm --volume \* --volume \* --env BUILDKITE_PLUGIN_JUNIT_ANNOTATE_JOB_UUID_FILE_PATTERN='custom_(*)_pattern.xml' --env \* --env \* ruby:2.7-alpine ruby /src/bin/annotate /junits : echo '<details>Failure</details>' && exit 64"
83
+ " --log-level error run --rm --volume \* --volume \* --env BUILDKITE_PLUGIN_JUNIT_ANNOTATE_JOB_UUID_FILE_PATTERN='custom_(*)_pattern.xml' --env \* --env \* ruby:2.7-alpine ruby /src/bin/annotate /junits : cat tests/2-tests-1-failure.output && exit 64"
84
84
85
85
run " $PWD /hooks/command"
86
86
@@ -107,7 +107,7 @@ export annotation_input="tests/tmp/annotation.input"
107
107
" annotate --context \* --style \* : cat >'${annotation_input} '; echo Annotation added with context \$ 3 and style \$ 5, content saved"
108
108
109
109
stub docker \
110
- " --log-level error run --rm --volume \* --volume \* --env \* --env BUILDKITE_PLUGIN_JUNIT_ANNOTATE_FAILURE_FORMAT='file' --env \* ruby:2.7-alpine ruby /src/bin/annotate /junits : echo '<details>Failure</details>' && exit 64"
110
+ " --log-level error run --rm --volume \* --volume \* --env \* --env BUILDKITE_PLUGIN_JUNIT_ANNOTATE_FAILURE_FORMAT='file' --env \* ruby:2.7-alpine ruby /src/bin/annotate /junits : cat tests/2-tests-1-failure.output && exit 64"
111
111
112
112
run " $PWD /hooks/command"
113
113
@@ -132,7 +132,7 @@ export annotation_input="tests/tmp/annotation.input"
132
132
" artifact download \* \* : echo Downloaded artifact \$ 3 to \$ 4"
133
133
134
134
stub docker \
135
- " --log-level error run --rm --volume \* --volume \* --env \* --env \* --env \* ruby:2.7-alpine ruby /src/bin/annotate /junits : echo No test errors "
135
+ " --log-level error run --rm --volume \* --volume \* --env \* --env \* --env \* ruby:2.7-alpine ruby /src/bin/annotate /junits : echo 'Total tests: 0' "
136
136
137
137
run " $PWD /hooks/command"
138
138
@@ -156,13 +156,14 @@ export annotation_input="tests/tmp/annotation.input"
156
156
" annotate --context \* --style \* : cat >'${annotation_input} '; echo Annotation added with context \$ 3 and style \$ 5, content saved"
157
157
158
158
stub docker \
159
- " --log-level error run --rm --volume \* --volume \* --env \* --env \* --env \* ruby:2.7-alpine ruby /src/bin/annotate /junits : echo No test errors "
159
+ " --log-level error run --rm --volume \* --volume \* --env \* --env \* --env \* ruby:2.7-alpine ruby /src/bin/annotate /junits : echo 'Total tests: 0' "
160
160
161
161
run " $PWD /hooks/command"
162
162
163
163
assert_success
164
- assert_output --partial " No test errors "
164
+ assert_output --partial " Total tests: 0 "
165
165
assert_output --partial " Will create annotation anyways"
166
+ assert_equal " $( cat " ${annotation_input} " ) " ' Total tests: 0'
166
167
167
168
unstub mktemp
168
169
unstub buildkite-agent
@@ -194,7 +195,7 @@ export annotation_input="tests/tmp/annotation.input"
194
195
" artifact download \* \* : echo Downloaded artifact \$ 3 to \$ 4"
195
196
196
197
stub docker \
197
- " --log-level error run --rm --volume \* --volume \* --env \* --env \* --env \* ruby:2.7-alpine ruby /src/bin/annotate /junits : echo '<details>Failure</details>' && exit 64"
198
+ " --log-level error run --rm --volume \* --volume \* --env \* --env \* --env \* ruby:2.7-alpine ruby /src/bin/annotate /junits : cat tests/2-tests-1-failure.output && exit 64"
198
199
199
200
run " $PWD /hooks/command"
200
201
@@ -256,7 +257,7 @@ export annotation_input="tests/tmp/annotation.input"
256
257
" annotate --context \* --style \* : cat >'${annotation_input} '; echo Annotation added with context \$ 3 and style \$ 5, content saved"
257
258
258
259
stub docker \
259
- " --log-level error run --rm --volume \* --volume \* --env \* --env \* --env \* ruby:2.7-alpine ruby /src/bin/annotate /junits : echo '<details>Failure</details>' && exit 64"
260
+ " --log-level error run --rm --volume \* --volume \* --env \* --env \* --env \* ruby:2.7-alpine ruby /src/bin/annotate /junits : cat tests/2-tests-1-failure.output && exit 64"
260
261
261
262
run " $PWD /hooks/command"
262
263
@@ -285,7 +286,7 @@ export annotation_input="tests/tmp/annotation.input"
285
286
" artifact download \* \* : echo Downloaded artifact \$ 3 to \$ 4"
286
287
287
288
stub docker \
288
- " --log-level error run --rm --volume \* --volume \* --env \* --env \* --env \* ruby:2.7-alpine ruby /src/bin/annotate /junits : echo '<details>Failure</details>' && exit 64"
289
+ " --log-level error run --rm --volume \* --volume \* --env \* --env \* --env \* ruby:2.7-alpine ruby /src/bin/annotate /junits : cat tests/2-tests-1-failure.output && exit 64"
289
290
290
291
run " $PWD /hooks/command"
291
292
@@ -311,7 +312,7 @@ export annotation_input="tests/tmp/annotation.input"
311
312
" artifact download \* \* : echo Downloaded artifact \$ 3 to \$ 4"
312
313
313
314
stub docker \
314
- " --log-level error run --rm --volume \* --volume \* --env \* --env \* --env \* ruby:2.7-alpine ruby /src/bin/annotate /junits : echo '<details>Failure</details>' && exit 147"
315
+ " --log-level error run --rm --volume \* --volume \* --env \* --env \* --env \* ruby:2.7-alpine ruby /src/bin/annotate /junits : cat tests/2-tests-1-failure.output && exit 147"
315
316
316
317
run " $PWD /hooks/command"
317
318
0 commit comments