Skip to content

Commit b0caed5

Browse files
author
Nicole Lopez
committed
actually pass the failure output env var to docker
1 parent d3ea335 commit b0caed5

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

hooks/command

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ docker \
3030
--volume "$artifacts_dir:/junits" \
3131
--volume "$PLUGIN_DIR/ruby:/src" \
3232
--env "BUILDKITE_PLUGIN_JUNIT_ANNOTATE_JOB_UUID_FILE_PATTERN=${BUILDKITE_PLUGIN_JUNIT_ANNOTATE_JOB_UUID_FILE_PATTERN:-}" \
33+
--env "BUILDKITE_PLUGIN_JUNIT_ANNOTATE_FAILURE_OUTPUT=${BUILDKITE_PLUGIN_JUNIT_ANNOTATE_FAILURE_OUTPUT:-}" \
3334
ruby:2.5-alpine /src/bin/annotate /junits \
3435
> "$annotation_path"
3536

@@ -39,4 +40,4 @@ if grep -q "<details>" "$annotation_path"; then
3940
echo "--- :buildkite: Creating annotation"
4041
# shellcheck disable=SC2002
4142
cat "$annotation_path" | buildkite-agent annotate --context junit --style error
42-
fi
43+
fi

tests/command.bats

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ load "$BATS_PATH/load.bash"
2020
stub buildkite-agent "artifact download junits/*.xml /plugin/tests/tmp//plugin/junit-artifacts : echo Downloaded artifacts" \
2121
"annotate --context junit --style error : echo Annotation added"
2222

23-
stub docker "--log-level error run --rm --volume /plugin/tests/tmp//plugin/junit-artifacts:/junits --volume /plugin/hooks/../ruby:/src --env BUILDKITE_PLUGIN_JUNIT_ANNOTATE_JOB_UUID_FILE_PATTERN= ruby:2.5-alpine /src/bin/annotate /junits : echo '<details>Failure</details>'"
23+
stub docker "--log-level error run --rm --volume /plugin/tests/tmp//plugin/junit-artifacts:/junits --volume /plugin/hooks/../ruby:/src --env BUILDKITE_PLUGIN_JUNIT_ANNOTATE_JOB_UUID_FILE_PATTERN= --env BUILDKITE_PLUGIN_JUNIT_ANNOTATE_FAILURE_OUTPUT= ruby:2.5-alpine /src/bin/annotate /junits : echo '<details>Failure</details>'"
2424

2525
run "$PWD/hooks/command"
2626

@@ -45,7 +45,7 @@ load "$BATS_PATH/load.bash"
4545

4646
stub buildkite-agent "artifact download junits/*.xml /plugin/tests/tmp//plugin/junit-artifacts : echo Downloaded artifacts"
4747

48-
stub docker "--log-level error run --rm --volume /plugin/tests/tmp//plugin/junit-artifacts:/junits --volume /plugin/hooks/../ruby:/src --env BUILDKITE_PLUGIN_JUNIT_ANNOTATE_JOB_UUID_FILE_PATTERN= ruby:2.5-alpine /src/bin/annotate /junits : echo No test errors"
48+
stub docker "--log-level error run --rm --volume /plugin/tests/tmp//plugin/junit-artifacts:/junits --volume /plugin/hooks/../ruby:/src --env BUILDKITE_PLUGIN_JUNIT_ANNOTATE_JOB_UUID_FILE_PATTERN= --env BUILDKITE_PLUGIN_JUNIT_ANNOTATE_FAILURE_OUTPUT= ruby:2.5-alpine /src/bin/annotate /junits : echo No test errors"
4949

5050
run "$PWD/hooks/command"
5151

@@ -54,4 +54,4 @@ load "$BATS_PATH/load.bash"
5454
unstub mktemp
5555
unstub buildkite-agent
5656
unstub docker
57-
}
57+
}

0 commit comments

Comments
 (0)