File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments