File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66# For more information refer to:
77# http://docs.openstack.org/developer/python-openstackclient/
88
9- set -xe
9+ function generate_testr_results {
10+ if [ -f .testrepository/0 ]; then
11+ sudo .tox/functional/bin/testr last --subunit > $WORKSPACE /testrepository.subunit
12+ sudo mv $WORKSPACE /testrepository.subunit $BASE /logs/testrepository.subunit
13+ sudo .tox/functional/bin/subunit2html $BASE /logs/testrepository.subunit $BASE /logs/testr_results.html
14+ sudo gzip -9 $BASE /logs/testrepository.subunit
15+ sudo gzip -9 $BASE /logs/testr_results.html
16+ sudo chown jenkins:jenkins $BASE /logs/testrepository.subunit.gz $BASE /logs/testr_results.html.gz
17+ sudo chmod a+r $BASE /logs/testrepository.subunit.gz $BASE /logs/testr_results.html.gz
18+ fi
19+ }
1020
1121OPENSTACKCLIENT_DIR=$( cd $( dirname " $0 " ) && pwd)
22+ sudo chown -R jenkins:stack $OPENSTACKCLIENT_DIR
1223
24+ # Run tests
1325echo " Running openstackclient functional test suite"
14- sudo -H -u stack -i << !
26+ set +e
27+
28+ # Go to the openstackclient dir
29+ cd $OPENSTACKCLIENT_DIR
30+
31+ # Source environment variables to kick things off
1532source ~ stack/devstack/openrc admin admin
1633echo ' Running tests with:'
17- env | grep OS_
18- cd ${OPENSTACKCLIENT_DIR}
19- tox -e functional
20- !
34+ env | grep OS
35+
36+ # Preserve env for OS_ credentials
37+ sudo -E -H -u jenkins tox -efunctional
38+ EXIT_CODE=$?
39+ set -e
40+
41+ # Collect and parse result
42+ generate_testr_results
43+ exit $EXIT_CODE
You can’t perform that action at this time.
0 commit comments