From 3e341a9941607a404ce5219292464c423a3fa5fe Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Tue, 12 Sep 2017 12:27:28 -0600 Subject: [PATCH] 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 --- .gitignore | 1 + .stestr.conf | 3 +++ neutron/tests/contrib/post_test_hook.sh | 10 +++++----- run_tests.sh | 4 ++-- test-requirements.txt | 1 - 5 files changed, 11 insertions(+), 8 deletions(-) create mode 100644 .stestr.conf diff --git a/.gitignore b/.gitignore index cea9c159619..b98e075dab3 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ setuptools*.egg/ !/.gitreview !/.mailmap !/.pylintrc +!/.stestr.conf !/.testr.conf # Files created by releasenotes build diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 00000000000..93499bb61d3 --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=${OS_TEST_PATH:-./neutron/tests/unit} +top_dir=./ diff --git a/neutron/tests/contrib/post_test_hook.sh b/neutron/tests/contrib/post_test_hook.sh index 500ae067813..58cbf8bd138 100644 --- a/neutron/tests/contrib/post_test_hook.sh +++ b/neutron/tests/contrib/post_test_hook.sh @@ -10,11 +10,11 @@ venv=${1:-"dsvm-functional"} 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 diff --git a/run_tests.sh b/run_tests.sh index a2d29292a2d..007080d60af 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -168,9 +168,9 @@ function run_tests { } function copy_subunit_log { - LOGNAME=`cat .testrepository/next-stream` + LOGNAME=`cat .stestr/next-stream` LOGNAME=$(($LOGNAME - 1)) - LOGNAME=".testrepository/${LOGNAME}" + LOGNAME=".stestr/${LOGNAME}" cp $LOGNAME subunit.log } diff --git a/test-requirements.txt b/test-requirements.txt index 2aa623f0a9f..194cfb52033 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -12,7 +12,6 @@ python-subunit>=0.0.18 # Apache-2.0/BSD sphinx>=1.6.2 # BSD openstackdocstheme>=1.16.0 # Apache-2.0 oslosphinx>=4.7.0 # Apache-2.0 -testrepository>=0.0.18 # Apache-2.0/BSD testtools>=1.4.0 # MIT testresources>=0.2.4 # Apache-2.0/BSD testscenarios>=0.4 # Apache-2.0/BSD