Fix import failures on coverage runs.

The tempest_coverage.py script can't import from tempest because it
is located in the tools directory. This change runs python with '-m'
to add the tempest directory to PYTHONPATH.

Change-Id: I709474b97f2bf6d161bc063751874ca8054aa2ed
This commit is contained in:
Matthew Treinish
2013-01-11 15:45:58 -05:00
parent 0f8952b5e3
commit 19a395f235

View File

@@ -170,7 +170,7 @@ if [ "$DEVSTACK_GATE_TEMPEST" -eq "1" ]; then
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
sudo -H -u stack python -m tools/tempest_coverage -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
@@ -181,7 +181,7 @@ if [ "$DEVSTACK_GATE_TEMPEST" -eq "1" ]; then
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
sudo -H -u stack python -m tools/tempest_coverage -c report --html -o $COVERAGE_OUT
fi
else
# Jenkins expects at least one nosetests file. If we're not running