Skip to content

Commit bfddd4b

Browse files
committed
Generalized tests to make them independent from images
1 parent 210a0bf commit bfddd4b

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

tests/command.bats

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export annotation_input="tests/tmp/annotation.input"
2525
"annotate --context \* --style \* : cat >'${annotation_input}'; echo Annotation added with context \$3 and style \$5, content saved"
2626

2727
stub docker \
28-
"--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"
28+
"--log-level error run --rm --volume \* --volume \* --env \* --env \* --env \* \* ruby /src/bin/annotate /junits : echo '<details>Failure</details>' && exit 64"
2929

3030
run "$PWD/hooks/command"
3131

@@ -53,7 +53,7 @@ export annotation_input="tests/tmp/annotation.input"
5353
"annotate --context \* --style \* : cat >'${annotation_input}'; echo Annotation added with context \$3 and style \$5, content saved"
5454

5555
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 /src/bin/annotate /junits : echo '<details>Failure</details>' && exit 64"
5757

5858
run "$PWD/hooks/command"
5959

@@ -80,7 +80,7 @@ export annotation_input="tests/tmp/annotation.input"
8080
"annotate --context \* --style \* : cat >'${annotation_input}'; echo Annotation added with context \$3 and style \$5, content saved"
8181

8282
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 /src/bin/annotate /junits : echo '<details>Failure</details>' && exit 64"
8484

8585
run "$PWD/hooks/command"
8686

@@ -107,7 +107,7 @@ export annotation_input="tests/tmp/annotation.input"
107107
"annotate --context \* --style \* : cat >'${annotation_input}'; echo Annotation added with context \$3 and style \$5, content saved"
108108

109109
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 /src/bin/annotate /junits : echo '<details>Failure</details>' && exit 64"
111111

112112
run "$PWD/hooks/command"
113113

@@ -132,7 +132,7 @@ export annotation_input="tests/tmp/annotation.input"
132132
"artifact download \* \* : echo Downloaded artifact \$3 to \$4"
133133

134134
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 /src/bin/annotate /junits : echo No test errors"
136136

137137
run "$PWD/hooks/command"
138138

@@ -156,7 +156,7 @@ export annotation_input="tests/tmp/annotation.input"
156156
"annotate --context \* --style \* : cat >'${annotation_input}'; echo Annotation added with context \$3 and style \$5, content saved"
157157

158158
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 /src/bin/annotate /junits : echo No test errors"
160160

161161
run "$PWD/hooks/command"
162162

@@ -194,7 +194,7 @@ export annotation_input="tests/tmp/annotation.input"
194194
"artifact download \* \* : echo Downloaded artifact \$3 to \$4"
195195

196196
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"
197+
"--log-level error run --rm --volume \* --volume \* --env \* --env \* --env \* \* ruby /src/bin/annotate /junits : echo '<details>Failure</details>' && exit 64"
198198

199199
run "$PWD/hooks/command"
200200

@@ -226,7 +226,7 @@ export annotation_input="tests/tmp/annotation.input"
226226
"annotate --context \* --style \* : cat >'${annotation_input}'; echo Annotation added with context \$3 and style \$5, content saved"
227227

228228
stub docker \
229-
"--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"
229+
"--log-level error run --rm --volume \* --volume \* --env \* --env \* --env \* \* ruby /src/bin/annotate /junits : cat tests/2-tests-1-failure.output && exit 64"
230230

231231
run "$PWD/hooks/command"
232232

@@ -256,7 +256,7 @@ export annotation_input="tests/tmp/annotation.input"
256256
"annotate --context \* --style \* : cat >'${annotation_input}'; echo Annotation added with context \$3 and style \$5, content saved"
257257

258258
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"
259+
"--log-level error run --rm --volume \* --volume \* --env \* --env \* --env \* \* ruby /src/bin/annotate /junits : echo '<details>Failure</details>' && exit 64"
260260

261261
run "$PWD/hooks/command"
262262

@@ -285,7 +285,7 @@ export annotation_input="tests/tmp/annotation.input"
285285
"artifact download \* \* : echo Downloaded artifact \$3 to \$4"
286286

287287
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"
288+
"--log-level error run --rm --volume \* --volume \* --env \* --env \* --env \* \* ruby /src/bin/annotate /junits : echo '<details>Failure</details>' && exit 64"
289289

290290
run "$PWD/hooks/command"
291291

@@ -311,7 +311,7 @@ export annotation_input="tests/tmp/annotation.input"
311311
"artifact download \* \* : echo Downloaded artifact \$3 to \$4"
312312

313313
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"
314+
"--log-level error run --rm --volume \* --volume \* --env \* --env \* --env \* \* ruby /src/bin/annotate /junits : echo '<details>Failure</details>' && exit 147"
315315

316316
run "$PWD/hooks/command"
317317

0 commit comments

Comments
 (0)