diff options
| author | Jenkins <jenkins@review.openstack.org> | 2016-09-06 14:01:27 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2016-09-06 14:01:27 +0000 |
| commit | bc1c964c405ea32c8255a9e9f343adc616c233b7 (patch) | |
| tree | 15cc937b418e2dbbae287971fa020ac06962b997 | |
| parent | f7f0f770af8ff3a5205339094f8be9a54d2cb18f (diff) | |
| parent | eba1bc04f4f8d70d4b036e6a6aa3e5706526de1d (diff) | |
| download | python-openstackclient-bc1c964c405ea32c8255a9e9f343adc616c233b7.tar.gz | |
Merge "better functional test collection"
| -rwxr-xr-x | post_test_hook.sh | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/post_test_hook.sh b/post_test_hook.sh index 7bb036f9..e555470d 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 <<! +set +e + +# Go to the openstackclient dir +cd $OPENSTACKCLIENT_DIR + +# Source environment variables to kick things off source ~stack/devstack/openrc admin admin echo 'Running tests with:' -env | grep OS_ -cd ${OPENSTACKCLIENT_DIR} -tox -e functional -! +env | grep OS + +# Preserve env for OS_ credentials +sudo -E -H -u jenkins tox -efunctional +EXIT_CODE=$? +set -e + +# Collect and parse result +generate_testr_results +exit $EXIT_CODE |
