Browse Source

Initial OSA zuul v3 role jobs

This patch implements an initial set of jobs intended to match
the current job execution method. It does not intend to improve
how the jobs are executed - only to replicate what is currently
in openstack-infra/openstack-zuul-jobs and provide the platform
to iterate on.

Change-Id: Iaee6f1c1836ee85770fd46a215e65cf2b2d517fa
tags/17.0.0.0b1
Jean-Philippe Evrard 1 year ago
parent
commit
89319fd345
5 changed files with 59 additions and 21 deletions
  1. 3
    1
      doc/source/conf.py
  2. 3
    1
      releasenotes/source/conf.py
  3. 4
    16
      run_tests.sh
  4. 21
    3
      tests/tests-repo-clone.sh
  5. 28
    0
      zuul.d/project.yaml

+ 3
- 1
doc/source/conf.py View File

@@ -70,7 +70,9 @@ target_name = 'openstack-ansible-' + role_name
70 70
 title = 'OpenStack-Ansible Documentation: ' + role_name + 'role'
71 71
 
72 72
 # The link to the browsable source code (for the left hand menu)
73
-oslosphinx_cgit_link = 'https://git.openstack.org/cgit/openstack/' + target_name
73
+oslosphinx_cgit_link = (
74
+    'https://git.openstack.org/cgit/openstack/{}'.format(target_name)
75
+)
74 76
 
75 77
 # The version info for the project you're documenting, acts as replacement for
76 78
 # |version| and |release|, also used in various other places throughout the

+ 3
- 1
releasenotes/source/conf.py View File

@@ -65,7 +65,9 @@ target_name = 'openstack-ansible-' + role_name
65 65
 title = 'OpenStack-Ansible Release Notes: ' + role_name + 'role'
66 66
 
67 67
 # The link to the browsable source code (for the left hand menu)
68
-oslosphinx_cgit_link = 'https://git.openstack.org/cgit/openstack/' + target_name
68
+oslosphinx_cgit_link = (
69
+    'https://git.openstack.org/cgit/openstack/{}'.format(target_name)
70
+)
69 71
 
70 72
 # The version info for the project you're documenting, acts as replacement for
71 73
 # |version| and |release|, also used in various other places throughout the

+ 4
- 16
run_tests.sh View File

@@ -49,24 +49,12 @@ install_pkg_deps() {
49 49
     eval sudo $pkg_mgr_cmd $pkg_deps
50 50
 }
51 51
 
52
-git_clone_repo() {
53
-    if [[ ! -d tests/common ]]; then
54
-        # The tests repo doesn't need a clone, we can just
55
-        # symlink it.
56
-        if [[ "$(basename ${WORKING_DIR})" == "openstack-ansible-tests" ]]; then
57
-            ln -s ${WORKING_DIR} ${WORKING_DIR}/tests/common
58
-        else
59
-            git clone \
60
-                https://git.openstack.org/openstack/openstack-ansible-tests \
61
-                tests/common
62
-        fi
63
-    fi
64
-}
65
-
52
+# Install the host distro package dependencies
66 53
 install_pkg_deps
67 54
 
68
-git_clone_repo
55
+# Clone the tests repo for access to the common test script
56
+source tests/tests-repo-clone.sh
69 57
 
70
-# start executing the main test script
58
+# Execute the common test script
71 59
 source tests/common/run_tests_common.sh
72 60
 

+ 21
- 3
tests/tests-repo-clone.sh View File

@@ -33,6 +33,7 @@ set -e
33 33
 export TESTING_HOME=${TESTING_HOME:-$HOME}
34 34
 export WORKING_DIR=${WORKING_DIR:-$(pwd)}
35 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"
36 37
 
37 38
 ## Functions -----------------------------------------------------------------
38 39
 
@@ -52,7 +53,11 @@ EOF
52 53
 # If zuul-cloner is present, use it so that we
53 54
 # also include any dependent patches from the
54 55
 # tests repo noted in the commit message.
55
-if [[ -x /usr/zuul-env/bin/zuul-cloner ]]; then
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
56 61
 
57 62
     # Prepare the clonemap for zuul-cloner to use
58 63
     create_tests_clonemap
@@ -74,9 +79,22 @@ if [[ -x /usr/zuul-env/bin/zuul-cloner ]]; then
74 79
 elif [[ ! -d tests/common ]]; then
75 80
 
76 81
     # The tests repo doesn't need a clone, we can just
77
-    # symlink it.
78
-    if [[ "$(basename ${WORKING_DIR})" == "openstack-ansible-tests" ]]; then
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
79 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.
80 98
     else
81 99
         git clone \
82 100
             https://git.openstack.org/openstack/openstack-ansible-tests \

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

@@ -0,0 +1,28 @@
1
+---
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
+- project:
17
+    name: openstack/openstack-ansible-memcached_server
18
+    check:
19
+      jobs:
20
+        - openstack-ansible-functional-centos-7
21
+        - openstack-ansible-functional-opensuse-423
22
+        - openstack-ansible-functional-ubuntu-xenial
23
+    gate:
24
+      queue: openstack-ansible
25
+      jobs:
26
+        - openstack-ansible-functional-centos-7
27
+        - openstack-ansible-functional-opensuse-423
28
+        - openstack-ansible-functional-ubuntu-xenial

Loading…
Cancel
Save