From eba1bc04f4f8d70d4b036e6a6aa3e5706526de1d Mon Sep 17 00:00:00 2001 From: Steve Martinelli Date: Wed, 15 Jun 2016 14:25:51 -0400 Subject: [PATCH] better functional test collection straight up copied from glanceclient [1] [1] https://github.com/openstack/python-glanceclient/blob/master/glanceclient/tests/functional/hooks/post_test_hook.sh Change-Id: I9fad6d5c86831a2b872f3a61d4c7fa7383fc1266 --- post_test_hook.sh | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/post_test_hook.sh b/post_test_hook.sh index 7bb036f9cf..e555470d17 100755 --- a/post_test_hook.sh +++ b/post_test_hook.sh @@ -6,15 +6,38 @@ # For more information refer to: # http://docs.openstack.org/developer/python-openstackclient/ -set -xe +function generate_testr_results { + if [ -f .testrepository/0 ]; then + sudo .tox/functional/bin/testr last --subunit > $WORKSPACE/testrepository.subunit + sudo mv $WORKSPACE/testrepository.subunit $BASE/logs/testrepository.subunit + sudo .tox/functional/bin/subunit2html $BASE/logs/testrepository.subunit $BASE/logs/testr_results.html + sudo gzip -9 $BASE/logs/testrepository.subunit + sudo gzip -9 $BASE/logs/testr_results.html + sudo chown jenkins:jenkins $BASE/logs/testrepository.subunit.gz $BASE/logs/testr_results.html.gz + sudo chmod a+r $BASE/logs/testrepository.subunit.gz $BASE/logs/testr_results.html.gz + fi +} OPENSTACKCLIENT_DIR=$(cd $(dirname "$0") && pwd) +sudo chown -R jenkins:stack $OPENSTACKCLIENT_DIR +# Run tests echo "Running openstackclient functional test suite" -sudo -H -u stack -i <