diff options
author | Dean Troyer <dtroyer@gmail.com> | 2017-11-05 17:39:47 -0600 |
---|---|---|
committer | Dean Troyer <dtroyer@gmail.com> | 2017-11-06 19:26:41 -0600 |
commit | 7f04f2f286b61725ee5982e240638af9051e89b9 (patch) | |
tree | 255a768ea2ab6db88b6f692f1e5bd2a3e607a2e9 | |
parent | fcf928eaaa55068564de183ea2fc266e5d035a34 (diff) | |
download | python-openstackclient-7f04f2f286b61725ee5982e240638af9051e89b9.tar.gz |
Backport Zuul v3 tests
Do a single copy of the current test state from master
Depends-On: I6ba35ea9e2080012f098569efcd65e1145829d91
Change-Id: I428516388cee564da86be69ad0591108217f82f6
-rw-r--r-- | .zuul.yaml | 159 | ||||
-rwxr-xr-x | openstackclient/tests/functional/post_test_hook.sh | 43 | ||||
-rwxr-xr-x | openstackclient/tests/functional/post_test_hook_tips.sh | 47 | ||||
-rwxr-xr-x | openstackclient/tests/functional/run_ostestr.sh | 16 | ||||
-rw-r--r-- | playbooks/osc-devstack/post.yaml | 4 | ||||
-rw-r--r-- | playbooks/osc-devstack/pre.yaml | 8 | ||||
-rw-r--r-- | playbooks/osc-devstack/run.yaml | 3 | ||||
-rw-r--r-- | tox.ini | 12 |
8 files changed, 198 insertions, 94 deletions
diff --git a/.zuul.yaml b/.zuul.yaml new file mode 100644 index 00000000..9b22ace0 --- /dev/null +++ b/.zuul.yaml @@ -0,0 +1,159 @@ +- job: + name: osc-tox-unit-tips + parent: openstack-tox + description: | + Run unit tests for OpenStackClient with master branch of important libs. + + Uses tox with the ``unit-tips`` environment and master branch of + the required-projects below. + irrelevant-files: + - ^.*\.rst$ + - ^doc/.*$ + - ^releasenotes/.*$ + required-projects: + - openstack/os-client-config + - openstack/osc-lib + - openstack/python-openstackclient + - openstack/python-openstacksdk + vars: + tox_envlist: unit-tips + +- job: + name: osc-functional-devstack-base + parent: devstack + description: | + Base job for devstack-based functional tests + pre-run: playbooks/osc-devstack/pre.yaml + run: playbooks/osc-devstack/run.yaml + post-run: playbooks/osc-devstack/post.yaml + required-projects: + - name: openstack/swift + roles: + - zuul: openstack-infra/devstack + timeout: 9000 + irrelevant-files: + - ^.*\.rst$ + - ^doc/.*$ + - ^releasenotes/.*$ + vars: + devstack_localrc: + SWIFT_HASH: '1234123412341234' + LIBS_FROM_GIT: python-openstackclient + # NOTE(dtroyer): OSC needs to support Image v1 for a while yet so re-enable + GLANCE_V1_ENABLED: true + # NOTE(dtroyer): Functional tests need a bit more volume headroom + VOLUME_BACKING_FILE_SIZE: 20G + devstack_local_conf: + post-config: + $CINDER_CONF: + DEFAULT: + # NOTE(dtroyer): OSC needs to support Volume v1 for a while yet so re-enable + enable_v1_api: true + devstack_services: + ceilometer-acentral: false + ceilometer-acompute: false + ceilometer-alarm-evaluator: false + ceilometer-alarm-notifier: false + ceilometer-anotification: false + ceilometer-api: false + ceilometer-collector: false + horizon: false + s-account: true + s-container: true + s-object: true + s-proxy: true + osc_environment: + PYTHONUNBUFFERED: 'true' + OS_CLOUD: devstack-admin + tox_install_siblings: false + zuul_work_dir: src/git.openstack.org/openstack/python-openstackclient + +# The Neutron bits are here rather than in osc-functional-devstack-base to +# simplify removing Neutron in the osc-functional-devstack-n-net job. +- job: + name: osc-functional-devstack + parent: osc-functional-devstack-base + timeout: 7800 + vars: + devstack_plugins: + # NOTE(amotoki): Some neutron features are enabled by devstack plugin + neutron: https://git.openstack.org/openstack/neutron + devstack_services: + neutron-segments: true + q-metering: true + q-qos: true + tox_envlist: functional + +- job: + name: osc-functional-devstack-n-net + parent: osc-functional-devstack-base + timeout: 7800 + vars: + devstack_localrc: + FLAT_INTERFACE: br_flat + PUBLIC_INTERFACE: br_pub + devstack_services: + n-cell: true + n-net: true + neutron: false + neutron-segments: false + q-agt: false + q-dhcp: false + q-l3: false + q-meta: false + q-metering: false + q-qos: false + q-svc: false + tox_envlist: functional + +- job: + name: osc-functional-devstack-tips + parent: osc-functional-devstack + timeout: 7800 + required-projects: + - openstack/os-client-config + - openstack/osc-lib + - openstack/python-openstackclient + - openstack/python-openstacksdk + vars: + devstack_localrc: + USE_PYTHON3: true + LIBS_FROM_GIT: python-openstackclient,python-openstacksdk,osc-lib,os-client-config + # This is insufficient, but leaving it here as a reminder of what may + # someday be all we need to make this work + # disable_python3_package swift + DISABLED_PYTHON3_PACKAGES: swift + devstack_services: + # Swift is not ready for python3 yet: At a minimum keystonemiddleware needs + # to be installed in the py2 env, there are probably other things too... + s-account: false + s-container: false + s-object: false + s-proxy: false + tox_envlist: functional-tips + +- project: + name: openstack/python-openstackclient + templates: + - openstackclient-plugin-jobs + check: + jobs: + - osc-tox-unit-tips: + # The functional-tips job only tests the latest and shouldn't be run + # on the stable branches + branches: ^(?!stable) + - osc-functional-devstack + # - osc-functional-devstack-n-net: + # voting: false + # # The job testing nova-network no longer works before Pike, and + # # should be disabled until the New Way of testing against old clouds + # # is ready and backported + # branches: ^(?!stable/(newton|ocata)).*$ + - osc-functional-devstack-tips: + voting: false + # The functional-tips job only tests the latest and shouldn't be run + # on the stable branches + branches: ^(?!stable) + gate: + jobs: + - osc-functional-devstack 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 $* diff --git a/playbooks/osc-devstack/post.yaml b/playbooks/osc-devstack/post.yaml new file mode 100644 index 00000000..db7ca7d6 --- /dev/null +++ b/playbooks/osc-devstack/post.yaml @@ -0,0 +1,4 @@ +- hosts: all + roles: + - fetch-tox-output + - fetch-stestr-output diff --git a/playbooks/osc-devstack/pre.yaml b/playbooks/osc-devstack/pre.yaml new file mode 100644 index 00000000..3ec41c9c --- /dev/null +++ b/playbooks/osc-devstack/pre.yaml @@ -0,0 +1,8 @@ +- hosts: all + roles: + - run-devstack + - role: bindep + bindep_profile: test + bindep_dir: "{{ zuul_work_dir }}" + - test-setup + - ensure-tox diff --git a/playbooks/osc-devstack/run.yaml b/playbooks/osc-devstack/run.yaml new file mode 100644 index 00000000..22f82096 --- /dev/null +++ b/playbooks/osc-devstack/run.yaml @@ -0,0 +1,3 @@ +- hosts: all + roles: + - tox @@ -53,16 +53,20 @@ commands = [testenv:functional] setenv = OS_TEST_PATH=./openstackclient/tests/functional passenv = OS_* +whitelist_externals = openstackclient/tests/functional/run_ostestr.sh +commands = + {toxinidir}/openstackclient/tests/functional/run_ostestr.sh {posargs} [testenv:functional-tips] setenv = OS_TEST_PATH=./openstackclient/tests/functional passenv = OS_* +whitelist_externals = openstackclient/tests/functional/run_ostestr.sh commands = - pip install -q -U -e "git+file:///opt/stack/new/osc-lib#egg=osc_lib" - pip install -q -U -e "git+file:///opt/stack/new/python-openstacksdk#egg=openstacksdk" - pip install -q -U -e "git+file:///opt/stack/new/os-client-config#egg=os_client_config" + pip install -q -U -e "git+file://{toxinidir}/../osc-lib#egg=osc_lib" + pip install -q -U -e "git+file://{toxinidir}/../os-client-config#egg=os_client_config" + pip install -q -U -e "git+file://{toxinidir}/../python-openstacksdk#egg=openstacksdk" pip freeze - ostestr {posargs} + {toxinidir}/openstackclient/tests/functional/run_ostestr.sh {posargs} [testenv:venv] commands = {posargs} |