From a3699c68f914ad6553ff9ff0634f22ea41e646c9 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Tue, 18 Dec 2012 14:40:02 -0500 Subject: [PATCH] Add support for generating coverage reports from tempest. This adds support for tempest to generate coverage reports in nova using the coverage extension. Change-Id: I76f9f3109fbd8005fe3157f4b95f1dd036877613 --- devstack-vm-gate-wrap.sh | 5 +++++ devstack-vm-gate.sh | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/devstack-vm-gate-wrap.sh b/devstack-vm-gate-wrap.sh index 4b48b205..4d169f4a 100755 --- a/devstack-vm-gate-wrap.sh +++ b/devstack-vm-gate-wrap.sh @@ -27,6 +27,9 @@ export DEVSTACK_GATE_TEMPEST=${DEVSTACK_GATE_TEMPEST:-0} # Set to 1 to run postgresql instead of mysql export DEVSTACK_GATE_POSTGRES=${DEVSTACK_GATE_POSTGRES:-0} +# Set to 1 to run nova coverage with Tempest +export DEVSTACK_GATE_TEMPEST_COVERAGE=${DEVSTACK_GATE_TEMPEST_COVERAGE:-0} + # Set to 1 to run cinder instead of nova volume # Only applicable to stable/folsom branch export DEVSTACK_GATE_CINDER=${DEVSTACK_GATE_CINDER:-0} @@ -314,6 +317,8 @@ if [[ $ZUUL_PROJECT == "openstack/tempest" ]]; then export DEVSTACK_GATE_TEMPEST_FULL=1 fi +export COVERAGE_OUT=$WORKSPACE/logs/coverage-report + # Run the test $GATE_SCRIPT_DIR/devstack-vm-gate.sh RETVAL=$? diff --git a/devstack-vm-gate.sh b/devstack-vm-gate.sh index 1beb53b2..31c7b209 100755 --- a/devstack-vm-gate.sh +++ b/devstack-vm-gate.sh @@ -163,6 +163,10 @@ if [ "$DEVSTACK_GATE_TEMPEST" -eq "1" ]; then sudo -H -u stack ./tools/configure_tempest.sh fi cd $BASE/new/tempest + if [[ "$DEVSTACK_GATE_TEMPEST_COVERAGE" -eq "1" ]] ; then + echo "Starting coverage data collection" + sudo -H -u stack python tools/tempest_coverage.py -c start --combine + fi echo "Running tempest smoke tests" sudo -H -u stack NOSE_XUNIT_FILE=nosetests-smoke.xml nosetests --with-xunit -sv --attr=type=smoke tempest RETVAL=$? @@ -170,6 +174,10 @@ if [ "$DEVSTACK_GATE_TEMPEST" -eq "1" ]; then echo "Running tempest full test suite" sudo -H -u stack NOSE_XUNIT_FILE=nosetests-full.xml nosetests --with-xunit -sv -a '!smoke' tempest fi + if [[ "$DEVSTACK_GATE_TEMPEST_COVERAGE" -eq "1" ]] ; then + echo "Generating coverage report" + sudo -H -u stack python tools/tempest_coverage.py -c report --html -o $COVERAGE_OUT + fi else # Jenkins expects at least one nosetests file. If we're not running # tempest, then write a fake one that indicates the tests pass (since