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: Iafe9f3622037d7ba71f9ba8b73217f9e2070f246
This commit is contained in:
Jesse Pretorius 2017-10-16 21:42:24 +01:00
parent b58a2c0287
commit ac930796d6
7 changed files with 145 additions and 19 deletions

View File

@ -186,8 +186,10 @@
git_roles: >
{%- set filtered_role_list = [] %}
{%- for role in osa_roles %}
{%- if role['src'] | regex_replace('https://git.openstack.org/', '') not in zuul_src_repo_list %}
{%- set _ = filtered_role_list.append(role) %}
{%- if (role['name'] | match('os_previous_.*')) or
(role['name'] | match('previous_.*')) or
(role['src'] | regex_replace('https://git.openstack.org/', '') not in zuul_src_repo_list) %}
{%- set _ = filtered_role_list.append(role) %}
{%- endif %}
{%- endfor %}
{{- filtered_role_list -}}

View File

@ -49,24 +49,12 @@ install_pkg_deps() {
eval sudo $pkg_mgr_cmd $pkg_deps
}
git_clone_repo() {
if [[ ! -d tests/common ]]; then
# The tests repo doesn't need a clone, we can just
# symlink it.
if [[ "$(basename ${WORKING_DIR})" == "openstack-ansible-tests" ]]; then
ln -s ${WORKING_DIR} ${WORKING_DIR}/tests/common
else
git clone \
https://git.openstack.org/openstack/openstack-ansible-tests \
tests/common
fi
fi
}
# Install the host distro package dependencies
install_pkg_deps
git_clone_repo
# Clone the tests repo for access to the common test script
source tests/tests-repo-clone.sh
# start executing the main test script
# Execute the common test script
source tests/common/run_tests_common.sh

View File

@ -156,7 +156,7 @@ if [ ! -d "${ANSIBLE_ROLE_DIR}" ] && [ -f "${ANSIBLE_ROLE_REQUIREMENTS_PATH}" ];
ansible-playbook -i ${ANSIBLE_INVENTORY} \
${COMMON_TESTS_PATH}/get-ansible-role-requirements.yml \
-e "toxinidir=${WORKING_DIR} homedir=${TESTING_HOME}" \
-vvv
-v
fi

View File

@ -33,6 +33,7 @@ set -e
export TESTING_HOME=${TESTING_HOME:-$HOME}
export WORKING_DIR=${WORKING_DIR:-$(pwd)}
export CLONE_UPGRADE_TESTS=${CLONE_UPGRADE_TESTS:-no}
export ZUUL_TESTS_CLONE_LOCATION="/home/zuul/src/git.openstack.org/openstack/openstack-ansible-tests"
## Functions -----------------------------------------------------------------
@ -84,6 +85,16 @@ elif [[ ! -d tests/common ]]; then
if [[ "${ZUUL_SHORT_PROJECT_NAME:-none}" == "openstack-ansible-tests" ]] ||\
[[ "$(basename ${WORKING_DIR})" == "openstack-ansible-tests" ]]; then
ln -s ${WORKING_DIR} ${WORKING_DIR}/tests/common
# In zuul v3 any dependent repository is placed into
# /home/zuul/src/git.openstack.org, so we check to see
# if there is a tests checkout there already. If so, we
# symlink that and use it.
elif [[ -d "${ZUUL_TESTS_CLONE_LOCATION}" ]]; then
ln -s "${ZUUL_TESTS_CLONE_LOCATION}" ${WORKING_DIR}/tests/common
# Otherwise we're clearly not in zuul or using a previously setup
# repo in some way, so just clone it from upstream.
else
git clone \
https://git.openstack.org/openstack/openstack-ansible-tests \

74
zuul.d/jobs.yaml Normal file
View File

@ -0,0 +1,74 @@
---
# Copyright 2017, 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.
- job:
name: openstack-ansible-functional
parent: base
description: |
Run functional tests for an OpenStack-Ansible project.
Uses tox with the ``functional`` environment by default,
but the environment name can be changed through the use
of the ``scenario`` variable.
required-projects:
- name: openstack/requirements
irrelevant-files:
- ^\.git.*
- ^.*\.(example|md|rst)$
- ^deploy-guide/.*
- ^doc/.*
- ^releasenotes/.*
- ^setup\.(cfg|py)$
- ^tox.ini$
- ^Vagrantfile
timeout: 5400 # 90 mins
run: zuul.d/playbooks/run
vars:
tox_env: functional
- job:
name: openstack-ansible-upgrade
parent: openstack-ansible-functional
vars:
tox_env: upgrade
- job:
name: openstack-ansible-functional-ubuntu-xenial
parent: openstack-ansible-functional
nodeset: ubuntu-xenial
- job:
name: openstack-ansible-upgrade-ubuntu-xenial
parent: openstack-ansible-upgrade
nodeset: ubuntu-xenial
- job:
name: openstack-ansible-functional-opensuse-423
parent: openstack-ansible-functional
nodeset: opensuse-423
- job:
name: openstack-ansible-functional-opensuse-423-nv
parent: openstack-ansible-functional-opensuse-423
voting: false
- job:
name: openstack-ansible-functional-centos-7
parent: openstack-ansible-functional
nodeset: centos-7
- job:
name: openstack-ansible-functional-centos-7-nv
parent: openstack-ansible-functional-centos-7
voting: false

23
zuul.d/playbooks/run.yml Normal file
View File

@ -0,0 +1,23 @@
---
# Copyright 2017, 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.
- hosts: all
tasks:
- name: Run testing script
shell: |
./run_tests.sh {{ tox_env }}
args:
executable: "/bin/bash"
chdir: "{{ ansible_user_dir }}/src/{{ zuul.project.canonical_name }}"

28
zuul.d/project.yaml Normal file
View File

@ -0,0 +1,28 @@
---
# Copyright 2017, 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.
- project:
name: openstack/openstack-ansible-tests
check:
jobs:
- openstack-ansible-functional-centos-7
- openstack-ansible-functional-opensuse-423
- openstack-ansible-functional-ubuntu-xenial
gate:
queue: openstack-ansible
jobs:
- openstack-ansible-functional-centos-7
- openstack-ansible-functional-opensuse-423
- openstack-ansible-functional-ubuntu-xenial