Skip to content

Commit

Permalink
Add guard against trying to upload non-existant artifacts to GCS (#10677
Browse files Browse the repository at this point in the history
) (#18152)

[upstream:8ad7f68bd95f2633dbc7ce03ac52d74264157fcf]

Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician committed May 15, 2024
1 parent 22a1816 commit fb9ce6a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .teamcity/components/builds/build_steps.kt
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ fun BuildSteps.saveArtifactsToGCS() {
#!/bin/bash
echo "Post-test step - storge artifacts(debug logs) to GCS"
export TEST_COUNT=${'$'}(./test-binary -test.list="%TEST_PREFIX%" | wc -l)
if test ${'$'}TEST_COUNT -le "0"; then
echo "Skipping upload to GCS; no tests were run, so no artifacts were generated"
exit 0
fi
# Authenticate gcloud CLI
echo "${'$'}{GOOGLE_CREDENTIALS_GCS}" > google-account.json
chmod 600 google-account.json
Expand Down

0 comments on commit fb9ce6a

Please sign in to comment.