summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Pretorius <jesse.pretorius@rackspace.co.uk>2018-03-28 10:12:49 +0100
committerJesse Pretorius <jesse.pretorius@rackspace.co.uk>2018-03-28 10:12:49 +0100
commitc9e7d542125e3c0e19092461202b798d4d8efce3 (patch)
treed6cbd83766be7720018bcf293099349ea2213e3d
parent598b74ff5e557413c2f19e4cd92bd8993632605c (diff)
Remove tests-repo-clone.sh
Now that run_tests.sh handles the tests repo clone, we can remove the use of the older tests-repo-clone.sh script. Change-Id: I7c2b38c7cb07da34bb435e99a0eae1ec0eba5899
Notes
Notes (review): Code-Review+2: Markos Chandras (hwoarang) <mchandras@suse.de> Code-Review+2: Jean-Philippe Evrard <jean-philippe@evrard.me> Workflow+1: Jean-Philippe Evrard <jean-philippe@evrard.me> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Wed, 28 Mar 2018 10:32:44 +0000 Reviewed-on: https://review.openstack.org/557225 Project: openstack/openstack-ansible-os_almanach Branch: refs/heads/master
-rwxr-xr-xtests/tests-repo-clone.sh117
-rw-r--r--tox.ini5
2 files changed, 0 insertions, 122 deletions
diff --git a/tests/tests-repo-clone.sh b/tests/tests-repo-clone.sh
deleted file mode 100755
index 5ad509c..0000000
--- a/tests/tests-repo-clone.sh
+++ /dev/null
@@ -1,117 +0,0 @@
1#!/bin/bash
2# Copyright 2017, 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# PURPOSE:
17# This script clones the openstack-ansible-tests repository to the
18# tests/common folder in order to be able to re-use test components
19# for role testing.
20
21# WARNING:
22# This file is maintained in the openstack-ansible-tests repository:
23# https://git.openstack.org/cgit/openstack/openstack-ansible-tests
24# If you need to change this script, then propose the change there.
25# Once it merges, the change will be replicated to the other repositories.
26
27## Shell Opts ----------------------------------------------------------------
28
29set -e
30
31## Vars ----------------------------------------------------------------------
32
33export TESTING_HOME=${TESTING_HOME:-$HOME}
34export WORKING_DIR=${WORKING_DIR:-$(pwd)}
35export CLONE_UPGRADE_TESTS=${CLONE_UPGRADE_TESTS:-no}
36export ZUUL_TESTS_CLONE_LOCATION="/home/zuul/src/git.openstack.org/openstack/openstack-ansible-tests"
37
38## Functions -----------------------------------------------------------------
39
40function create_tests_clonemap {
41
42# Prepare the clonemap for zuul-cloner to use
43cat > ${TESTING_HOME}/tests-clonemap.yaml << EOF
44clonemap:
45 - name: openstack/openstack-ansible-tests
46 dest: ${WORKING_DIR}/tests/common
47EOF
48
49}
50
51## Main ----------------------------------------------------------------------
52
53# If zuul-cloner is present, use it so that we
54# also include any dependent patches from the
55# tests repo noted in the commit message.
56# We only want to use zuul-cloner if we detect
57# zuul v2 running, so we check for the presence
58# of the ZUUL_REF environment variable.
59# ref: http://git.openstack.org/cgit/openstack-infra/zuul/tree/zuul/ansible/filter/zuul_filters.py?h=feature/zuulv3#n17
60if [[ -x /usr/zuul-env/bin/zuul-cloner ]] && [[ "${ZUUL_REF:-none}" != "none" ]]; then
61
62 # Prepare the clonemap for zuul-cloner to use
63 create_tests_clonemap
64
65 # Execute the clone
66 /usr/zuul-env/bin/zuul-cloner \
67 --cache-dir /opt/git \
68 --map ${TESTING_HOME}/tests-clonemap.yaml \
69 git://git.openstack.org \
70 openstack/openstack-ansible-tests
71
72 # Clean up the clonemap.
73 rm -f ${TESTING_HOME}/tests-clonemap.yaml
74
75# Alternatively, use a simple git-clone. We do
76# not re-clone if the directory exists already
77# to prevent overwriting any local changes which
78# may have been made.
79elif [[ ! -d tests/common ]]; then
80
81 # The tests repo doesn't need a clone, we can just
82 # symlink it. As zuul v3 clones into a folder called
83 # 'workspace' we have to use one of its environment
84 # variables to determine the project name.
85 if [[ "${ZUUL_SHORT_PROJECT_NAME:-none}" == "openstack-ansible-tests" ]] ||\
86 [[ "$(basename ${WORKING_DIR})" == "openstack-ansible-tests" ]]; then
87 ln -s ${WORKING_DIR} ${WORKING_DIR}/tests/common
88
89 # In zuul v3 any dependent repository is placed into
90 # /home/zuul/src/git.openstack.org, so we check to see
91 # if there is a tests checkout there already. If so, we
92 # symlink that and use it.
93 elif [[ -d "${ZUUL_TESTS_CLONE_LOCATION}" ]]; then
94 ln -s "${ZUUL_TESTS_CLONE_LOCATION}" ${WORKING_DIR}/tests/common
95
96 # Otherwise we're clearly not in zuul or using a previously setup
97 # repo in some way, so just clone it from upstream.
98 else
99 git clone \
100 https://git.openstack.org/openstack/openstack-ansible-tests \
101 ${WORKING_DIR}/tests/common
102 fi
103fi
104
105# If this test set includes an upgrade test, the
106# previous stable release tests repo must also be
107# cloned.
108# Note:
109# Dependent patches to the previous stable release
110# tests repo are not supported.
111if [[ "${CLONE_UPGRADE_TESTS}" == "yes" ]]; then
112 if [[ ! -d "${WORKING_DIR}/tests/common/previous" ]]; then
113 git clone -b stable/queens \
114 https://git.openstack.org/openstack/openstack-ansible-tests \
115 ${WORKING_DIR}/tests/common/previous
116 fi
117fi
diff --git a/tox.ini b/tox.ini
index b444e34..9996e8d 100644
--- a/tox.ini
+++ b/tox.ini
@@ -58,7 +58,6 @@ commands =
58 58
59[testenv:pep8] 59[testenv:pep8]
60commands = 60commands =
61 bash -c "{toxinidir}/tests/tests-repo-clone.sh"
62 bash -c "{toxinidir}/tests/common/test-pep8.sh" 61 bash -c "{toxinidir}/tests/common/test-pep8.sh"
63 62
64 63
@@ -72,7 +71,6 @@ ignore=F403,H303
72 71
73[testenv:bashate] 72[testenv:bashate]
74commands = 73commands =
75 bash -c "{toxinidir}/tests/tests-repo-clone.sh"
76 bash -c "{toxinidir}/tests/common/test-bashate.sh" 74 bash -c "{toxinidir}/tests/common/test-bashate.sh"
77 75
78 76
@@ -87,7 +85,6 @@ deps =
87deps = 85deps =
88 {[testenv:ansible]deps} 86 {[testenv:ansible]deps}
89commands = 87commands =
90 bash -c "{toxinidir}/tests/tests-repo-clone.sh"
91 bash -c "{toxinidir}/tests/common/test-ansible-syntax.sh" 88 bash -c "{toxinidir}/tests/common/test-ansible-syntax.sh"
92 89
93 90
@@ -95,7 +92,6 @@ commands =
95deps = 92deps =
96 {[testenv:ansible]deps} 93 {[testenv:ansible]deps}
97commands = 94commands =
98 bash -c "{toxinidir}/tests/tests-repo-clone.sh"
99 bash -c "{toxinidir}/tests/common/test-ansible-lint.sh" 95 bash -c "{toxinidir}/tests/common/test-ansible-lint.sh"
100 96
101 97
@@ -103,7 +99,6 @@ commands =
103deps = 99deps =
104 {[testenv:ansible]deps} 100 {[testenv:ansible]deps}
105commands = 101commands =
106 bash -c "{toxinidir}/tests/tests-repo-clone.sh"
107 bash -c "{toxinidir}/tests/common/test-ansible-functional.sh" 102 bash -c "{toxinidir}/tests/common/test-ansible-functional.sh"
108 103
109 104