Browse Source

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
Jesse Pretorius 6 months ago
parent
commit
8002ca2204

+ 0
- 107
tests/test-galera-upgrades.sh View File

@@ -1,107 +0,0 @@
1
-#!/usr/bin/env bash
2
-
3
-# Copyright 2016, Rackspace US, Inc.
4
-#
5
-# Licensed under the Apache License, Version 2.0 (the "License");
6
-# you may not use this file except in compliance with the License.
7
-# You may obtain a copy of the License at
8
-#
9
-#     http://www.apache.org/licenses/LICENSE-2.0
10
-#
11
-# Unless required by applicable law or agreed to in writing, software
12
-# distributed under the License is distributed on an "AS IS" BASIS,
13
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
-# See the License for the specific language governing permissions and
15
-# limitations under the License.
16
-
17
-# WARNING:
18
-# This file is use by all OpenStack-Ansible roles for testing purposes.
19
-# Any changes here will affect all OpenStack-Ansible role repositories
20
-# with immediate effect.
21
-
22
-# PURPOSE:
23
-# This script executes test Ansible playbooks required for performing
24
-# an upgrade test of the role.
25
-
26
-## Shell Opts ----------------------------------------------------------------
27
-
28
-set -e
29
-
30
-## Vars ----------------------------------------------------------------------
31
-
32
-export WORKING_DIR=${WORKING_DIR:-$(pwd)}
33
-export ROLE_NAME=${ROLE_NAME:-''}
34
-
35
-export ANSIBLE_PARAMETERS=${ANSIBLE_PARAMETERS:-"-vv"}
36
-export TEST_PLAYBOOK=${TEST_PLAYBOOK:-$WORKING_DIR/tests/test-upgrade-pre.yml}
37
-export TEST_CHECK_MODE=${TEST_CHECK_MODE:-false}
38
-export TEST_IDEMPOTENCE=${TEST_IDEMPOTENCE:-false}
39
-export COMMON_TESTS_PATH="${WORKING_DIR}/tests/common"
40
-
41
-echo "ANSIBLE_OVERRIDES: ${ANSIBLE_OVERRIDES}"
42
-echo "ANSIBLE_PARAMETERS: ${ANSIBLE_PARAMETERS}"
43
-echo "TEST_PLAYBOOK: ${TEST_PLAYBOOK}"
44
-echo "TEST_CHECK_MODE: ${TEST_CHECK_MODE}"
45
-echo "TEST_IDEMPOTENCE: ${TEST_IDEMPOTENCE}"
46
-
47
-## Functions -----------------------------------------------------------------
48
-
49
-function execute_ansible_playbook {
50
-
51
-  export ANSIBLE_CLI_PARAMETERS="${ANSIBLE_PARAMETERS} -e @${ANSIBLE_OVERRIDES}"
52
-  export ANSIBLE_BIN=${ANSIBLE_BIN:-"ansible-playbook"}
53
-  CMD_TO_EXECUTE="${ANSIBLE_BIN} ${TEST_PLAYBOOK} $@ ${ANSIBLE_CLI_PARAMETERS}"
54
-
55
-  echo "Executing: ${CMD_TO_EXECUTE}"
56
-  echo "With:"
57
-  echo "    ANSIBLE_INVENTORY: ${ANSIBLE_INVENTORY}"
58
-  echo "    ANSIBLE_LOG_PATH: ${ANSIBLE_LOG_PATH}"
59
-
60
-  ${CMD_TO_EXECUTE}
61
-
62
-}
63
-
64
-## Main ----------------------------------------------------------------------
65
-
66
-# Ensure that the Ansible environment is properly prepared
67
-source "${COMMON_TESTS_PATH}/test-ansible-env-prep.sh"
68
-
69
-# Prepare environment for the initial deploy of (previous and current) Galera
70
-# No upgrading or testing is done yet.
71
-export TEST_PLAYBOOK="${WORKING_DIR}/tests/test-upgrade-pre.yml"
72
-export ANSIBLE_LOG_PATH="${ANSIBLE_LOG_DIR}/ansible-execute-install.log"
73
-
74
-# Execute the setup of previous version
75
-execute_ansible_playbook
76
-
77
-# Create an ansible venv matching previous branch
78
-source ${WORKING_DIR}/tests/common/test-create-previous-venv.sh
79
-
80
-# NOTE(hwoarang): Ansible 2.4+ is broken in terms of task inclusion and relative
81
-# files are preferred over those belonging to the actual role. As such, we need to
82
-# change the current directory to something that doesn't look like a role directory
83
-# structure when executing the previous role
84
-# https://github.com/ansible/ansible/pull/34790
85
-cd ${WORKING_DIR}/tests
86
-
87
-# Prepare environment for the deploy of previous Galera:
88
-# No upgrading or testing is done yet.
89
-export TEST_PLAYBOOK="${WORKING_DIR}/tests/test-install-previous-galera.yml"
90
-export ANSIBLE_LOG_PATH="${ANSIBLE_LOG_DIR}/ansible-execute-previous_galera-install.log"
91
-export PREVIOUS_VENV="ansible-previous"
92
-export ANSIBLE_BIN="${WORKING_DIR}/.tox/${PREVIOUS_VENV}/bin/ansible-playbook"
93
-
94
-# Execute the setup of previous Keystone
95
-execute_ansible_playbook
96
-# Unset previous branch overrides
97
-unset PREVIOUS_VENV
98
-unset ANSIBLE_BIN
99
-
100
-cd -
101
-
102
-# Prepare environment for the upgrade
103
-export TEST_PLAYBOOK="${WORKING_DIR}/tests/test-upgrade-post.yml"
104
-export ANSIBLE_LOG_PATH="${ANSIBLE_LOG_DIR}/ansible-execute-upgrade.log"
105
-
106
-# Execute the upgrade
107
-execute_ansible_playbook

