Split upgrade test into its own play

To avoid requiring all the os_previous_swift tasks to be evaluated, we
should split the 2 tests up. This will help make the gate more efficient
and avoids unnecessary issues.

Change-Id: I105d0c49f1b5dc78e1e5a5c7334cd81ecc455056
This commit is contained in:
Andy McCrae 2017-01-20 16:42:00 +00:00
parent 0c7f419ddd
commit 0e45afbd91
3 changed files with 37 additions and 11 deletions

32
tests/test-upgrade.yml Normal file
View File

@ -0,0 +1,32 @@
---
# Copyright 2015, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Setup the keys, host and containers
- include: common/test-setup-host.yml
# Install Memcached/Galera/Rabbitmq
- include: common/test-install-infra.yml
# Install Keystone
- include: common/test-install-keystone.yml
# Setup Swift-hosts
- include: common/test-setup-swifthosts.yml
# Install previous swift
- include: test-install-previous-swift.yml
# Install Swift
- include: common/test-install-swift.yml

View File

@ -25,11 +25,5 @@
# Setup Swift-hosts # Setup Swift-hosts
- include: common/test-setup-swifthosts.yml - include: common/test-setup-swifthosts.yml
# Install previous swift
- include: test-install-previous-swift.yml
when:
- swift_upgrade is defined
- swift_upgrade | bool
# Install Swift # Install Swift
- include: common/test-install-swift.yml - include: common/test-install-swift.yml

10
tox.ini
View File

@ -59,10 +59,6 @@ commands =
bash -c "if [ ! -d "{toxinidir}/tests/common" ]; then \ bash -c "if [ ! -d "{toxinidir}/tests/common" ]; then \
git clone https://git.openstack.org/openstack/openstack-ansible-tests {toxinidir}/tests/common; \ git clone https://git.openstack.org/openstack/openstack-ansible-tests {toxinidir}/tests/common; \
fi" fi"
bash -c "if [ ! -d "{toxinidir}/tests/common/previous" ]; then \
git clone https://git.openstack.org/openstack/openstack-ansible-tests -b stable/newton \
{toxinidir}/tests/common/previous; \
fi"
[testenv:pep8] [testenv:pep8]
@ -119,9 +115,13 @@ deps =
{[testenv:ansible]deps} {[testenv:ansible]deps}
setenv = setenv =
{[testenv]setenv} {[testenv]setenv}
ANSIBLE_PARAMETERS=-vvv -e swift_upgrade=True TEST_PLAYBOOK={toxinidir}/tests/test-upgrade.yml
commands = commands =
{[testenv:tests_clone]commands} {[testenv:tests_clone]commands}
bash -c "if [ ! -d "{toxinidir}/tests/common/previous" ]; then \
git clone https://git.openstack.org/openstack/openstack-ansible-tests -b stable/newton \
{toxinidir}/tests/common/previous; \
fi"
bash -c "{toxinidir}/tests/common/test-ansible-functional.sh" bash -c "{toxinidir}/tests/common/test-ansible-functional.sh"