Skip to content

Commit 1ce7951

Browse files
committed
Added test for new option being passed through
1 parent b42dbed commit 1ce7951

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

tests/command.bats

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,3 +473,30 @@ DOCKER_STUB_DEFAULT_OPTIONS='--log-level error run --rm --volume \* --volume \*
473473
unstub docker
474474
rm "${annotation_input}"
475475
}
476+
477+
@test "can customize skipped tests variable" {
478+
export BUILDKITE_PLUGIN_JUNIT_ANNOTATE_ARTIFACTS="junits/*.xml"
479+
export BUILDKITE_PLUGIN_JUNIT_ANNOTATE_SKIPPED_FORMAT="whatever"
480+
481+
stub mktemp \
482+
"-d \* : mkdir -p '$artifacts_tmp'; echo '$artifacts_tmp'" \
483+
"-d \* : mkdir -p '$annotation_tmp'; echo '$annotation_tmp'"
484+
485+
stub buildkite-agent \
486+
"artifact download \* \* : echo Downloaded artifact \$3 to \$4" \
487+
"annotate --context \* --style \* : cat >'${annotation_input}'; echo Annotation added with context \$3 and style \$5, content saved"
488+
489+
stub docker \
490+
"--log-level error run --rm --volume \* --volume \* --env \* --env \* --env \* --env BUILDKITE_PLUGIN_JUNIT_ANNOTATE_SKIPPED_FORMAT='whatever' \* ruby /src/bin/annotate /junits : cat tests/2-tests-1-failure.output && exit 64"
491+
492+
run "$PWD/hooks/command"
493+
494+
assert_success
495+
496+
assert_output --partial "Annotation added"
497+
498+
unstub mktemp
499+
unstub buildkite-agent
500+
unstub docker
501+
rm "${annotation_input}"
502+
}

0 commit comments

Comments
 (0)