From 77b85ee2ce8e9319f89aef443c7337684f4fd21d Mon Sep 17 00:00:00 2001 From: Tony Meyer Date: Fri, 15 Nov 2024 15:39:38 +1300 Subject: [PATCH] ci: coverage report generation should also include testing/src/scenario (#1453) Include `testing/src/scenario/` in the coverage analysis. Additionally, move the (TIOBE required) repositioning of the coverage XML file into the tox command, since it's only used for TIOBE now, and this slightly simplifies the work (since we can use the `--data-file` and `-o` options for coverage). --- .github/workflows/tiobe.yaml | 4 ---- .gitignore | 1 + tox.ini | 9 ++++++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tiobe.yaml b/.github/workflows/tiobe.yaml index 6c79c229f..c03857372 100644 --- a/.github/workflows/tiobe.yaml +++ b/.github/workflows/tiobe.yaml @@ -19,10 +19,6 @@ jobs: - name: Generate coverage report run: | tox -e coverage - # Annoyingly, the coverage.xml file needs to be in a .coverage folder. - rm .coverage - mkdir .coverage - mv coverage.xml .coverage/ - name: TICS GitHub Action uses: tiobe/tics-github-action@v3 diff --git a/.gitignore b/.gitignore index 17446841b..167e84af0 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ venv .vscode .coverage coverage.xml +.coverage.data /.tox .*.swp diff --git a/tox.ini b/tox.ini index 947454c86..ef9ee7f90 100644 --- a/tox.ini +++ b/tox.ini @@ -107,6 +107,7 @@ commands = [testenv:coverage] description = Run unit tests with coverage +allowlist_externals = mkdir passenv = RUN_REAL_PEBBLE_TESTS PEBBLE @@ -120,10 +121,12 @@ deps = -e . -e testing commands = - coverage run --source={[vars]src_path} \ + mkdir -p .coverage + coverage run --source={[vars]src_path},testing/src/scenario \ + --data-file=.coverage.data \ -m pytest --ignore={[vars]tst_path}smoke -v --tb native {posargs} - coverage xml - coverage report + coverage xml --data-file=.coverage.data -o .coverage/coverage.xml + coverage report --data-file=.coverage.data [testenv:pebble] description = Run real pebble tests