Handle stestr execution for stackviz

This commit makes to handle a stestr execution for stackviz process.
Tempest is now in the process of switching the tempest run command to
use stestr internally instead of testrepository. This means that results
will be stored in .stestr instead of .testrepository. So, this commit
makes to handle a stestr or testrepository execution with checking which
directory exists before attempting to process the subunit results.

Change-Id: Ib19d3779deb89142e95762794dd1ce3fe3236b55
This commit is contained in:
Masayuki Igawa 2017-12-21 15:04:11 +09:00
parent b376f17652
commit cf8c872bb8
No known key found for this signature in database
GPG Key ID: 290F53EDC899BF89
1 changed files with 6 additions and 2 deletions

View File

@ -557,13 +557,17 @@ function process_stackviz {
cp -r $stackviz_path/share/stackviz-html $log_path/stackviz
pushd $project_path
TEST_CMD="testr"
if [ -d ".stestr" ]; then
TEST_CMD="stestr"
fi
if [ -f $log_path/dstat-csv_log.txt ]; then
sudo testr last --subunit | $stackviz_path/bin/stackviz-export \
sudo $TEST_CMD last --subunit | $stackviz_path/bin/stackviz-export \
--dstat $log_path/dstat-csv_log.txt \
--env --stdin \
$log_path/stackviz/data
else
sudo testr last --subunit | $stackviz_path/bin/stackviz-export \
sudo $TEST_CMD last --subunit | $stackviz_path/bin/stackviz-export \
--env --stdin \
$log_path/stackviz/data
fi