File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11steps :
22 - label : " :bash: Plugin"
33 plugins :
4- docker-compose#v3.9 .0:
4+ docker-compose#v4.2 .0:
55 run : plugin
66 - label : " :ruby: Ruby"
77 plugins :
8- docker-compose#v3.9 .0:
8+ docker-compose#v4.2 .0:
99 run : ruby
1010 - label : " ✨ Lint"
1111 plugins :
1212 plugin-linter#v3.0.0:
1313 id : junit-annotate
1414 - label : " :bash: Shellcheck"
1515 plugins :
16- shellcheck#v1.2 .0:
16+ shellcheck#v1.3 .0:
1717 files : hooks/*
Original file line number Diff line number Diff line change 11version : ' 2'
22services :
33 plugin :
4- image : buildkite/plugin-tester:latest@sha256:476a1024936901889147f53d2a3d8e71e99d76404972d583825514f5608083dc
4+ image : buildkite/plugin-tester:v3.0.1
55 volumes :
66 - " .:/plugin"
77 depends_on :
Original file line number Diff line number Diff line change 22
33set -euo pipefail
44
5+ if [[ -z " ${BUILDKITE_PLUGIN_JUNIT_ANNOTATE_ARTIFACTS:- } " ]]; then
6+ echo " 🚨 Missing artifacts configuration for the plugin"
7+ exit 1
8+ fi
9+
510PLUGIN_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) /.."
611MAX_SIZE=1024 # in KB
712
8- echo " --- :junit: Download the junits"
9-
1013artifacts_dir=" $( pwd) /$( mktemp -d " junit-annotate-plugin-artifacts-tmp.XXXXXXXXXX" ) "
1114annotation_dir=" $( pwd) /$( mktemp -d " junit-annotate-plugin-annotation-tmp.XXXXXXXXXX" ) "
1215annotation_path=" ${annotation_dir} /annotation.md"
@@ -26,9 +29,11 @@ function check_size {
2629
2730trap cleanup EXIT
2831
29- buildkite-agent artifact download \
30- " ${BUILDKITE_PLUGIN_JUNIT_ANNOTATE_ARTIFACTS} " \
31- " $artifacts_dir "
32+ echo " --- :junit: Download the junits"
33+ if ! buildkite-agent artifact download " ${BUILDKITE_PLUGIN_JUNIT_ANNOTATE_ARTIFACTS} " " $artifacts_dir " ; then
34+ echo " --- :boom: Could not download artifacts"
35+ exit 2
36+ fi
3237
3338echo " --- :junit: Processing the junits"
3439
@@ -45,15 +50,19 @@ docker \
4550 ruby:2.7-alpine ruby /src/bin/annotate /junits \
4651 > " $annotation_path "
4752
48- if [[ $? -eq 64 ]]; then # special exit code to signal test failures
53+ exit_code=$?
54+ set -e
55+
56+ if [[ $exit_code -eq 64 ]]; then # special exit code to signal test failures
4957 annotation_style=" error"
5058 if [[ " ${BUILDKITE_PLUGIN_JUNIT_ANNOTATE_FAIL_BUILD_ON_ERROR:- false} " =~ (true| on| 1) ]]; then
5159 fail_build=1
5260 fi
61+ elif [[ $exit_code -ne 0 ]]; then
62+ echo " --- :boom: Error when processing JUnit tests"
63+ exit $exit_code
5364fi
5465
55- set -e
56-
5766cat " $annotation_path "
5867
5968if grep -q " <details>" " $annotation_path " ; then
Original file line number Diff line number Diff line change 11{
22 "extends" : [
3- " config:base"
3+ " config:base" ,
4+ " :disableDependencyDashboard"
45 ],
56 "bundler" : {
67 "enabled" : true
You can’t perform that action at this time.
0 commit comments