Skip to content

Commit 574131b

Browse files
authored
Merge pull request #173 from buildkite-plugins/toote_test_revamp
Test revamp & dependency update
2 parents b0233f9 + 6f55215 commit 574131b

File tree

5 files changed

+187
-71
lines changed

5 files changed

+187
-71
lines changed

.buildkite/pipeline.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
steps:
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/*

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '2'
22
services:
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:

hooks/command

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22

33
set -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+
510
PLUGIN_DIR="$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)/.."
611
MAX_SIZE=1024 # in KB
712

8-
echo "--- :junit: Download the junits"
9-
1013
artifacts_dir="$(pwd)/$(mktemp -d "junit-annotate-plugin-artifacts-tmp.XXXXXXXXXX")"
1114
annotation_dir="$(pwd)/$(mktemp -d "junit-annotate-plugin-annotation-tmp.XXXXXXXXXX")"
1215
annotation_path="${annotation_dir}/annotation.md"
@@ -26,9 +29,11 @@ function check_size {
2629

2730
trap 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

3338
echo "--- :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
5364
fi
5465

55-
set -e
56-
5766
cat "$annotation_path"
5867

5968
if grep -q "<details>" "$annotation_path"; then

renovate.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"extends": [
3-
"config:base"
3+
"config:base",
4+
":disableDependencyDashboard"
45
],
56
"bundler": {
67
"enabled": true

0 commit comments

Comments
 (0)