Skip to content

Commit

Permalink
check.py for running avocado coverage.py
Browse files Browse the repository at this point in the history
The avocado was using `selftests/run` script for running coverage tests.
This script uses python unittests module instead of avocado, which has
few disadvantages. The main is that running the `selftests/run` differs
from running `check.py`, therefore the coverage report hasn't
represented the actual state.

After the latest changes in ea0e23d  and 4100cc2 it is possible to run
avocado's main selftests entry point `check.py` with the coverage.py.
With such change, the running coverage diagnose will use the same
process as our selftests, therefore the report will be more precise.

Reference: #4992
Signed-off-by: Jan Richter <[email protected]>
  • Loading branch information
richtja committed May 31, 2024
1 parent 02d642e commit 9fd2684
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[run]
source = avocado/, optional_plugins/
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ jobs:
- name: Run pre script
run: ./cc-test-reporter before-build
- name: Run script
run: make develop && ./selftests/run_coverage
run: |
python setup.py develop --user
./selftests/run_coverage
- name: Run post script
run: ./cc-test-reporter after-build
- run: echo "🥑 This job's status is ${{ job.status }}."
Expand Down
4 changes: 2 additions & 2 deletions selftests/run_coverage
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ echo "Using coverage utility: $COVERAGE"

$COVERAGE erase
rm -f .coverage.*
RUNNING_COVERAGE=1 AVOCADO_CHECK_LEVEL=1 UNITTEST_AVOCADO_CMD="$COVERAGE run -p --include 'avocado/*,optional_plugins/*' $PYTHON -m avocado" $COVERAGE run -p --include "avocado/*,optional_plugins/*" ./selftests/run
$COVERAGE combine .coverage*
$COVERAGE run selftests/check.py --skip=static-checks
$COVERAGE combine
echo
$COVERAGE report -m --include "avocado/core/*"
echo
Expand Down

0 comments on commit 9fd2684

Please sign in to comment.