Clean up role tests

Now that we're using the general templates, we can slim down
the role test definitions. We can also remove tests which are
not being watched, or which are fundamentally broken. With
this we can also remove unused scripts/plays.

We do the following:

1. We remove the 'upgrade' job, given that it's been broken
   all cycle due to the way the job executes and we need to
   regroup to figure out another way to do it.

Change-Id: I7d1f07878dba7d21aecd59fa75e9117b50b886e6
This commit is contained in:
Jesse Pretorius 2018-10-17 16:23:13 +01:00
parent 3f092e60cd
commit 8002ca2204
7 changed files with 1 additions and 189 deletions

View File

@ -1,107 +0,0 @@
#!/usr/bin/env bash
# Copyright 2016, 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.
# WARNING:
# This file is use by all OpenStack-Ansible roles for testing purposes.
# Any changes here will affect all OpenStack-Ansible role repositories
# with immediate effect.
# PURPOSE:
# This script executes test Ansible playbooks required for performing
# an upgrade test of the role.
## Shell Opts ----------------------------------------------------------------
set -e
## Vars ----------------------------------------------------------------------
export WORKING_DIR=${WORKING_DIR:-$(pwd)}
export ROLE_NAME=${ROLE_NAME:-''}
export ANSIBLE_PARAMETERS=${ANSIBLE_PARAMETERS:-"-vv"}
export TEST_PLAYBOOK=${TEST_PLAYBOOK:-$WORKING_DIR/tests/test-upgrade-pre.yml}
export TEST_CHECK_MODE=${TEST_CHECK_MODE:-false}
export TEST_IDEMPOTENCE=${TEST_IDEMPOTENCE:-false}
export COMMON_TESTS_PATH="${WORKING_DIR}/tests/common"
echo "ANSIBLE_OVERRIDES: ${ANSIBLE_OVERRIDES}"
echo "ANSIBLE_PARAMETERS: ${ANSIBLE_PARAMETERS}"
echo "TEST_PLAYBOOK: ${TEST_PLAYBOOK}"
echo "TEST_CHECK_MODE: ${TEST_CHECK_MODE}"
echo "TEST_IDEMPOTENCE: ${TEST_IDEMPOTENCE}"
## Functions -----------------------------------------------------------------
function execute_ansible_playbook {
export ANSIBLE_CLI_PARAMETERS="${ANSIBLE_PARAMETERS} -e @${ANSIBLE_OVERRIDES}"
export ANSIBLE_BIN=${ANSIBLE_BIN:-"ansible-playbook"}
CMD_TO_EXECUTE="${ANSIBLE_BIN} ${TEST_PLAYBOOK} $@ ${ANSIBLE_CLI_PARAMETERS}"
echo "Executing: ${CMD_TO_EXECUTE}"
echo "With:"
echo " ANSIBLE_INVENTORY: ${ANSIBLE_INVENTORY}"
echo " ANSIBLE_LOG_PATH: ${ANSIBLE_LOG_PATH}"
${CMD_TO_EXECUTE}
}
## Main ----------------------------------------------------------------------
# Ensure that the Ansible environment is properly prepared
source "${COMMON_TESTS_PATH}/test-ansible-env-prep.sh"
# Prepare environment for the initial deploy of (previous and current) Galera
# No upgrading or testing is done yet.
export TEST_PLAYBOOK="${WORKING_DIR}/tests/test-upgrade-pre.yml"
export ANSIBLE_LOG_PATH="${ANSIBLE_LOG_DIR}/ansible-execute-install.log"
# Execute the setup of previous version
execute_ansible_playbook
# Create an ansible venv matching previous branch
source ${WORKING_DIR}/tests/common/test-create-previous-venv.sh
# NOTE(hwoarang): Ansible 2.4+ is broken in terms of task inclusion and relative
# files are preferred over those belonging to the actual role. As such, we need to
# change the current directory to something that doesn't look like a role directory
# structure when executing the previous role
# https://github.com/ansible/ansible/pull/34790
cd ${WORKING_DIR}/tests
# Prepare environment for the deploy of previous Galera:
# No upgrading or testing is done yet.
export TEST_PLAYBOOK="${WORKING_DIR}/tests/test-install-previous-galera.yml"
export ANSIBLE_LOG_PATH="${ANSIBLE_LOG_DIR}/ansible-execute-previous_galera-install.log"
export PREVIOUS_VENV="ansible-previous"
export ANSIBLE_BIN="${WORKING_DIR}/.tox/${PREVIOUS_VENV}/bin/ansible-playbook"
# Execute the setup of previous Keystone
execute_ansible_playbook
# Unset previous branch overrides
unset PREVIOUS_VENV
unset ANSIBLE_BIN
cd -
# Prepare environment for the upgrade
export TEST_PLAYBOOK="${WORKING_DIR}/tests/test-upgrade-post.yml"
export ANSIBLE_LOG_PATH="${ANSIBLE_LOG_DIR}/ansible-execute-upgrade.log"
# Execute the upgrade
execute_ansible_playbook

View File

@ -1,25 +0,0 @@
---
# Copyright 2018, SUSE LINUX GmbH.
#
# 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.
# Install previous version
- name: Deploy previous galera version
hosts: galera_all
user: root
serial: 1
gather_facts: true
roles:
- role: "previous_galera_server"
vars_files:
- common/previous/test-vars.yml

View File

@ -1,30 +0,0 @@
---
# 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.
# Install current version Galera server
- name: Deploy current galera version
hosts: galera_all
user: root
serial: 1
gather_facts: true
roles:
- role: "galera_server"
vars:
galera_upgrade: true
vars_files:
- common/test-vars.yml
# Re-run functional tests
- import_playbook: test-galera-server-functional.yml

View File

@ -1,17 +0,0 @@
---
# 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 host
- import_playbook: common/test-setup-host.yml

View File

@ -16,7 +16,7 @@
# Setup the host # Setup the host
- import_playbook: common/test-setup-host.yml - import_playbook: common/test-setup-host.yml
# Install previous version Galera server # Install Galera server
- import_playbook: common/test-install-galera.yml - import_playbook: common/test-install-galera.yml
# Run functional tests # Run functional tests

View File

@ -93,14 +93,6 @@ commands =
commands = commands =
bash -c "{toxinidir}/tests/common/test-ansible-functional.sh" bash -c "{toxinidir}/tests/common/test-ansible-functional.sh"
[testenv:upgrade]
setenv =
{[testenv]setenv}
ANSIBLE_OVERRIDES={toxinidir}/tests/galera_server-overrides.yml
CLONE_UPGRADE_TESTS=yes
commands =
bash -c "{toxinidir}/tests/test-galera-upgrades.sh"
[testenv:ssl] [testenv:ssl]
setenv = setenv =
{[testenv]setenv} {[testenv]setenv}

View File

@ -15,7 +15,6 @@
- project: - project:
templates: templates:
- openstack-ansible-role-jobs - openstack-ansible-role-jobs
- openstack-ansible-upgrade
- check-requirements - check-requirements
- publish-openstack-docs-pti - publish-openstack-docs-pti
- release-notes-jobs-python3 - release-notes-jobs-python3