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