Skip to content

Commit 888d383

Browse files
authored
Upload evergreen test results to codecov.io (#1736)
* Upload test result report to codecov.io from Evergreen * Write server version and topology to expansion file * Add version/topology flag to test result upload * Download checksum for binary * Use conditional when calling codecov
1 parent 5de0a58 commit 888d383

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.evergreen/config/functions.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,26 @@ functions:
126126
- command: attach.results
127127
params:
128128
file_location: "${DRIVERS_TOOLS}/results.json"
129+
- command: shell.exec
130+
params:
131+
working_dir: src
132+
script: |
133+
${PREPARE_SHELL}
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
139+
./codecov upload-process \
140+
--report-type test_results \
141+
--disable-search \
142+
--fail-on-error \
143+
--token ${CODECOV_TOKEN} \
144+
--flag "${MONGODB_VERSION}-${TOPOLOGY}" \
145+
--file test-results.xml
146+
else
147+
echo "Skipping codecov test result upload"
148+
fi
129149
130150
"bootstrap mongo-orchestration":
131151
- command: shell.exec
@@ -143,6 +163,12 @@ functions:
143163
LOAD_BALANCER=${LOAD_BALANCER} \
144164
REQUIRE_API_VERSION=${REQUIRE_API_VERSION} \
145165
bash ${DRIVERS_TOOLS}/.evergreen/run-orchestration.sh
166+
- command: shell.exec
167+
params:
168+
script: |
169+
printf "\n" >> mo-expansion.yml
170+
printf "MONGODB_VERSION: '%s'\n" "${MONGODB_VERSION}" >> mo-expansion.yml
171+
printf "TOPOLOGY: '%s'\n" "${TOPOLOGY}" >> mo-expansion.yml
146172
# run-orchestration generates expansion file with MONGODB_URI and CRYPT_SHARED_LIB_PATH
147173
- command: expansions.update
148174
params:

0 commit comments

Comments
 (0)