Browse Source

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: I433be60aac36892e5a4d6c4fd61755d6b1b4eac4
Jesse Pretorius 1 year ago
parent
commit
33f9b867d8
2 changed files with 0 additions and 122 deletions
  1. 0
    117
      tests/tests-repo-clone.sh
  2. 0
    5
      tox.ini

+ 0
- 117
tests/tests-repo-clone.sh View File

@@ -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
-
29
-set -e
30
-
31
-## Vars ----------------------------------------------------------------------
32
-
33
-export TESTING_HOME=${TESTING_HOME:-$HOME}
34
-export WORKING_DIR=${WORKING_DIR:-$(pwd)}
35
-export CLONE_UPGRADE_TESTS=${CLONE_UPGRADE_TESTS:-no}
36
-export ZUUL_TESTS_CLONE_LOCATION="/home/zuul/src/git.openstack.org/openstack/openstack-ansible-tests"
37
-
38
-## Functions -----------------------------------------------------------------
39
-
40
-function create_tests_clonemap {
41
-
42
-# Prepare the clonemap for zuul-cloner to use
43
-cat > ${TESTING_HOME}/tests-clonemap.yaml << EOF
44
-clonemap:
45
-  - name: openstack/openstack-ansible-tests
46
-    dest: ${WORKING_DIR}/tests/common
47
-EOF
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
60
-if [[ -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.
79
-elif [[ ! -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
103
-fi
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.
111
-if [[ "${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
117
-fi

+ 0
- 5
tox.ini View File

@@ -58,7 +58,6 @@ commands =
58 58
 
59 59
 [testenv:pep8]
60 60
 commands =
61
-    bash -c "{toxinidir}/tests/tests-repo-clone.sh"
62 61
     bash -c "{toxinidir}/tests/common/test-pep8.sh"
63 62
 
64 63
 
@@ -71,7 +70,6 @@ ignore=F403
71 70
 
72 71
 [testenv:bashate]
73 72
 commands =
74
-    bash -c "{toxinidir}/tests/tests-repo-clone.sh"
75 73
     bash -c "{toxinidir}/tests/common/test-bashate.sh"
76 74
 
77 75
 
@@ -86,7 +84,6 @@ deps =
86 84
 deps =
87 85
     {[testenv:ansible]deps}
88 86
 commands =
89
-    bash -c "{toxinidir}/tests/tests-repo-clone.sh"
90 87
     bash -c "{toxinidir}/tests/common/test-ansible-syntax.sh"
91 88
 
92 89
 
@@ -94,7 +91,6 @@ commands =
94 91
 deps =
95 92
     {[testenv:ansible]deps}
96 93
 commands =
97
-    bash -c "{toxinidir}/tests/tests-repo-clone.sh"
98 94
     bash -c "{toxinidir}/tests/common/test-ansible-lint.sh"
99 95
 
100 96
 
@@ -102,7 +98,6 @@ commands =
102 98
 deps =
103 99
     {[testenv:ansible]deps}
104 100
 commands =
105
-    bash -c "{toxinidir}/tests/tests-repo-clone.sh"
106 101
     bash -c "{toxinidir}/tests/common/test-ansible-functional.sh"
107 102
 
108 103
 

Loading…
Cancel
Save