From ef409d8e295d83ce63cd7f7cdeebd8e7970572e8 Mon Sep 17 00:00:00 2001 From: Omer Anson Date: Tue, 12 Sep 2017 20:09:57 +0300 Subject: [PATCH] Gate fix: verify .testrepository exists before changing permissions Heavily based on [1] (update for stestr). [1] https://review.openstack.org/#/c/503118 Change-Id: I48dfbb2987bfb8b7f69526c59ac9cab711566608 --- .stestr.conf | 3 +++ .testr.conf | 4 ---- dragonflow/tests/contrib/post_test_hook.sh | 6 +++--- test-requirements.txt | 1 - 4 files changed, 6 insertions(+), 8 deletions(-) create mode 100644 .stestr.conf delete mode 100644 .testr.conf diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 000000000..a81480960 --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=${OS_TEST_PATH:-./dragonflow/tests/unit} +top_dir=./ diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index 33839e913..000000000 --- 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:-./dragonflow/tests/unit} $LISTOPT $IDOPTION | cat -test_id_option=--load-list $IDFILE -test_list_option=--list diff --git a/dragonflow/tests/contrib/post_test_hook.sh b/dragonflow/tests/contrib/post_test_hook.sh index 33c2ab276..d57a5b345 100644 --- a/dragonflow/tests/contrib/post_test_hook.sh +++ b/dragonflow/tests/contrib/post_test_hook.sh @@ -23,9 +23,9 @@ 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 + sudo -H -u "$owner" chmod o+rw -R .stestr + if [[ -f ".stestr/0" ]] ; then + ".tox/$venv/bin/subunit-1to2" < .stestr/0 > ./testrepository.subunit $SCRIPTS_DIR/subunit2html ./testrepository.subunit testr_results.html gzip -9 ./testrepository.subunit gzip -9 ./testr_results.html diff --git a/test-requirements.txt b/test-requirements.txt index c66dfe328..25a0941ac 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -13,7 +13,6 @@ sphinx>=1.6.2 # BSD openstackdocstheme>=1.16.0 # Apache-2.0 os-testr>=0.8.0 # Apache-2.0 oslotest>=1.10.0 # Apache-2.0 -testrepository>=0.0.18 # Apache-2.0/BSD testresources>=0.2.4 # Apache-2.0/BSD testscenarios>=0.4 # Apache-2.0/BSD testtools>=1.4.0 # MIT