From 90e70f0c5ccd1b9dcd028f95aa8889528dd5c808 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Tue, 29 Jul 2025 15:00:01 +0200 Subject: [PATCH 1/5] Extract TEST_PHP_ARGS to env --- .github/workflows/tests.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bf4a8b3cf..d680db8fe 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -71,8 +71,9 @@ jobs: version: ${{ matrix.php-version }} - name: "Run Tests" - run: TEST_PHP_ARGS="-q -x --show-diff -g FAIL,XFAIL,BORK,WARN,LEAK,SKIP" make test + run: make test env: + TEST_PHP_ARGS: "-q -x --show-diff -g FAIL,XFAIL,BORK,WARN,LEAK,SKIP" MONGODB_URI: ${{ steps.setup-mongodb.outputs.cluster-uri }} pecl-test: @@ -176,6 +177,7 @@ jobs: topology: "server" - name: "Run Tests" - run: TEST_PHP_ARGS="-q -x --show-diff -g FAIL,XFAIL,BORK,WARN,LEAK,SKIP" make test + run: make test env: + TEST_PHP_ARGS: "-q -x --show-diff -g FAIL,XFAIL,BORK,WARN,LEAK,SKIP" MONGODB_URI: ${{ steps.setup-mongodb.outputs.cluster-uri }} From a94d3287cf6474716f20180d73cbe76302a640ef Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Tue, 29 Jul 2025 15:03:43 +0200 Subject: [PATCH 2/5] Upload GHA test reports to codecov.io --- .github/workflows/tests.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d680db8fe..0b612f55e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -74,8 +74,17 @@ jobs: run: make test env: TEST_PHP_ARGS: "-q -x --show-diff -g FAIL,XFAIL,BORK,WARN,LEAK,SKIP" + TEST_PHP_JUNIT: "test-results.xml" MONGODB_URI: ${{ steps.setup-mongodb.outputs.cluster-uri }} + - name: Upload test results to Codecov + uses: codecov/test-results-action@v1 + with: + disable_search: true + files: test-results.xml + flags: "${{ matrix.mongodb-version }}-${{ matrix.topology }}" + token: ${{ secrets.CODECOV_TOKEN }} + pecl-test: name: "Test PECL package" runs-on: "ubuntu-latest" @@ -180,4 +189,13 @@ jobs: run: make test env: TEST_PHP_ARGS: "-q -x --show-diff -g FAIL,XFAIL,BORK,WARN,LEAK,SKIP" + TEST_PHP_JUNIT: "test-results.xml" MONGODB_URI: ${{ steps.setup-mongodb.outputs.cluster-uri }} + + - name: Upload test results to Codecov + uses: codecov/test-results-action@v1 + with: + disable_search: true + files: test-results.xml + flags: "${{ ENV.SERVER_VERSION }}-server" + token: ${{ secrets.CODECOV_TOKEN }} From 1d5e62219ed55cdddeafbde601225dd83858a955 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Wed, 6 Aug 2025 16:06:53 +0200 Subject: [PATCH 3/5] Add server version and topology to expansion --- .evergreen/config/functions.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.evergreen/config/functions.yml b/.evergreen/config/functions.yml index e5a40634a..96383443a 100644 --- a/.evergreen/config/functions.yml +++ b/.evergreen/config/functions.yml @@ -176,6 +176,15 @@ functions: ${PREPARE_SHELL} SKIP_LEGACY_SHELL=true \ bash ${DRIVERS_TOOLS}/.evergreen/run-orchestration.sh + - command: shell.exec + params: + include_expansions_in_env: + - MONGODB_VERSION + - TOPOLOGY + 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: From 06b9957f606bc667480ccaa5f27e4c9bf2e2b74a Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Wed, 6 Aug 2025 16:06:57 +0200 Subject: [PATCH 4/5] Upload Evergreen test results to codecov.io --- .evergreen/config/functions.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.evergreen/config/functions.yml b/.evergreen/config/functions.yml index 96383443a..9130c8e32 100644 --- a/.evergreen/config/functions.yml +++ b/.evergreen/config/functions.yml @@ -159,6 +159,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} \ + --flag "${MONGODB_VERSION}-${TOPOLOGY}" \ + --file test-results.xml + else + echo "Skipping codecov test result upload" + fi "bootstrap mongo-orchestration": - command: shell.exec From 1e8d765f8a0aab7093c46e48756e0299ec9364fa Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Wed, 6 Aug 2025 16:19:19 +0200 Subject: [PATCH 5/5] Upload test results for Windows tests --- .github/workflows/windows-tests.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/windows-tests.yml b/.github/workflows/windows-tests.yml index 337c92042..675eacd91 100644 --- a/.github/workflows/windows-tests.yml +++ b/.github/workflows/windows-tests.yml @@ -95,5 +95,14 @@ jobs: NO_INTERACTION: 1 REPORT_EXIT_STATUS: 1 TESTS: --show-diff + TEST_PHP_JUNIT: "test-results.xml" MONGODB_URI: ${{ steps.setup-mongodb.outputs.cluster-uri }} CRYPT_SHARED_LIB_PATH: ${{ steps.setup-mongodb.outputs.crypt-shared-lib-path }} + + - name: Upload test results to Codecov + uses: codecov/test-results-action@v1 + with: + disable_search: true + files: test-results.xml + flags: "${{ matrix.mongodb-version }}-${{ matrix.topology }}" + token: ${{ secrets.CODECOV_TOKEN }}