Skip to content

Commit da38ac0

Browse files
committed
Added tests for new option
1 parent cd2d263 commit da38ac0

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/command.bats

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,27 @@ export annotation_input="tests/tmp/annotation.input"
346346
unstub buildkite-agent
347347
}
348348

349+
@test "customize error when agent download fails" {
350+
export BUILDKITE_PLUGIN_JUNIT_ANNOTATE_ARTIFACTS="junits/*.xml"
351+
export BUILDKITE_PLUGIN_JUNIT_ANNOTATE_FAILED_DOWNLOAD_EXIT_CODE=5
352+
353+
stub mktemp \
354+
"-d \* : mkdir -p '$artifacts_tmp'; echo '$artifacts_tmp'" \
355+
"-d \* : mkdir -p '$annotation_tmp'; echo '$annotation_tmp'"
356+
357+
stub buildkite-agent \
358+
"artifact download \* \* : exit 1"
359+
360+
run "$PWD/hooks/command"
361+
362+
assert_failure 5
363+
364+
assert_output --partial "Could not download artifacts"
365+
366+
unstub mktemp
367+
unstub buildkite-agent
368+
}
369+
349370
@test "creates annotation with no failures but min tests triggers" {
350371
export BUILDKITE_PLUGIN_JUNIT_ANNOTATE_ARTIFACTS="junits/*.xml"
351372
export BUILDKITE_PLUGIN_JUNIT_ANNOTATE_MIN_TESTS=1

0 commit comments

Comments
 (0)