From 2490c368e3eaabf4a9daa8e1a865518d4ef0e3d6 Mon Sep 17 00:00:00 2001 From: Kien Nguyen Date: Fri, 15 Sep 2017 13:33:00 +0700 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: Iead2b550fc2c3accf25e450db0eb0a56603fc571 Closes-Bug: #1716746 --- .gitignore | 1 + .stestr.conf | 3 +++ .testr.conf | 4 ---- kuryr_libnetwork/tests/contrib/post_test_hook.sh | 10 +++++----- test-requirements.txt | 1 - 5 files changed, 9 insertions(+), 10 deletions(-) create mode 100644 .stestr.conf delete mode 100644 .testr.conf diff --git a/.gitignore b/.gitignore index 1e025544..bd1f0b85 100644 --- a/.gitignore +++ b/.gitignore @@ -46,6 +46,7 @@ ChangeLog !/.gitreview !/.mailmap !/.pylintrc +!/.stestr.conf !/.testr.conf contrib/vagrant/.vagrant diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 00000000..359495be --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=${OS_TEST_PATH:-./kuryr_libnetwork/tests/unit} +top_dir=./ diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index 22ff0ba6..00000000 --- a/.testr.conf +++ /dev/null @@ -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 diff --git a/kuryr_libnetwork/tests/contrib/post_test_hook.sh b/kuryr_libnetwork/tests/contrib/post_test_hook.sh index 9c62b730..ce0eadaf 100644 --- a/kuryr_libnetwork/tests/contrib/post_test_hook.sh +++ b/kuryr_libnetwork/tests/contrib/post_test_hook.sh @@ -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 diff --git a/test-requirements.txt b/test-requirements.txt index 7b468b82..4ba6749f 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -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