fix cover.sh to allow db version changes without ut
When db version changes, a new file will be added. But there is no unit tests for the file, such as "1afee1db6cd0_add_master_flavor.py". Then the command "tox -e cover" will fail. The change to fix it. Change-Id: I16b2f489001707ede067251549a0a78935e49cbb
This commit is contained in:
committed by
feng.shengqin@zte.com.cn
parent
68af88a737
commit
2d9a5008ba
4
cover.sh
4
cover.sh
@@ -29,6 +29,7 @@ fi
|
||||
# Checkout master and save coverage report
|
||||
git checkout HEAD^
|
||||
|
||||
base_op_count=`grep "op\." -R magnum/db/sqlalchemy/alembic/versions/ | wc -l`
|
||||
baseline_report=$(mktemp -t magnum_coverageXXXXXXX)
|
||||
find . -type f -name "*.pyc" -delete && python setup.py testr --coverage --testr-args="$*"
|
||||
coverage report > $baseline_report
|
||||
@@ -39,13 +40,14 @@ baseline_missing=$(awk 'END { print $3 }' $baseline_report)
|
||||
# Checkout back and save coverage report
|
||||
git checkout -
|
||||
|
||||
current_op_count=`grep "op\." -R magnum/db/sqlalchemy/alembic/versions/ | wc -l`
|
||||
current_report=$(mktemp -t magnum_coverageXXXXXXX)
|
||||
find . -type f -name "*.pyc" -delete && python setup.py testr --coverage --testr-args="$*"
|
||||
coverage report > $current_report
|
||||
current_missing=$(awk 'END { print $3 }' $current_report)
|
||||
|
||||
# Show coverage details
|
||||
allowed_missing=$((baseline_missing+ALLOWED_EXTRA_MISSING))
|
||||
allowed_missing=$((baseline_missing+ALLOWED_EXTRA_MISSING+current_op_count-base_op_count))
|
||||
|
||||
echo "Allowed to introduce missing lines : ${ALLOWED_EXTRA_MISSING}"
|
||||
echo "Missing lines in master : ${baseline_missing}"
|
||||
|
||||
Reference in New Issue
Block a user