Skip to content

Commit cd2d263

Browse files
committed
Implemented new option for agent download errors
1 parent 8c6477f commit cd2d263

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ Default: `false`
6060

6161
If this setting is true and any errors are found in the JUnit XML files during parsing, the annotation step will exit with a non-zero value, which should cause the build to fail.
6262

63+
### `failed-download-exit-code` (optional, integer)
64+
65+
Default: `2`
66+
67+
Exit code of the plugin if the call to `buildkite-agent artifact download` fails.
68+
6369
### `min-tests` (optional, integer)
6470

6571
Minimum amount of run tests that need to be analyzed or a failure will be reported. It is useful to ensure that tests are actually run and report files to analyze do contain information.

hooks/command

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ trap cleanup EXIT
3535
echo "--- :junit: Download the junits"
3636
if ! buildkite-agent artifact download "${BUILDKITE_PLUGIN_JUNIT_ANNOTATE_ARTIFACTS}" "$artifacts_dir"; then
3737
echo "--- :boom: Could not download artifacts"
38-
exit 2
38+
exit "${BUILDKITE_PLUGIN_JUNIT_ANNOTATE_FAILED_DOWNLOAD_EXIT_CODE:-2}"
3939
fi
4040

4141
echo "--- :junit: Processing the junits"

plugin.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ configuration:
1818
- file
1919
fail-build-on-error:
2020
type: boolean
21+
failed-download-exit-code:
22+
type: integer
2123
job-uuid-file-pattern:
2224
type: string
2325
min-tests:

0 commit comments

Comments
 (0)