Convert tox to native zuul
This change implements a native zuul runner for all role tests. The change will now run role tests, executing molecule, in the same was as tripleo-ansible. To ensure we're passing lint checks, several files have been updated to resolve lint issues which are now more strict due to the pre-commit changes. Scripts have been added to allow developers to run molecule tests on local environments. These tools will allow developers to mimic the upstream test process locally. Change-Id: I07bbcc0b331aa89dafdae5978ea2bb4859a59143 Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
This commit is contained in:
parent
741b36362d
commit
4908e1647f
|
@ -11,7 +11,7 @@ repos:
|
|||
- id: check-merge-conflict
|
||||
- id: debug-statements
|
||||
- id: flake8
|
||||
entry: flake8 --ignore=E123,E125,W503,W504,W605
|
||||
entry: flake8 --ignore=E24,E121,E122,E123,E124,E126,E226,E265,E305,E402,F401,F405,E501,E704,F403,F841,W503,W605
|
||||
- id: check-yaml
|
||||
files: .*\.(yaml|yml)$
|
||||
- repo: https://github.com/adrienverge/yamllint.git
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
export TRIPLEO_VALIDATIONS_WORKPATH="$(dirname $(readlink -f ${BASH_SOURCE[0]}))"
|
||||
export ANSIBLE_STDOUT_CALLBACK=debug
|
||||
export ANSIBLE_CALLBACK_PLUGINS="${TRIPLEO_VALIDATIONS_WORKPATH}/callback_plugins"
|
||||
export ANSIBLE_LIBRARY="${TRIPLEO_VALIDATIONS_WORKPATH}/library"
|
||||
export ANSIBLE_LOOKUP_PLUGINS="${TRIPLEO_VALIDATIONS_WORKPATH}/lookup_plugins"
|
||||
export ANSIBLE_ROLES_PATH="${TRIPLEO_VALIDATIONS_WORKPATH}/roles"
|
||||
export ANSIBLE_INVENTORY="${TRIPLEO_VALIDATIONS_WORKPATH}/tests/hosts.ini"
|
||||
export ANSIBLE_RETRY_FILES_ENABLED="0"
|
||||
export ANSIBLE_LOAD_CALLBACK_PLUGINS="1"
|
||||
export ANSIBLE_HOST_KEY_CHECKING=False
|
||||
|
||||
function unset-ansible-test-env {
|
||||
for i in $(env | grep ANSIBLE_ | awk -F'=' '{print $1}'); do
|
||||
unset ${i}
|
||||
done
|
||||
unset TRIPLEO_VALIDATIONS_WORKPATH
|
||||
echo -e "Ansible test environment deactivated.\n"
|
||||
unset -f unset-ansible-test-env
|
||||
}
|
||||
|
||||
echo -e "Ansible test environment is now active"
|
||||
echo -e "Run 'unset-ansible-test-env' to deactivate.\n"
|
|
@ -175,8 +175,9 @@ class CallbackModule(CallbackBase):
|
|||
|
||||
def v2_playbook_on_stats(self, stats):
|
||||
def failed(host):
|
||||
return (stats.summarize(host).get('failures', 0) > 0 or
|
||||
stats.summarize(host).get('unreachable', 0) > 0)
|
||||
_failures = stats.summarize(host).get('failures', 0) > 0
|
||||
_unreachable = stats.summarize(host).get('unreachable', 0) > 0
|
||||
return (_failures or _unreachable)
|
||||
|
||||
hosts = sorted(stats.processed.keys())
|
||||
failed_hosts = [host for host in hosts if failed(host)]
|
||||
|
|
|
@ -524,3 +524,37 @@ will perform the basic tasks noted above.
|
|||
|
||||
$ cd tripleo-validations/
|
||||
$ ansible-playbook -i localhost, role-addition.yml -e role_name=${NEWROLENAME}
|
||||
|
||||
When the role is ready for CI, add a **job** entry into the
|
||||
`zuul.d/molecule.yaml`.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
- job:
|
||||
files:
|
||||
- ^roles/${NEWROLENAME}/.*
|
||||
name: tripleo-validations-centos-7-molecule-${NEWROLENAME}
|
||||
parent: tripleo-validations-centos-7-base
|
||||
vars:
|
||||
tripleo_validations_role_name: ${NEWROLENAME}
|
||||
|
||||
|
||||
Make sure to add the **job** name into the check and gate section at the top
|
||||
of the `molecule.yaml` file.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
- project:
|
||||
check:
|
||||
jobs:
|
||||
- tripleo-validations-centos-7-molecule-${NEWROLENAME}
|
||||
gate:
|
||||
jobs:
|
||||
- tripleo-validations-centos-7-molecule-${NEWROLENAME}
|
||||
|
||||
|
||||
Finally add a role documentation file at
|
||||
`doc/source/roles/role-${NEWROLENAME}.rst`. This file will need to contain
|
||||
a title, a literal include of the defaults yaml and a literal include of
|
||||
the molecule playbook, or playbooks, used to test the role, which is noted
|
||||
as an "example" playbook.
|
||||
|
|
|
@ -34,6 +34,51 @@
|
|||
args:
|
||||
creates: "roles/{{ role_name }}"
|
||||
|
||||
- name: Read zuul molecule file
|
||||
slurp:
|
||||
src: zuul.d/molecule.yaml
|
||||
register: molecule_yaml
|
||||
|
||||
- name: Create molecule entry
|
||||
copy:
|
||||
content: |-
|
||||
---
|
||||
{% set items = molecule_yaml['content'] | b64decode | from_yaml %}
|
||||
{% set job_index = [] %}
|
||||
{% set new_job_name = "tripleo-validations-centos-7-molecule-" ~ role_name %}
|
||||
{% for item in items %}
|
||||
{% if 'project-template' in item %}
|
||||
{% if item['project-template']['name'] == "tripleo-validations-molecule-jobs" %}
|
||||
{% if not (new_job_name in item['project-template']['check']['jobs']) %}
|
||||
{% set _ = item['project-template']['check']['jobs'].append(new_job_name) %}
|
||||
{% endif %}
|
||||
{% if not (new_job_name in item['project-template']['gate']['jobs']) %}
|
||||
{% set _ = item['project-template']['gate']['jobs'].append(new_job_name) %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% if item['job']['name'] == new_job_name %}
|
||||
{% set _ = job_index.append(new_job_name) %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% if (job_index | length) < 1 %}
|
||||
{% set new_job = {
|
||||
"name": new_job_name,
|
||||
"parent": "tripleo-validations-centos-7-base",
|
||||
"files": [
|
||||
"^roles/" ~ role_name ~ "/.*"
|
||||
],
|
||||
"vars": {
|
||||
"tripleo_validations_role_name": role_name
|
||||
}
|
||||
}
|
||||
%}
|
||||
{% set _ = items.append({"job": new_job}) %}
|
||||
{% endif %}
|
||||
{{ items | to_nice_yaml(indent=2, width=1337) }}
|
||||
dest: zuul.d/molecule.yaml
|
||||
|
||||
- name: Create role documentation
|
||||
copy:
|
||||
content: |
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
systemctl list-units --failed --plain --no-legend --no-pager |
|
||||
awk '{print $1}'
|
||||
register: systemd_status
|
||||
changed_when: False
|
||||
|
||||
- name: Fails if we find failed units
|
||||
assert:
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
#!/usr/bin/env bash
|
||||
# Copyright 2019 Red Hat, Inc.
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# 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.
|
||||
|
||||
|
||||
## Shell Opts ----------------------------------------------------------------
|
||||
|
||||
set -o pipefail
|
||||
set -xeuo
|
||||
|
||||
|
||||
## Vars ----------------------------------------------------------------------
|
||||
|
||||
export BINDEP_FILE="${BINDEP_FILE:-$(dirname $(readlink -f ${BASH_SOURCE[0]}))/../bindep.txt}"
|
||||
|
||||
|
||||
## Main ----------------------------------------------------------------------
|
||||
|
||||
# Source distribution information
|
||||
source /etc/os-release || source /usr/lib/os-release
|
||||
RHT_PKG_MGR=$(command -v dnf || command -v yum)
|
||||
|
||||
# NOTE(cloudnull): Get a list of packages to install with bindep. If packages
|
||||
# need to be installed, bindep exits with an exit code of 1.
|
||||
BINDEP_PKGS=$(bindep -b -f "${BINDEP_FILE}" test || true)
|
||||
|
||||
if [[ ${#BINDEP_PKGS} > 0 ]]; then
|
||||
case "${ID,,}" in
|
||||
amzn|rhel|centos|fedora)
|
||||
sudo "${RHT_PKG_MGR}" install -y ${BINDEP_PKGS}
|
||||
;;
|
||||
esac
|
||||
fi
|
|
@ -0,0 +1,70 @@
|
|||
#!/usr/bin/env bash
|
||||
# Copyright 2019 Red Hat, Inc.
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# 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.
|
||||
|
||||
|
||||
## Shell Opts ----------------------------------------------------------------
|
||||
|
||||
set -o pipefail
|
||||
set -xeuo
|
||||
|
||||
## Vars ----------------------------------------------------------------------
|
||||
|
||||
export PROJECT_DIR="$(dirname $(readlink -f ${BASH_SOURCE[0]}))/../"
|
||||
export ROLE_NAME="${ROLE_NAME:-$1}"
|
||||
export TRIPLEO_JOB_ANSIBLE_ARGS=${TRIPLEO_JOB_ANSIBLE_ARGS:-"-v"}
|
||||
|
||||
## Main ----------------------------------------------------------------------
|
||||
|
||||
# Source distribution information
|
||||
source /etc/os-release || source /usr/lib/os-release
|
||||
RHT_PKG_MGR=$(command -v dnf || command -v yum)
|
||||
PYTHON_EXEC=$(command -v python3 || command -v python)
|
||||
|
||||
# Install the one requirement we need to run any local test
|
||||
case "${ID,,}" in
|
||||
amzn|rhel|centos|fedora)
|
||||
sudo "${RHT_PKG_MGR}" install -y python*-virtualenv
|
||||
;;
|
||||
esac
|
||||
|
||||
# Create a virtual env
|
||||
"${PYTHON_EXEC}" -m virtualenv --system-site-packages "${HOME}/test-python"
|
||||
|
||||
# Run bindep
|
||||
"${HOME}/test-python/bin/pip" install pip setuptools bindep --upgrade
|
||||
"${PROJECT_DIR}/scripts/bindep-install"
|
||||
|
||||
# Install local requirements
|
||||
if [[ -d "${HOME}/.cache/pip/wheels" ]]; then
|
||||
rm -rf "${HOME}/.cache/pip/wheels"
|
||||
fi
|
||||
"${HOME}/test-python/bin/pip" install \
|
||||
-r "${PROJECT_DIR}/requirements.txt" \
|
||||
-r "${PROJECT_DIR}/test-requirements.txt" \
|
||||
-r "${PROJECT_DIR}/molecule-requirements.txt"
|
||||
|
||||
# Run local test
|
||||
PS1="[\u@\h \W]\$" source "${HOME}/test-python/bin/activate"
|
||||
source "${PROJECT_DIR}/ansible-test-env.rc"
|
||||
export ANSIBLE_ROLES_PATH="${ANSIBLE_ROLES_PATH}:${HOME}/zuul-jobs/roles"
|
||||
ansible-playbook -i "${PROJECT_DIR}/tests/hosts.ini" \
|
||||
-e "tripleo_src=$(realpath --relative-to="${HOME}" "${PROJECT_DIR}")" \
|
||||
-e "tripleo_validations_role_name=${ROLE_NAME}" \
|
||||
-e "tripleo_job_ansible_args='${TRIPLEO_JOB_ANSIBLE_ARGS}'" \
|
||||
-e "ansible_user=${USER}" \
|
||||
-e "ansible_user_dir=${HOME}" \
|
||||
"${PROJECT_DIR}/tests/prepare-test-host.yml" \
|
||||
"${PROJECT_DIR}/zuul.d/playbooks/run-local.yml"
|
|
@ -0,0 +1,18 @@
|
|||
# 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.
|
||||
|
||||
|
||||
def pytest_addoption(parser):
|
||||
parser.addoption('--scenario', help='scenario setting')
|
||||
parser.addoption(
|
||||
'--ansible-args', help='ansible args passed into test runner.')
|
|
@ -0,0 +1 @@
|
|||
test ansible_connection=local ansible_host=localhost
|
|
@ -0,0 +1,68 @@
|
|||
---
|
||||
# Copyright 2019 Red Hat, Inc.
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# 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.
|
||||
|
||||
|
||||
- name: pre prepare
|
||||
hosts: all
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: set basic user fact
|
||||
fail:
|
||||
msg: >-
|
||||
The variable `ansible_user` set this option and try again. On the
|
||||
CLI this can be defined with "-e ansible_user=${USER}"
|
||||
when:
|
||||
- ansible_user is undefined
|
||||
|
||||
- name: set basic home fact
|
||||
fail:
|
||||
msg: >-
|
||||
The variable `ansible_user_dir` set this option and try again. On
|
||||
the CLI this can be defined with "-e ansible_user_dir=${HOME}"
|
||||
when:
|
||||
- ansible_user_dir is undefined
|
||||
|
||||
- name: Ensure the user has a .ssh directory
|
||||
file:
|
||||
path: "{{ ansible_user_dir }}/.ssh"
|
||||
state: directory
|
||||
owner: "{{ ansible_user }}"
|
||||
group: "{{ ansible_user }}"
|
||||
mode: "0700"
|
||||
|
||||
- name: Create ssh key pair
|
||||
user:
|
||||
name: "{{ ansible_user }}"
|
||||
generate_ssh_key: true
|
||||
ssh_key_bits: 2048
|
||||
ssh_key_file: "{{ ansible_user_dir }}/.ssh/id_rsa"
|
||||
|
||||
- name: Slurp pub key
|
||||
slurp:
|
||||
src: "{{ ansible_user_dir ~ '/.ssh/id_rsa.pub' }}"
|
||||
register: pub_key
|
||||
|
||||
- name: Ensure can ssh to can connect to localhost
|
||||
authorized_key:
|
||||
user: "{{ ansible_user }}"
|
||||
key: "{{ pub_key['content'] | b64decode }}"
|
||||
|
||||
- name: Get the zuul/zuul-jobs repo
|
||||
git:
|
||||
repo: https://opendev.org/zuul/zuul-jobs
|
||||
dest: "{{ ansible_user_dir }}/zuul-jobs"
|
||||
version: master
|
||||
force: true
|
|
@ -0,0 +1,44 @@
|
|||
# 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.
|
||||
|
||||
|
||||
import pytest
|
||||
import subprocess
|
||||
|
||||
|
||||
def test_molecule(pytestconfig):
|
||||
cmd = ['python', '-m', 'molecule']
|
||||
scenario = pytestconfig.getoption("scenario")
|
||||
ansible_args = pytestconfig.getoption("ansible_args")
|
||||
|
||||
if ansible_args:
|
||||
cmd.append('converge')
|
||||
if scenario:
|
||||
cmd.extend(['--scenario-name', scenario])
|
||||
cmd.append('--')
|
||||
cmd.extend(ansible_args.split())
|
||||
else:
|
||||
cmd.append('test')
|
||||
if scenario:
|
||||
cmd.extend(['--scenario-name', scenario])
|
||||
else:
|
||||
cmd.append('--all')
|
||||
|
||||
try:
|
||||
assert subprocess.call(cmd) == 0
|
||||
finally:
|
||||
if ansible_args:
|
||||
cmd = ['python', '-m', 'molecule', 'destroy']
|
||||
if scenario:
|
||||
cmd.extend(['--scenario-name', scenario])
|
||||
subprocess.call(cmd)
|
19
tox.ini
19
tox.ini
|
@ -86,7 +86,6 @@ deps =
|
|||
-r {toxinidir}/test-requirements.txt
|
||||
-r {toxinidir}/molecule-requirements.txt
|
||||
commands =
|
||||
{[testenv:pep8]commands}
|
||||
{[testenv:ansible-lint]commands}
|
||||
{[testenv:bashate]commands}
|
||||
{[testenv:whitespace]commands}
|
||||
|
@ -121,24 +120,6 @@ commands=
|
|||
extensions = .rst
|
||||
ignore = D001
|
||||
|
||||
[testenv:venv]
|
||||
commands = {posargs}
|
||||
|
||||
[testenv:molecule]
|
||||
deps =
|
||||
ansi2html
|
||||
docker>=3.7
|
||||
mock
|
||||
molecule>=2.22rc3
|
||||
pytest
|
||||
pytest-cov
|
||||
pytest-html
|
||||
pytest-molecule>=1.0rc1
|
||||
pytest-xdist
|
||||
selinux
|
||||
commands =
|
||||
python -m pytest --color=yes --html={envlogdir}/reports.html --self-contained-html {tty:-s} {posargs:roles}
|
||||
|
||||
[testenv:lower-constraints]
|
||||
basepython = python3
|
||||
deps =
|
||||
|
|
|
@ -59,10 +59,14 @@ class TestIPRange(base.TestCase):
|
|||
'''Test ip_range when range is less than minimal'''
|
||||
errors = validation.check_IP_range('192.168.0.1', '192.168.0.5', 6)
|
||||
self.assertEqual(len(errors), 2)
|
||||
self.assertEqual('The IP range 192.168.0.1 - 192.168.0.5 ' +
|
||||
'contains 5 addresses.', errors[0])
|
||||
self.assertEqual('This might not be enough for the deployment ' +
|
||||
'or later scaling.', errors[1])
|
||||
self.assertEqual(
|
||||
'The IP range 192.168.0.1 - 192.168.0.5 contains 5 addresses.',
|
||||
errors[0]
|
||||
)
|
||||
self.assertEqual(
|
||||
'This might not be enough for the deployment or later scaling.',
|
||||
errors[1]
|
||||
)
|
||||
|
||||
def test_check_lower_bound_greater_than_upper(self):
|
||||
"""Test ip_range when lower IP bound is greater than upper"""
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
---
|
||||
- job:
|
||||
description: Base tripleo-validations job
|
||||
name: tripleo-validations-centos-7-base
|
||||
nodeset: centos-7
|
||||
parent: base
|
||||
success-url: "reports.html"
|
||||
failure-url: "reports.html"
|
||||
pre-run:
|
||||
- tests/prepare-test-host.yml
|
||||
- zuul.d/playbooks/pre.yml
|
||||
run:
|
||||
- zuul.d/playbooks/run.yml
|
||||
timeout: 1800
|
||||
voting: true
|
||||
- job:
|
||||
files:
|
||||
- ^doc/.*
|
||||
- ^README.rst
|
||||
name: tripleo-validations-docs
|
||||
parent: openstack-tox-docs
|
|
@ -1,20 +1,27 @@
|
|||
- project:
|
||||
templates:
|
||||
- tripleo-multinode-container-minimal
|
||||
- openstack-python-jobs
|
||||
- openstack-python3-train-jobs
|
||||
- check-requirements
|
||||
- publish-openstack-docs-pti
|
||||
- release-notes-jobs-python3
|
||||
- tripleo-multinode-container-minimal
|
||||
- openstack-python-jobs
|
||||
- openstack-python3-train-jobs
|
||||
- tripleo-validations-molecule-jobs
|
||||
- check-requirements
|
||||
- release-notes-jobs-python3
|
||||
check:
|
||||
jobs:
|
||||
- openstack-tox-lower-constraints
|
||||
- tripleo-ci-centos-7-scenario004-standalone:
|
||||
files:
|
||||
- ^roles/ceph.*$
|
||||
- openstack-tox-linters
|
||||
- tripleo-validations-docs
|
||||
- openstack-tox-lower-constraints
|
||||
- tripleo-ci-centos-7-scenario004-standalone:
|
||||
files:
|
||||
- ^roles/ceph.*$
|
||||
gate:
|
||||
jobs:
|
||||
- openstack-tox-lower-constraints
|
||||
- tripleo-ci-centos-7-scenario004-standalone:
|
||||
files:
|
||||
- ^roles/ceph.*$
|
||||
- openstack-tox-linters
|
||||
- tripleo-validations-docs
|
||||
- openstack-tox-lower-constraints
|
||||
- tripleo-ci-centos-7-scenario004-standalone:
|
||||
files:
|
||||
- ^roles/ceph.*$
|
||||
post:
|
||||
jobs:
|
||||
- publish-openstack-tox-docs
|
||||
|
|
|
@ -0,0 +1,109 @@
|
|||
---
|
||||
- project-template:
|
||||
check:
|
||||
queue: integrated
|
||||
jobs:
|
||||
- tripleo-validations-centos-7-molecule-controller-token
|
||||
- tripleo-validations-centos-7-molecule-controller-ulimits
|
||||
- tripleo-validations-centos-7-molecule-ctlplane-ip-range
|
||||
- tripleo-validations-centos-7-molecule-dns
|
||||
- tripleo-validations-centos-7-molecule-haproxy
|
||||
- tripleo-validations-centos-7-molecule-repos
|
||||
- tripleo-validations-centos-7-molecule-undercloud-cpu
|
||||
- tripleo-validations-centos-7-molecule-undercloud-ram
|
||||
- tripleo-validations-centos-7-molecule-undercloud-debug
|
||||
- tripleo-validations-centos-7-molecule-undercloud-disk-space
|
||||
- tripleo-validations-centos-7-molecule-xfs-check-ftype
|
||||
gate:
|
||||
queue: integrated
|
||||
jobs:
|
||||
- tripleo-validations-centos-7-molecule-controller-token
|
||||
- tripleo-validations-centos-7-molecule-controller-ulimits
|
||||
- tripleo-validations-centos-7-molecule-ctlplane-ip-range
|
||||
- tripleo-validations-centos-7-molecule-dns
|
||||
- tripleo-validations-centos-7-molecule-haproxy
|
||||
- tripleo-validations-centos-7-molecule-repos
|
||||
- tripleo-validations-centos-7-molecule-undercloud-cpu
|
||||
- tripleo-validations-centos-7-molecule-undercloud-ram
|
||||
- tripleo-validations-centos-7-molecule-undercloud-debug
|
||||
- tripleo-validations-centos-7-molecule-undercloud-disk-space
|
||||
- tripleo-validations-centos-7-molecule-xfs-check-ftype
|
||||
name: tripleo-validations-molecule-jobs
|
||||
- job:
|
||||
files:
|
||||
- ^roles/controller-token/.*
|
||||
name: tripleo-validations-centos-7-molecule-controller-token
|
||||
parent: tripleo-validations-centos-7-base
|
||||
vars:
|
||||
tripleo_validations_role_name: controller-token
|
||||
- job:
|
||||
files:
|
||||
- ^roles/controller-ulimits/.*
|
||||
name: tripleo-validations-centos-7-molecule-controller-ulimits
|
||||
parent: tripleo-validations-centos-7-base
|
||||
vars:
|
||||
tripleo_validations_role_name: controller-ulimits
|
||||
- job:
|
||||
files:
|
||||
- ^roles/ctlplane-ip-range/.*
|
||||
name: tripleo-validations-centos-7-molecule-ctlplane-ip-range
|
||||
parent: tripleo-validations-centos-7-base
|
||||
vars:
|
||||
tripleo_validations_role_name: ctlplane-ip-range
|
||||
- job:
|
||||
files:
|
||||
- ^roles/dns/.*
|
||||
name: tripleo-validations-centos-7-molecule-dns
|
||||
parent: tripleo-validations-centos-7-base
|
||||
vars:
|
||||
tripleo_validations_role_name: dns
|
||||
- job:
|
||||
files:
|
||||
- ^roles/haproxy/.*
|
||||
name: tripleo-validations-centos-7-molecule-haproxy
|
||||
parent: tripleo-validations-centos-7-base
|
||||
vars:
|
||||
tripleo_validations_role_name: haproxy
|
||||
- job:
|
||||
files:
|
||||
- ^roles/repos/.*
|
||||
name: tripleo-validations-centos-7-molecule-repos
|
||||
parent: tripleo-validations-centos-7-base
|
||||
vars:
|
||||
tripleo_validations_role_name: repos
|
||||
- job:
|
||||
files:
|
||||
- ^roles/undercloud-cpu/.*
|
||||
name: tripleo-validations-centos-7-molecule-undercloud-cpu
|
||||
parent: tripleo-validations-centos-7-base
|
||||
vars:
|
||||
tripleo_validations_role_name: undercloud-cpu
|
||||
- job:
|
||||
files:
|
||||
- ^roles/undercloud-ram/.*
|
||||
name: tripleo-validations-centos-7-molecule-undercloud-ram
|
||||
parent: tripleo-validations-centos-7-base
|
||||
vars:
|
||||
tripleo_validations_role_name: undercloud-ram
|
||||
- job:
|
||||
files:
|
||||
- ^roles/undercloud-debug/.*
|
||||
name: tripleo-validations-centos-7-molecule-undercloud-debug
|
||||
parent: tripleo-validations-centos-7-base
|
||||
vars:
|
||||
tripleo_validations_role_name: undercloud-debug
|
||||
- job:
|
||||
files:
|
||||
- ^roles/undercloud-disk-space/.*
|
||||
name: tripleo-validations-centos-7-molecule-undercloud-disk-space
|
||||
parent: tripleo-validations-centos-7-base
|
||||
vars:
|
||||
tripleo_validations_role_name: undercloud-disk-space
|
||||
- job:
|
||||
files:
|
||||
- ^roles/xfs-check-ftype/.*
|
||||
name: tripleo-validations-centos-7-molecule-xfs-check-ftype
|
||||
parent: tripleo-validations-centos-7-base
|
||||
voting: false
|
||||
vars:
|
||||
tripleo_validations_role_name: xfs-check-ftype
|
|
@ -0,0 +1,28 @@
|
|||
---
|
||||
- hosts: all
|
||||
pre_tasks:
|
||||
- name: Ensure output dirs
|
||||
file:
|
||||
path: "{{ ansible_user_dir }}/zuul-output/logs"
|
||||
state: directory
|
||||
|
||||
- name: Setup bindep
|
||||
pip:
|
||||
name: "bindep"
|
||||
virtualenv: "{{ ansible_user_dir }}/test-python"
|
||||
virtualenv_site_packages: true
|
||||
|
||||
- name: Run bindep
|
||||
shell: |-
|
||||
. {{ ansible_user_dir }}/test-python/bin/activate
|
||||
{{ ansible_user_dir }}/{{ zuul.project.src_dir }}/scripts/bindep-install
|
||||
become: true
|
||||
changed_when: False
|
||||
|
||||
- name: Setup test-python
|
||||
pip:
|
||||
requirements: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}/molecule-requirements.txt"
|
||||
virtualenv: "{{ ansible_user_dir }}/test-python"
|
||||
virtualenv_site_packages: true
|
||||
roles:
|
||||
- role: install-docker
|
|
@ -0,0 +1,13 @@
|
|||
---
|
||||
- hosts: all
|
||||
tasks:
|
||||
- name: set basic zuul fact
|
||||
set_fact:
|
||||
zuul:
|
||||
project:
|
||||
src_dir: "{{ tripleo_src }}"
|
||||
ansible_connection: ssh
|
||||
|
||||
- import_playbook: pre.yml
|
||||
|
||||
- import_playbook: run.yml
|
|
@ -0,0 +1,19 @@
|
|||
---
|
||||
|
||||
- hosts: all
|
||||
environment:
|
||||
ANSIBLE_LOG_PATH: "{{ ansible_user_dir }}/zuul-output/logs/ansible-execution.log"
|
||||
tasks:
|
||||
- name: Run role test job
|
||||
shell: |-
|
||||
. {{ ansible_user_dir }}/test-python/bin/activate
|
||||
. {{ ansible_user_dir }}/{{ zuul.project.src_dir }}/ansible-test-env.rc
|
||||
pytest --color=no \
|
||||
--html={{ ansible_user_dir }}/zuul-output/logs/reports.html \
|
||||
--self-contained-html \
|
||||
--ansible-args='{{ tripleo_job_ansible_args | default("-v") }}' \
|
||||
{{ ansible_user_dir }}/{{ zuul.project.src_dir }}/tests/test_molecule.py
|
||||
args:
|
||||
chdir: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}/roles/{{ tripleo_validations_role_name }}"
|
||||
executable: /bin/bash
|
||||
changed_when: False
|
Loading…
Reference in New Issue