Improvement of cover script

*.pyc files break cover-script for situations like:
     some/module.py -> some.py

So we should remove all *.pyc files before launching `testr --coverage`

Change-Id: Ica22a3cd1a26d27c01f314a48a7cd49a529552eb
This commit is contained in:
Andrey Kurilin 2015-05-26 19:01:09 -07:00
parent aa2c43c90c
commit 3aaca2e339

View File

@ -28,7 +28,7 @@ uncommited=$(git status --porcelain | grep -v "^??")
git checkout HEAD^ git checkout HEAD^
baseline_report=$(mktemp -t rally_coverageXXXXXXX) baseline_report=$(mktemp -t rally_coverageXXXXXXX)
python setup.py testr --coverage --testr-args="$*" find . -type f -name "*.pyc" -delete && python setup.py testr --coverage --testr-args="$*"
coverage report > $baseline_report coverage report > $baseline_report
baseline_missing=$(awk 'END { print $3 }' $baseline_report) baseline_missing=$(awk 'END { print $3 }' $baseline_report)
@ -38,7 +38,7 @@ git checkout -
# Generate and save coverage report # Generate and save coverage report
current_report=$(mktemp -t rally_coverageXXXXXXX) current_report=$(mktemp -t rally_coverageXXXXXXX)
python setup.py testr --coverage --testr-args="$*" find . -type f -name "*.pyc" -delete && python setup.py testr --coverage --testr-args="$*"
coverage report > $current_report coverage report > $current_report
current_missing=$(awk 'END { print $3 }' $current_report) current_missing=$(awk 'END { print $3 }' $current_report)