Skip to content

Commit

Permalink
ci: coverage report generation should also include testing/src/scenar…
Browse files Browse the repository at this point in the history
…io (canonical#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).
  • Loading branch information
tonyandrewmeyer authored Nov 15, 2024
1 parent 46bdb40 commit 77b85ee
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/tiobe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ venv
.vscode
.coverage
coverage.xml
.coverage.data
/.tox
.*.swp

Expand Down
9 changes: 6 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ commands =

[testenv:coverage]
description = Run unit tests with coverage
allowlist_externals = mkdir
passenv =
RUN_REAL_PEBBLE_TESTS
PEBBLE
Expand All @@ -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
Expand Down

0 comments on commit 77b85ee

Please sign in to comment.