Skip to content

Commit

Permalink
automation: separate py2 and py3 coverage reports
Browse files Browse the repository at this point in the history
Per public request, this patch creates to different coverage reports,
for Python 2 and Python 3, when Python 3 is available (i.e. on Fedora).

Now it is easier to see that our coverage is 58% on py2, and only 49%
on py3.

Change-Id: I1a1c8c97f459cb90ae600a757d2d6ffe22c71e8c
Signed-off-by: Dan Kenigsberg <danken@redhat.com>
  • Loading branch information
dankenigsberg committed Apr 14, 2018
1 parent b2eb7eb commit 6b905c2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions automation/check-patch.packages.fc27
Expand Up @@ -33,6 +33,7 @@ python2-dateutil
python2-decorator
python2-pyudev
python3-augeas
python3-coverage
python3-dateutil
python3-dbus
python3-decorator
Expand Down
10 changes: 9 additions & 1 deletion automation/check-patch.sh
Expand Up @@ -24,8 +24,16 @@ TIMEOUT=600 make --jobs=2 check NOSE_WITH_COVERAGE=1 NOSE_COVER_PACKAGE="$PWD/vd

# Generate coverage report in HTML format
pushd tests
coverage combine -a .coverage-storage-py27 .coverage-network-py27
pwd
ls .cov*
coverage combine .coverage-nose-py2 .coverage-storage-py27 .coverage-network-py27 .coverage-virt-py27
coverage html -d "$EXPORT_DIR/htmlcov"

if grep -q 'Fedora' /etc/redhat-release; then
rm .coverage
coverage combine .coverage-nose-py3 .coverage-storage-py36 .coverage-network-py36 .coverage-virt-py36
coverage html -d "$EXPORT_DIR/htmlcov-py36"
fi
popd

# Export subsystem coverage reports for viewing in jenkins.
Expand Down
4 changes: 4 additions & 0 deletions tests/Makefile.am
Expand Up @@ -272,6 +272,9 @@ check:
@echo '=== Running tests. To skip this step place NOSE_EXCLUDE=.* ==='
@echo '=== into your environment. Do not submit untested code! ==='
$(top_srcdir)/tests/run_tests_local.sh $(run_modules)
pwd
ls .cov*
mv .coverage .coverage-nose-py2
if [ "$(PYTHON3_SUPPORT)" == "1" ]; then \
all_modules=`mktemp`; \
blacklist=`mktemp`; \
Expand All @@ -282,6 +285,7 @@ check:
rm -f "$$all_modules" "$$blacklist"; \
PYTHON_EXE="$(PYTHON3)" \
$(top_srcdir)/tests/run_tests_local.sh "$$modules"; \
mv .coverage .coverage-nose-py3; \
fi

# Disable builtin %.out rule, overrwriting out files
Expand Down

0 comments on commit 6b905c2

Please sign in to comment.