Skip to content

Commit f9b6b32

Browse files
committed
fix(ci): exit 1 on datadog-ci upload failure so silent wrapper shows output
1 parent 4b700fb commit f9b6b32

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
#!/bin/bash
22
OUTFILE=/tmp/datadog-junit-upload.txt
33
"$(dirname -- "${BASH_SOURCE[0]}")"/upload-junit-to-datadog.sh "$@" >$OUTFILE 2>&1
4-
if [[ $? -ne 0 ]]; then
4+
rc=$?
5+
if [[ $rc -ne 0 ]]; then
56
cat $OUTFILE
67
else
78
grep -E '^\* ' $OUTFILE
89
fi
10+
exit $rc

.gitlab/upload-junit-to-datadog.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,8 @@ echo "Current directory: $(pwd)"
215215
echo "Running command: ${datadog_ci_cmd} junit upload --service \"${DD_SERVICE}\" --max-concurrency 20 --verbose --tags git.repository_url:https://github.com/DataDog/dd-trace-php ${tags_args} ${xpath_tags_args} ${files_array[*]}"
216216

217217
if ! ${datadog_ci_cmd} junit upload --service "${DD_SERVICE}" --max-concurrency 20 --verbose --tags "git.repository_url:https://github.com/DataDog/dd-trace-php" ${tags_args} ${xpath_tags_args} "${files_array[@]}"; then
218-
echo "Warning: Failed to upload JUnit files" >&2
219-
exit 0
218+
echo "Error: Failed to upload JUnit files" >&2
219+
exit 1
220220
fi
221221

222222
echo "=== JUnit upload completed ==="

0 commit comments

Comments
 (0)