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
This commit is contained in:
@@ -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=$?
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user