From a8bcb48a6661d8918a55997cc4d141c5fc5fea24 Mon Sep 17 00:00:00 2001 From: Radovan Zivkovic Date: Wed, 8 Jan 2025 12:19:41 +0100 Subject: [PATCH] Fix tests code coverage processing --- .github/workflows/continous-integration.yml | 33 ++++++++++----------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/.github/workflows/continous-integration.yml b/.github/workflows/continous-integration.yml index e08f22f7b65..8c77f670869 100644 --- a/.github/workflows/continous-integration.yml +++ b/.github/workflows/continous-integration.yml @@ -400,9 +400,9 @@ jobs: if: needs.changes.outputs.backend == 'true' && matrix.os == 'ubuntu-24.04' uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 #v4.4.3 with: - name: ${{ matrix.test }}-${{ matrix.python-version }}-${{ matrix.os }}-coverage + name: ${{ matrix.test }}-${{ matrix.python-version }}-${{ matrix.os }}.coverage path: | - ${{ github.workspace }}/${{ matrix.test }}-${{ matrix.python-version }}-${{ matrix.os }}-coverage + ${{ github.workspace }}/${{ matrix.test }}-coverage test-flaky: name: Run Flaky Tests @@ -553,11 +553,11 @@ jobs: - name: Store coverage reports if: needs.changes.outputs.backend == 'true' && matrix.os == 'ubuntu-24.04' - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 #v4.4.3 + uses: actions/upload-artifact@v4 with: - name: ${{ matrix.test }}-${{ matrix.python-version }}-${{ matrix.os }}-coverage + name: ${{ matrix.test }}-${{ matrix.python-version }}-${{ matrix.os }}.coverage path: | - ${{ github.workspace }}/${{ matrix.test }}-${{ matrix.python-version }}-${{ matrix.os }}-coverage + ${{ github.workspace }}/test-flaky-coverage upload_coverage_reports: name: Upload coverage reports to codeclimate @@ -566,6 +566,7 @@ jobs: # Always upload results even if tests failed needs: - test + - test-flaky - changes steps: @@ -580,25 +581,23 @@ jobs: - name: Get backend coverage reports if: needs.changes.outputs.backend == 'true' - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 #v4.1.8 + uses: actions/download-artifact@v4 #v4.1.8 with: path: ${{ github.workspace }}/tests_coverage + pattern: "*.coverage" + merge-multiple: true - - name: Merge all reports + - name: List all coverages if: needs.changes.outputs.backend == 'true' run: | - subs=`ls ${{ github.workspace }}/tests_coverage` - download_dir="${{ github.workspace }}/tests_coverage" - final_dir="${{ github.workspace }}/tests_coverage/final" - - # Downloaded artifacts go into folders, gotta extract them all into one folder for upload - mkdir "${final_dir}/" - for i in $subs; do - mv "${download_dir}/$i"/* "${final_dir}/" - done + ls -l ${{ github.workspace }} + ls -l ${{ github.workspace }}/tests_coverage + - name: Merge all reports + if: needs.changes.outputs.backend == 'true' + run: | pip install coverage - coverage combine "${final_dir}/"* + coverage combine ${{ github.workspace }}/tests_coverage/ coverage xml - name: Upload reports to codeclimate