Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .gitlab/upload_ciapp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,20 @@ junit_upload() {
./results
}

# Upload code coverage results to Datadog
coverage_upload() {
DD_API_KEY=$1 \
[email protected]:DataDog/dd-trace-java.git \
datadog-ci coverage upload --ignored-paths=./test-published-dependencies .
}

# Upload test results to production environment like all other CI jobs
junit_upload "$DATADOG_API_KEY_PROD"
junit_upload_status=$?

coverage_upload "$DATADOG_API_KEY_PROD"
Copy link
Contributor

@PerfectSlayer PerfectSlayer Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the script return the result of both upload functions now? Not only the coverage one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't it just fail if any of the uploads fails?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, nevermind, I realised the default is to just continue executing if a command fails. Updated the script to consider both statuses

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

coverage_upload_status=$?

if [[ $junit_upload_status -ne 0 || $coverage_upload_status -ne 0 ]]; then
exit 1
fi