diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 10a3969c4..efa6b791d 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -64,7 +64,7 @@ jobs: - name: 'Run unit tests' id: runtests run: | - coverage run -m pytest --doctest-modules --doctest-continue-on-failure test/ + coverage run -m pytest --doctest-modules --doctest-continue-on-failure test/ --junitxml=test-execution.xml rc=$? coverage xml @@ -77,11 +77,17 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} - name: 'Save coverage report as an Artifact' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: coverage-report path: ./coverage.xml + - name: 'Save execution report as an Artifact' + uses: actions/upload-artifact@v4 + with: + name: execution-report + path: ./test-execution.xml + - name: 'build web front-end' run: | set -eo pipefail @@ -121,19 +127,16 @@ jobs: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis # Download the coverage report artifact - - name: 'Download coverage report' - uses: actions/download-artifact@v3 + - name: 'Download coverage and execution report' + uses: actions/download-artifact@v4 with: - name: coverage-report + pattern: '*-report' # Perform the SonarQube scan - uses: sonarsource/sonarqube-scan-action@master env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} - with: - args: | - -Dsonar.python.coverage.reportPaths=coverage.xml # Optional: Fail the job if Quality Gate is red # If you wish to fail your job when the Quality Gate is red, uncomment the diff --git a/.gitignore b/.gitignore index 8cd604add..1d5308de5 100644 --- a/.gitignore +++ b/.gitignore @@ -37,6 +37,7 @@ build/ test/*.sh .coverage coverage.xml +test-execution.xml temp.json data-dump.sql local.py @@ -64,3 +65,6 @@ Pulumi*.yaml # performance profile files profiles + +# sonarqube +.scannerwork/ diff --git a/sonar-project.properties b/sonar-project.properties index e7503e304..ac1155b68 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,2 +1,4 @@ sonar.projectKey=populationgenomics_metamist_AZHVO0XpdaNSak8FrtKn -sonar.python.version=3 +sonar.python.version=3.11 +sonar.python.coverage.reportPaths=coverage.xml +sonar.python.xunit.reportPath=test-execution.xml