+ 0
- 25
tests/test-install-previous-galera.yml View File

@@ -1,25 +0,0 @@
1
----
2
-# Copyright 2018, SUSE LINUX GmbH.
3
-#
4
-# Licensed under the Apache License, Version 2.0 (the "License");
5
-# you may not use this file except in compliance with the License.
6
-# You may obtain a copy of the License at
7
-#
8
-#     http://www.apache.org/licenses/LICENSE-2.0
9
-#
10
-# Unless required by applicable law or agreed to in writing, software
11
-# distributed under the License is distributed on an "AS IS" BASIS,
12
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
-# See the License for the specific language governing permissions and
14
-# limitations under the License.
15
-
16
-# Install previous version
17
-- name: Deploy previous galera version
18
-  hosts: galera_all
19
-  user: root
20
-  serial: 1
21
-  gather_facts: true
22
-  roles:
23
-    - role: "previous_galera_server"
24
-  vars_files:
25
-    - common/previous/test-vars.yml

+ 0
- 30
tests/test-upgrade-post.yml View File

@@ -1,30 +0,0 @@
1
----
2
-# Copyright 2015, Rackspace US, Inc.
3
-#
4
-# Licensed under the Apache License, Version 2.0 (the "License");
5
-# you may not use this file except in compliance with the License.
6
-# You may obtain a copy of the License at
7
-#
8
-#     http://www.apache.org/licenses/LICENSE-2.0
9
-#
10
-# Unless required by applicable law or agreed to in writing, software
11
-# distributed under the License is distributed on an "AS IS" BASIS,
12
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
-# See the License for the specific language governing permissions and
14
-# limitations under the License.
15
-
16
-# Install current version Galera server
17
-- name: Deploy current galera version
18
-  hosts: galera_all
19
-  user: root
20
-  serial: 1
21
-  gather_facts: true
22
-  roles:
23
-    - role: "galera_server"
24
-  vars:
25
-    galera_upgrade: true
26
-  vars_files:
27
-    - common/test-vars.yml
28
-
29
-# Re-run functional tests
30
-- import_playbook: test-galera-server-functional.yml

+ 0
- 17
tests/test-upgrade-pre.yml View File

@@ -1,17 +0,0 @@
1
----
2
-# Copyright 2015, Rackspace US, Inc.
3
-#
4
-# Licensed under the Apache License, Version 2.0 (the "License");
5
-# you may not use this file except in compliance with the License.
6
-# You may obtain a copy of the License at
7
-#
8
-#     http://www.apache.org/licenses/LICENSE-2.0
9
-#
10
-# Unless required by applicable law or agreed to in writing, software
11
-# distributed under the License is distributed on an "AS IS" BASIS,
12
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
-# See the License for the specific language governing permissions and
14
-# limitations under the License.
15
-
16
-# Setup the host
17
-- import_playbook: common/test-setup-host.yml

+ 1
- 1
tests/test.yml View File

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

+ 0
- 8
tox.ini View File

@@ -93,14 +93,6 @@ commands =
93 93
 commands =
94 94
     bash -c "{toxinidir}/tests/common/test-ansible-functional.sh"
95 95
 
96
-[testenv:upgrade]
97
-setenv =
98
-    {[testenv]setenv}
99
-    ANSIBLE_OVERRIDES={toxinidir}/tests/galera_server-overrides.yml
100
-    CLONE_UPGRADE_TESTS=yes
101
-commands =
102
-    bash -c "{toxinidir}/tests/test-galera-upgrades.sh"
103
-
104 96
 [testenv:ssl]
105 97
 setenv =
106 98
     {[testenv]setenv}

+ 0
- 1
zuul.d/project.yaml View File

@@ -15,7 +15,6 @@
15 15
 - project:
16 16
     templates:
17 17
       - openstack-ansible-role-jobs
18
-      - openstack-ansible-upgrade
19 18
       - check-requirements
20 19
       - publish-openstack-docs-pti
21 20
       - release-notes-jobs-python3

Loading…
Cancel
Save