From 8f381e8d3945d7750dc994595ee42fa47e03cde7 Mon Sep 17 00:00:00 2001 From: Adam Harwell Date: Tue, 12 Sep 2017 13:56:02 -0600 Subject: [PATCH] Gatefix: Migrate from testr to stestr Change-Id: I7339874be54b29a7eba9933c534445899b6fb8c1 --- .gitignore | 1 + .stestr.conf | 3 +++ octavia/tests/contrib/post_test_hook.sh | 22 +++++++++------------- tox.ini | 1 - 4 files changed, 13 insertions(+), 14 deletions(-) create mode 100644 .stestr.conf diff --git a/.gitignore b/.gitignore index 7bc5d94581..b0ea5c736e 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ setuptools*.egg/ subunit.log tempest.log .testrepository +.stestr .tox/ .venv/ *.mo diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 0000000000..75ac582e74 --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=${OS_TEST_PATH:-./octavia/tests/unit} +top_dir=./ diff --git a/octavia/tests/contrib/post_test_hook.sh b/octavia/tests/contrib/post_test_hook.sh index 6fcb0a8ce9..9ed6764464 100755 --- a/octavia/tests/contrib/post_test_hook.sh +++ b/octavia/tests/contrib/post_test_hook.sh @@ -45,19 +45,15 @@ fi 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 - # Archive the raw testrepository file to debug subunit-1to2 - # ValueError: Length too long: 7341892 errors - cp .testrepository/0 ./testrepository.0 - gzip -9 ./testrepository.0 - sudo mv testrepository.0.gz /opt/stack/logs/ - - .tox/"$testenv"/bin/subunit-1to2 < .testrepository/0 > ./testrepository.subunit - $SCRIPTS_DIR/subunit2html ./testrepository.subunit testr_results.html - gzip -9 ./testrepository.subunit - gzip -9 ./testr_results.html - sudo mv ./*.gz /opt/stack/logs/ + if [ -d ".stestr" ] ; then + sudo -H -u "$owner" chmod o+rw -R .stestr + if [ -f ".stestr/0" ] ; then + stestr last --subunit > ./testrepository.subunit + $SCRIPTS_DIR/subunit2html ./testrepository.subunit testr_results.html + gzip -9 ./testrepository.subunit + gzip -9 ./testr_results.html + sudo mv ./*.gz /opt/stack/logs/ + fi fi } diff --git a/tox.ini b/tox.ini index c87b15871f..14b701d7c5 100644 --- a/tox.ini +++ b/tox.ini @@ -103,7 +103,6 @@ whitelist_externals = find commands = find . -type f -name "*.pyc" -delete - rm -f .testrepository/times.dbm python -m unittest specs-tests.test_titles