diff --git a/.coveragerc b/.coveragerc index 6532daacf..61919d5bb 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,5 +1,6 @@ [run] branch = True +parallel = True concurrency = multiprocessing data_file = .coverage source = src diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b2ba9af96..d06ac432e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,6 +22,8 @@ jobs: test: runs-on: scilus-large if: github.repository == 'scilus/scilpy' + env: + COVERAGE_PROCESS_START: .coveragerc steps: - name: Checkout repository at merge @@ -69,20 +71,23 @@ jobs: # https://discourse.vtk.org/t/status-update-runtime-opengl-render-window-selection-in-vtk/14583 VTK_VERSION=$(cat pyproject.toml | grep 'vtk==' | sed 's/vtk==//g' | sed 's/\"//g' ) pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==$VTK_VERSION - uv pip install pytest-xdist pytest-cov + uv pip install pytest-xdist coverage scil_data_download scil_search_keywords test --regenerate_help_files --processes 8 - name: Run unit tests run: | - uv run --active pytest src/scilpy --cov-report term-missing:skip-covered --dist=loadgroup --ignore=src/scilpy/cli - mv .test_reports unit_test_reports + uv run --active coverage run -m pytest src/scilpy --dist=loadgroup --ignore=src/scilpy/cli + uv run --active coverage combine + uv run --active coverage xml -o unit_test_reports/coverage.xml + mv .coverage coverage.unit - name: Run smoke tests run: | - uv run --active pytest src/scilpy/cli --cov-report term-missing:skip-covered --dist=loadgroup + uv run --active coverage run -m pytest src/scilpy/cli --dist=loadgroup + uv run --active coverage combine + uv run --active coverage xml -o smoke_test_reports/coverage.xml mv .coverage .coverage.smoke - mv .test_reports smoke_test_reports - name: Save test results and coverage uses: actions/upload-artifact@v4 @@ -109,7 +114,7 @@ jobs: with: name: test-coverage-${{ github.run_id }} - - name: Upload coverage reports to Codecov + - name: Upload unit test coverage reports to Codecov uses: codecov/codecov-action@v5.4.3 with: token: ${{ secrets.CODECOV_TOKEN }} @@ -120,7 +125,7 @@ jobs: verbose: true fail_ci_if_error: true - - name: Upload coverage reports to Codecov + - name: Upload smoke test coverage reports to Codecov uses: codecov/codecov-action@v5.4.3 with: token: ${{ secrets.CODECOV_TOKEN }}