From fc5b1666a13e3766fde53df5847054c7947247fe Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Thu, 24 Jul 2025 12:43:53 +0200 Subject: [PATCH 1/5] Upload test result report to codecov.io from Evergreen --- .evergreen/config/functions.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.evergreen/config/functions.yml b/.evergreen/config/functions.yml index 470f7dc8e..5503c2a19 100644 --- a/.evergreen/config/functions.yml +++ b/.evergreen/config/functions.yml @@ -126,6 +126,21 @@ functions: - command: attach.results params: file_location: "${DRIVERS_TOOLS}/results.json" + - command: shell.exec + params: + working_dir: src + script: | + ${PREPARE_SHELL} + curl -Os https://cli.codecov.io/latest/linux/codecov + sudo chmod +x codecov + [[ -f test-results.xml ]] && \ + ./codecov upload-process \ + --report-type test_results \ + --disable-search \ + --fail-on-error \ + --token ${CODECOV_TOKEN} \ + --file test-results.xml || \ + echo "Skipping codecov test result upload due to error" "bootstrap mongo-orchestration": - command: shell.exec From 2ad877bb9b406aa146b976c55fd874cdea890113 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Thu, 24 Jul 2025 12:45:41 +0200 Subject: [PATCH 2/5] Write server version and topology to expansion file --- .evergreen/config/functions.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.evergreen/config/functions.yml b/.evergreen/config/functions.yml index 5503c2a19..b88fd03b5 100644 --- a/.evergreen/config/functions.yml +++ b/.evergreen/config/functions.yml @@ -158,6 +158,13 @@ functions: LOAD_BALANCER=${LOAD_BALANCER} \ REQUIRE_API_VERSION=${REQUIRE_API_VERSION} \ bash ${DRIVERS_TOOLS}/.evergreen/run-orchestration.sh + - command: shell.exec + params: + script: | + printf "\n" >> mo-expansion.yml + printf "MONGODB_VERSION: '%s'\n" "${MONGODB_VERSION}" >> mo-expansion.yml + printf "TOPOLOGY: '%s'\n" "${TOPOLOGY}" >> mo-expansion.yml + cat mo-expansion.yml # run-orchestration generates expansion file with MONGODB_URI and CRYPT_SHARED_LIB_PATH - command: expansions.update params: From 9ad2fff585e6c21165a8dc6d4bb896ff9f590f6d Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Thu, 24 Jul 2025 12:46:20 +0200 Subject: [PATCH 3/5] Add version/topology flag to test result upload --- .evergreen/config/functions.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.evergreen/config/functions.yml b/.evergreen/config/functions.yml index b88fd03b5..166696388 100644 --- a/.evergreen/config/functions.yml +++ b/.evergreen/config/functions.yml @@ -139,6 +139,7 @@ functions: --disable-search \ --fail-on-error \ --token ${CODECOV_TOKEN} \ + --flag "${MONGODB_VERSION}-${TOPOLOGY}" \ --file test-results.xml || \ echo "Skipping codecov test result upload due to error" From d303ffb1280e7f5420da23567f29cd2a5c631887 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Mon, 28 Jul 2025 11:28:22 +0200 Subject: [PATCH 4/5] Download checksum for binary --- .evergreen/config/functions.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.evergreen/config/functions.yml b/.evergreen/config/functions.yml index 166696388..f260275f5 100644 --- a/.evergreen/config/functions.yml +++ b/.evergreen/config/functions.yml @@ -132,6 +132,8 @@ functions: script: | ${PREPARE_SHELL} curl -Os https://cli.codecov.io/latest/linux/codecov + curl -Os https://cli.codecov.io/latest/linux/codecov.SHA256SUM + shasum -a 256 -c codecov.SHA256SUM sudo chmod +x codecov [[ -f test-results.xml ]] && \ ./codecov upload-process \ From 89b21277bb5930fb05768d285a7ede5c421297e2 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Mon, 28 Jul 2025 11:34:53 +0200 Subject: [PATCH 5/5] Use conditional when calling codecov --- .evergreen/config/functions.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.evergreen/config/functions.yml b/.evergreen/config/functions.yml index f260275f5..636ead815 100644 --- a/.evergreen/config/functions.yml +++ b/.evergreen/config/functions.yml @@ -131,19 +131,21 @@ functions: working_dir: src script: | ${PREPARE_SHELL} - curl -Os https://cli.codecov.io/latest/linux/codecov - curl -Os https://cli.codecov.io/latest/linux/codecov.SHA256SUM - shasum -a 256 -c codecov.SHA256SUM - sudo chmod +x codecov - [[ -f test-results.xml ]] && \ + if [ -f test-results.xml ]; then + curl -Os https://cli.codecov.io/latest/linux/codecov + curl -Os https://cli.codecov.io/latest/linux/codecov.SHA256SUM + shasum -a 256 -c codecov.SHA256SUM + sudo chmod +x codecov ./codecov upload-process \ --report-type test_results \ --disable-search \ --fail-on-error \ --token ${CODECOV_TOKEN} \ --flag "${MONGODB_VERSION}-${TOPOLOGY}" \ - --file test-results.xml || \ - echo "Skipping codecov test result upload due to error" + --file test-results.xml + else + echo "Skipping codecov test result upload" + fi "bootstrap mongo-orchestration": - command: shell.exec @@ -167,7 +169,6 @@ functions: printf "\n" >> mo-expansion.yml printf "MONGODB_VERSION: '%s'\n" "${MONGODB_VERSION}" >> mo-expansion.yml printf "TOPOLOGY: '%s'\n" "${TOPOLOGY}" >> mo-expansion.yml - cat mo-expansion.yml # run-orchestration generates expansion file with MONGODB_URI and CRYPT_SHARED_LIB_PATH - command: expansions.update params: