Fix results capturing for the dummy driver

Tempest moved to running under stestr from
testr [1] and the subunit2html installation
has been altered as well [2].

[1] https://review.openstack.org/#/c/504345/
[2] https://review.openstack.org/#/c/534431/

Change-Id: I615fa6d4362f83f35e40a750bfcb3a96cc193f35
This commit is contained in:
Goutham Pacha Ravi 2018-07-11 12:56:10 -07:00
parent 5a33801059
commit fb26e5211b

View File

@ -92,20 +92,19 @@ function save_tempest_results {
archive_file $src_dirname/tempest.txt archive_file $src_dirname/tempest.txt
sudo mv $src_dirname/tempest.txt.gz $dst_dirname/tempest.txt.gz sudo mv $src_dirname/tempest.txt.gz $dst_dirname/tempest.txt.gz
# 4. Save tempest testr results # 4. Save tempest stestr results
# Check for an interrupted run first if [ -f $src_dirname/.stestr/0 ]; then
if [ -f $src_dirname/.testrepository/tmp* ]; then
sudo cat $src_dirname/.testrepository/tmp* >> $src_dirname/tempest.subunit
elif [ -f $src_dirname/.testrepository/0 ]; then
pushd $src_dirname pushd $src_dirname
sudo testr last --subunit > $src_dirname/tempest.subunit sudo stestr last --subunit > $src_dirname/tempest.subunit
popd popd
else
echo "Tests have not run!"
fi fi
if [ -f $src_dirname/tempest.subunit ]; then if [ -f $src_dirname/tempest.subunit ]; then
sudo /usr/os-testr-env/bin/subunit2html \ s2h=`type -p subunit2html`
$src_dirname/tempest.subunit $src_dirname/testr_results.html sudo $s2h $src_dirname/tempest.subunit $src_dirname/testr_results.html
archive_file $src_dirname/tempest.subunit archive_file $src_dirname/tempest.subunit
sudo mv $src_dirname/tempest.subunit.gz $dst_dirname/tempest.subunit.gz sudo mv $src_dirname/tempest.subunit.gz $dst_dirname/tempest.subunit.gz
@ -113,8 +112,8 @@ function save_tempest_results {
sudo mv $src_dirname/testr_results.html.gz $dst_dirname/testr_results.html.gz sudo mv $src_dirname/testr_results.html.gz $dst_dirname/testr_results.html.gz
# 5. Cleanup # 5. Cleanup
sudo rm -rf $src_dirname/.testrepository sudo rm -rf $src_dirname/.stestr
else else
echo "No 'testr' results available for saving. File '$src_dirname/tempest.subunit' is absent." echo "No 'stestr' results available for saving. File '$src_dirname/tempest.subunit' is absent."
fi fi
} }