From e54fda86a88368694575791b1e3ca2e849b7065b Mon Sep 17 00:00:00 2001 From: goodspark Date: Tue, 1 Feb 2022 14:57:56 -0800 Subject: [PATCH] Add an annotation when report is too large This would at least give people a clue as to why there were no annotations but the tests failed. --- hooks/command | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hooks/command b/hooks/command index 3c484b5..0fd542e 100755 --- a/hooks/command +++ b/hooks/command @@ -59,7 +59,9 @@ cat "$annotation_path" if grep -q "
" "$annotation_path"; then if ! check_size; then echo "--- :warning: Failures too large to annotate" - echo "The failures are too large to create a build annotation. Please inspect the failed JUnit artifacts manually." + msg="The failures are too large to create a build annotation. Please inspect the failed JUnit artifacts manually." + echo "$msg" + echo "$msg" | buildkite-agent annotate --context "${BUILDKITE_PLUGIN_JUNIT_ANNOTATE_CONTEXT:-junit}" --style "$annotation_style" else echo "--- :buildkite: Creating annotation" # shellcheck disable=SC2002