Skip to content
Snippets Groups Projects
Commit 577b170b authored by Iustin Pop's avatar Iustin Pop
Browse files

Fix coverage reports


Currently, the coverage reports include the unittests themselves, and
this skewes unfairly the reports, as the coverage for the tests is very
high (since they all run).

To fix this, we export the ganeti temp dir from run-in-temp-dir, and we
use that to exclude the tests directory. The patch also fixes a but
related to multiple directories to be omitted (--omit a --omit b is
wrong, it needs to be --omit a,b).

Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 2596526d
No related branches found
No related tags found
No related merge requests found
......@@ -24,10 +24,12 @@ set -e
: ${PYTHON:=python}
: ${COVERAGE_FILE:?}
: ${TEXT_COVERAGE:?}
: ${GANETI_TEMP_DIR:?}
omit=$($PYTHON -c 'import sys;
print " ".join(["--omit=%s/" % i for i in
set([sys.prefix, sys.exec_prefix])])')
omit=$($PYTHON -c 'import sys; import os;
print ",".join("%s/" % i for i in set([sys.prefix, sys.exec_prefix,
os.environ["GANETI_TEMP_DIR"] + "/test"]))')
omit="--omit=$omit"
$COVERAGE erase
......
......@@ -8,4 +8,4 @@ trap "rm -rf $tmpdir" EXIT
cp -r daemons scripts lib tools test $tmpdir
mv $tmpdir/lib $tmpdir/ganeti
cd $tmpdir && "$@"
cd $tmpdir && GANETI_TEMP_DIR="$tmpdir" "$@"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment