Fix post gate hook to accommodate for new os-testr

New os-testr uses stestr under the hood, which creates .stestr but not
.testrepository directory in the current dir. Other than that, it
doesn't seem like there is any difference in the format or names of
files generated in the directory.

Change-Id: I82d52bf0ad885bd36d2f0782a7c86ac61df532f2
Closes-Bug: #1716746
This commit is contained in:
Ihar Hrachyshka 2017-09-12 12:27:28 -06:00
parent 863fb129f9
commit 3e341a9941
5 changed files with 11 additions and 8 deletions

1
.gitignore vendored
View File

@ -26,6 +26,7 @@ setuptools*.egg/
!/.gitreview !/.gitreview
!/.mailmap !/.mailmap
!/.pylintrc !/.pylintrc
!/.stestr.conf
!/.testr.conf !/.testr.conf
# Files created by releasenotes build # Files created by releasenotes build

3
.stestr.conf Normal file
View File

@ -0,0 +1,3 @@
[DEFAULT]
test_path=${OS_TEST_PATH:-./neutron/tests/unit}
top_dir=./

View File

@ -10,11 +10,11 @@ venv=${1:-"dsvm-functional"}
function generate_testr_results { function generate_testr_results {
# Give job user rights to access tox logs # Give job user rights to access tox logs
sudo -H -u $owner chmod o+rw . sudo -H -u $owner chmod o+rw .
sudo -H -u $owner chmod o+rw -R .testrepository sudo -H -u $owner chmod o+rw -R .stestr
if [ -f ".testrepository/0" ] ; then if [ -f ".stestr/0" ] ; then
.tox/$venv/bin/subunit-1to2 < .testrepository/0 > ./testrepository.subunit .tox/$venv/bin/subunit-1to2 < .stestr/0 > ./stestr.subunit
$SCRIPTS_DIR/subunit2html ./testrepository.subunit testr_results.html $SCRIPTS_DIR/subunit2html ./stestr.subunit testr_results.html
gzip -9 ./testrepository.subunit gzip -9 ./stestr.subunit
gzip -9 ./testr_results.html gzip -9 ./testr_results.html
sudo mv ./*.gz /opt/stack/logs/ sudo mv ./*.gz /opt/stack/logs/
fi fi

View File

@ -168,9 +168,9 @@ function run_tests {
} }
function copy_subunit_log { function copy_subunit_log {
LOGNAME=`cat .testrepository/next-stream` LOGNAME=`cat .stestr/next-stream`
LOGNAME=$(($LOGNAME - 1)) LOGNAME=$(($LOGNAME - 1))
LOGNAME=".testrepository/${LOGNAME}" LOGNAME=".stestr/${LOGNAME}"
cp $LOGNAME subunit.log cp $LOGNAME subunit.log
} }

View File

@ -12,7 +12,6 @@ python-subunit>=0.0.18 # Apache-2.0/BSD
sphinx>=1.6.2 # BSD sphinx>=1.6.2 # BSD
openstackdocstheme>=1.16.0 # Apache-2.0 openstackdocstheme>=1.16.0 # Apache-2.0
oslosphinx>=4.7.0 # Apache-2.0 oslosphinx>=4.7.0 # Apache-2.0
testrepository>=0.0.18 # Apache-2.0/BSD
testtools>=1.4.0 # MIT testtools>=1.4.0 # MIT
testresources>=0.2.4 # Apache-2.0/BSD testresources>=0.2.4 # Apache-2.0/BSD
testscenarios>=0.4 # Apache-2.0/BSD testscenarios>=0.4 # Apache-2.0/BSD