From 7f04f2f286b61725ee5982e240638af9051e89b9 Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Sun, 5 Nov 2017 17:39:47 -0600 Subject: Backport Zuul v3 tests Do a single copy of the current test state from master Depends-On: I6ba35ea9e2080012f098569efcd65e1145829d91 Change-Id: I428516388cee564da86be69ad0591108217f82f6 --- openstackclient/tests/functional/post_test_hook.sh | 43 -------------------- .../tests/functional/post_test_hook_tips.sh | 47 ---------------------- openstackclient/tests/functional/run_ostestr.sh | 16 ++++++++ 3 files changed, 16 insertions(+), 90 deletions(-) delete mode 100755 openstackclient/tests/functional/post_test_hook.sh delete mode 100755 openstackclient/tests/functional/post_test_hook_tips.sh create mode 100755 openstackclient/tests/functional/run_ostestr.sh (limited to 'openstackclient/tests') diff --git a/openstackclient/tests/functional/post_test_hook.sh b/openstackclient/tests/functional/post_test_hook.sh deleted file mode 100755 index b7a39cfe..00000000 --- a/openstackclient/tests/functional/post_test_hook.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -# This is a script that kicks off a series of functional tests against an -# OpenStack cloud. It will attempt to create an instance if one is not -# available. Do not run this script unless you know what you're doing. -# For more information refer to: -# http://docs.openstack.org/developer/python-openstackclient/ - -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 -} - -export OPENSTACKCLIENT_DIR="$BASE/new/python-openstackclient" -sudo chown -R jenkins:stack $OPENSTACKCLIENT_DIR - -# Go to the openstackclient dir -cd $OPENSTACKCLIENT_DIR - -# Run tests -echo "Running openstackclient functional test suite" -set +e - -# Source environment variables to kick things off -source ~stack/devstack/openrc admin admin -echo 'Running tests with:' -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 diff --git a/openstackclient/tests/functional/post_test_hook_tips.sh b/openstackclient/tests/functional/post_test_hook_tips.sh deleted file mode 100755 index 28ab9580..00000000 --- a/openstackclient/tests/functional/post_test_hook_tips.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash - -# This is a script that kicks off a series of functional tests against an -# OpenStack cloud. It will attempt to create an instance if one is not -# available. Do not run this script unless you know what you're doing. -# For more information refer to: -# http://docs.openstack.org/developer/python-openstackclient/ - -# This particular script differs from the normal post_test_hook because -# it installs the master (tip) version of osc-lib, os-client-config -# and openstacksdk, OSCs most important dependencies. - -function generate_testr_results { - if [ -f .testrepository/0 ]; then - sudo .tox/functional-tips/bin/testr last --subunit > $WORKSPACE/testrepository.subunit - sudo mv $WORKSPACE/testrepository.subunit $BASE/logs/testrepository.subunit - sudo .tox/functional-tips/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 -} - -export OPENSTACKCLIENT_DIR="$BASE/new/python-openstackclient" -sudo chown -R jenkins:stack $OPENSTACKCLIENT_DIR - -# Go to the openstackclient dir -cd $OPENSTACKCLIENT_DIR - -# Run tests -echo "Running openstackclient functional-tips test suite" -set +e - -# Source environment variables to kick things off -source ~stack/devstack/openrc admin admin -echo 'Running tests with:' -env | grep OS - -# Preserve env for OS_ credentials -sudo -E -H -u jenkins tox -e functional-tips -EXIT_CODE=$? -set -e - -# Collect and parse result -generate_testr_results -exit $EXIT_CODE diff --git a/openstackclient/tests/functional/run_ostestr.sh b/openstackclient/tests/functional/run_ostestr.sh new file mode 100755 index 00000000..a6adad96 --- /dev/null +++ b/openstackclient/tests/functional/run_ostestr.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# This is a script that runs ostestr with the openrc OS_ variables sourced. +# Do not run this script unless you know what you're doing. +# For more information refer to: +# https://docs.openstack.org/python-openstackclient/latest/ + +# Source environment variables to kick things off +if [ -f ~stack/devstack/openrc ] ; then + source ~stack/devstack/openrc admin admin +fi + +echo 'Running tests with:' +env | grep OS + +ostestr $* -- cgit v1.2.1