From 6756a82e1e66962978f5c3724a963a5c6db168c1 Mon Sep 17 00:00:00 2001 From: Boris Pavlovic Date: Thu, 23 Apr 2015 14:47:10 +0300 Subject: [PATCH] Fix coverage job to compare proper git diff and make it more strict Allow only 4 lines non covered by unit tets Currently we are testing patch against master, instead of HEAD^ which produce issue when checked commit is not after current rebase. master | patch1 | patch2 | old_master <- your_patch Proper way to check coverage is to do diff between your_patch and old_master instead of master. Change-Id: Ib0a177eafa9c7dcce799bde1c6b45d541fedde05 --- tests/ci/cover.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/ci/cover.sh b/tests/ci/cover.sh index e07b9682..8f97a490 100755 --- a/tests/ci/cover.sh +++ b/tests/ci/cover.sh @@ -15,7 +15,7 @@ # License for the specific language governing permissions and limitations # under the License. -ALLOWED_EXTRA_MISSING=8 +ALLOWED_EXTRA_MISSING=4 show_diff () { head -1 $1 @@ -25,7 +25,8 @@ show_diff () { # Stash uncommited changes, checkout master and save coverage report uncommited=$(git status --porcelain | grep -v "^??") [[ -n $uncommited ]] && git stash > /dev/null -git checkout master +git checkout HEAD^ + baseline_report=$(mktemp -t rally_coverageXXXXXXX) python setup.py testr --coverage --testr-args="$*" coverage report > $baseline_report