Skip to content

Commit 89b2127

Browse files
committed
Use conditional when calling codecov
1 parent d303ffb commit 89b2127

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

.evergreen/config/functions.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,19 +131,21 @@ functions:
131131
working_dir: src
132132
script: |
133133
${PREPARE_SHELL}
134-
curl -Os https://cli.codecov.io/latest/linux/codecov
135-
curl -Os https://cli.codecov.io/latest/linux/codecov.SHA256SUM
136-
shasum -a 256 -c codecov.SHA256SUM
137-
sudo chmod +x codecov
138-
[[ -f test-results.xml ]] && \
134+
if [ -f test-results.xml ]; then
135+
curl -Os https://cli.codecov.io/latest/linux/codecov
136+
curl -Os https://cli.codecov.io/latest/linux/codecov.SHA256SUM
137+
shasum -a 256 -c codecov.SHA256SUM
138+
sudo chmod +x codecov
139139
./codecov upload-process \
140140
--report-type test_results \
141141
--disable-search \
142142
--fail-on-error \
143143
--token ${CODECOV_TOKEN} \
144144
--flag "${MONGODB_VERSION}-${TOPOLOGY}" \
145-
--file test-results.xml || \
146-
echo "Skipping codecov test result upload due to error"
145+
--file test-results.xml
146+
else
147+
echo "Skipping codecov test result upload"
148+
fi
147149
148150
"bootstrap mongo-orchestration":
149151
- command: shell.exec
@@ -167,7 +169,6 @@ functions:
167169
printf "\n" >> mo-expansion.yml
168170
printf "MONGODB_VERSION: '%s'\n" "${MONGODB_VERSION}" >> mo-expansion.yml
169171
printf "TOPOLOGY: '%s'\n" "${TOPOLOGY}" >> mo-expansion.yml
170-
cat mo-expansion.yml
171172
# run-orchestration generates expansion file with MONGODB_URI and CRYPT_SHARED_LIB_PATH
172173
- command: expansions.update
173174
params:

0 commit comments

Comments
 (0)