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: Iead2b550fc2c3accf25e450db0eb0a56603fc571
Closes-Bug: #1716746
This commit is contained in:
Kien Nguyen 2017-09-15 13:33:00 +07:00
parent 531faa2d5b
commit 2490c368e3
5 changed files with 9 additions and 10 deletions

1
.gitignore vendored

@ -46,6 +46,7 @@ ChangeLog
!/.gitreview
!/.mailmap
!/.pylintrc
!/.stestr.conf
!/.testr.conf
contrib/vagrant/.vagrant

3
.stestr.conf Normal file

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

@ -1,4 +0,0 @@
[DEFAULT]
test_command=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 OS_LOG_CAPTURE=1 ${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./kuryr_libnetwork/tests/unit} $LISTOPT $IDOPTION | cat
test_id_option=--load-list $IDFILE
test_list_option=--list

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

@ -14,6 +14,5 @@ oslotest>=1.10.0 # Apache-2.0
python-subunit>=0.0.18 # Apache-2.0/BSD
reno>=2.5.0 # Apache-2.0
sphinx>=1.6.2 # BSD
testrepository>=0.0.18 # Apache-2.0/BSD
testscenarios>=0.4 # Apache-2.0/BSD
testtools>=1.4.0 # MIT