File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -343,4 +343,32 @@ export annotation_input="tests/tmp/annotation.input"
343343
344344 unstub mktemp
345345 unstub buildkite-agent
346+ }
347+
348+ @test " runs the annotator and creates the annotation with special image" {
349+ export BUILDKITE_PLUGIN_JUNIT_ANNOTATE_ARTIFACTS=" junits/*.xml"
350+ export BUILDKITE_PLUGIN_JUNIT_ANNOTATE_RUBY_IMAGE=" ruby:special"
351+
352+ stub mktemp \
353+ " -d \* : mkdir -p '$artifacts_tmp '; echo '$artifacts_tmp '" \
354+ " -d \* : mkdir -p '$annotation_tmp '; echo '$annotation_tmp '"
355+
356+ stub buildkite-agent \
357+ " artifact download \* \* : echo Downloaded artifact \$ 3 to \$ 4" \
358+ " annotate --context \* --style \* : cat >'${annotation_input} '; echo Annotation added with context \$ 3 and style \$ 5, content saved"
359+
360+ stub docker \
361+ " --log-level error run --rm --volume \* --volume \* --env \* --env \* --env \* ruby:special ruby /src/bin/annotate /junits : echo '<details>Failure</details>' && exit 64"
362+
363+ run " $PWD /hooks/command"
364+
365+ assert_success
366+
367+ assert_output --partial " Annotation added with context junit and style error"
368+ assert_equal " $( cat " ${annotation_input} " ) " ' <details>Failure</details>'
369+
370+ unstub mktemp
371+ unstub buildkite-agent
372+ unstub docker
373+ rm " ${annotation_input} "
346374}
You can’t perform that action at this time.
0 commit comments