Skip to content

Upload evergreen test results to codecov.io #1736

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: v2.x
Choose a base branch
from
Open
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
26 changes: 26 additions & 0 deletions .evergreen/config/functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,26 @@ functions:
- command: attach.results
params:
file_location: "${DRIVERS_TOOLS}/results.json"
- command: shell.exec
params:
working_dir: src
script: |
${PREPARE_SHELL}
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} \
Copy link
Member

Choose a reason for hiding this comment

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

Does this reference a variable from the Evergreen project config? I didn't see this when taking a look at the PHPLIB 2.x project settings.

Copy link
Member Author

Choose a reason for hiding this comment

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

For some reason uploading the test result file worked even without a token. I have added it to the repo variables nonetheless.

--flag "${MONGODB_VERSION}-${TOPOLOGY}" \
--file test-results.xml
else
echo "Skipping codecov test result upload"
fi

"bootstrap mongo-orchestration":
- command: shell.exec
Expand All @@ -143,6 +163,12 @@ 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
# run-orchestration generates expansion file with MONGODB_URI and CRYPT_SHARED_LIB_PATH
- command: expansions.update
params:
Expand Down