From 2300dcb166c4dee97e5b79235a77a8e404788fb6 Mon Sep 17 00:00:00 2001 From: Olaf Haag <83961384+Olaf-Wolf3D@users.noreply.github.com> Date: Tue, 12 Dec 2023 14:27:52 +0100 Subject: [PATCH] fix/coverage-report (#10) * fix(tests): :wrench: omit tests in coverage, cover all files Do not show tests themselves in the coverage report. Show files that are not covered by tests at all. Task: TECHART-340 * ci(tests): :chart_with_upwards_trend: coverage html report add folder with HTML coverage reports to the artifact Task: TECHART-341 --- .github/workflows/test.yml | 12 +++++++++--- pyproject.toml | 4 ++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0595c2e..5eb19c6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -45,11 +45,17 @@ jobs: - name: Run tests run: hatch run test:cov - - name: Upload performance profiling artifact + - name: Prepare artifact + run: | + mkdir artifact + cp -r tests/.profiles artifact/.profiles + cp -r tests/.coverage artifact/.coverage + + - name: Upload performance & coverage report artifact uses: actions/upload-artifact@v3 with: - name: performance-profiling - path: tests/.profiles + name: coverage-profiling + path: artifact if-no-files-found: error - name: Run linting diff --git a/pyproject.toml b/pyproject.toml index 937a8c4..6f7ae0e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -79,6 +79,7 @@ test-cov = "coverage run -m pytest {args:tests}" cov-report = [ "- coverage combine", "coverage report", + "coverage html -d ./tests/.coverage", ] cov = [ "test-cov", @@ -265,7 +266,7 @@ module = "pyinstrument.*" ignore_missing_imports = true [tool.coverage.run] -source_pkgs = ["readyplayerme", "tests"] +source_pkgs = ["readyplayerme", "readyplayerme.meshops"] branch = true parallel = true omit = [ @@ -274,7 +275,6 @@ omit = [ [tool.coverage.paths] coverage_debugging = ["src/readyplayerme", "*/meshops/src/readyplayerme"] -tests = ["tests", "*/meshops/tests"] [tool.coverage.report] include_namespace_packages = true