Add testr run and use subunit2html with testr
This commits adds a new run option DEVSTACK_GATE_TEMPEST_TESTR_FULL which is used to run the same tests as DEVSTACK_GATE_TEMPEST_FULL but using testr --parallel instead of nose. This is going to eventually be removed when using testr with tempest gets stable enough to gate projects. But for now it will be a separate option. This also adds support for running subunit2html on all testr runs to get pretty html output from the testr runs. Change-Id: I60e3ca48e8f4196503b09711997bd70e641bd16c
This commit is contained in:
committed by
Clark Boylan
parent
a18b0041d5
commit
67b1caa739
@@ -249,6 +249,16 @@ function cleanup_host {
|
||||
|
||||
sudo iptables-save > $WORKSPACE/logs/iptables.txt
|
||||
|
||||
#Copy and compress testr_results.
|
||||
if [ -f $BASE/new/tempest/testr_results.html ]; then
|
||||
sudo cp $BASE/new/tempest/testr_results.html $NEWLOGTARGET/
|
||||
sudo gzip -9 $NEWLOGTARGET/testr_results.html
|
||||
fi
|
||||
#Copy subunit log.
|
||||
if [ -f $BASE/new/tempest/subunit_log.txt ]; then
|
||||
sudo cp $BASE/new/tempest/subunit_log.txt $NEWLOGTARGET/
|
||||
fi
|
||||
|
||||
# Make sure jenkins can read all the logs
|
||||
sudo chown -R jenkins:jenkins $WORKSPACE/logs/
|
||||
sudo chmod a+r $WORKSPACE/logs/
|
||||
@@ -387,6 +397,9 @@ export DEVSTACK_GATE_VIRT_DRIVER=${DEVSTACK_GATE_VIRT_DRIVER:-libvirt}
|
||||
# is the project being gated.
|
||||
export DEVSTACK_GATE_TEMPEST_FULL=${DEVSTACK_GATE_TEMPEST_FULL:-0}
|
||||
|
||||
# Set to enable running full tempest with testr:
|
||||
export DEVSTACK_GATE_TEMPEST_TESTR_FULL=${DEVSTACK_GATE_TEMPEST_TESTR_FULL:-0}
|
||||
|
||||
# Set to 1 to run all tempest tests
|
||||
export DEVSTACK_GATE_TEMPEST_ALL=${DEVSTACK_GATE_TEMPEST_ALL:-0}
|
||||
|
||||
|
||||
@@ -252,6 +252,9 @@ if [ "$DEVSTACK_GATE_TEMPEST" -eq "1" ]; then
|
||||
elif [[ "$DEVSTACK_GATE_TEMPEST_FULL" -eq "1" ]]; then
|
||||
echo "Running tempest full test suite"
|
||||
sudo -H -u stack tox -efull
|
||||
elif [[ "$DEVSTACK_GATE_TEMPEST_TESTR_FULL" -eq "1" ]]; then
|
||||
echo "Running tempest full test suite with testr"
|
||||
sudo -H -u stack tox -etestr-full
|
||||
elif [[ "$DEVSTACK_GATE_TEMPEST_COVERAGE" -eq "1" ]] ; then
|
||||
echo "Generating coverage report"
|
||||
sudo -H -u stack tox -ecoverage -- -o $BASE/new/tempest/coverage-report
|
||||
@@ -262,6 +265,10 @@ if [ "$DEVSTACK_GATE_TEMPEST" -eq "1" ]; then
|
||||
echo "Running tempest smoke tests"
|
||||
sudo -H -u stack tox -esmoke
|
||||
fi
|
||||
if [ -f .testrepository/0 ]; then
|
||||
sudo -H -u stack cp .testrepository/0 subunit_log.txt
|
||||
sudo -H -u stack python /usr/local/jenkins/slave_scripts/subunit2html.py ./subunit_log.txt testr_results.html
|
||||
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