Add zuul tests in-tree
This allows us to gate properly with windmill-jobs. Change-Id: I23a072da89791666bc711d785344ba88d206710c Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
parent
9b1db346a4
commit
da91ffc022
39
.zuul.yaml
Normal file
39
.zuul.yaml
Normal file
@ -0,0 +1,39 @@
|
||||
---
|
||||
- job:
|
||||
name: ansible-role-sudoers
|
||||
run: tests/playbooks/run.yaml
|
||||
roles:
|
||||
- zuul: openstack/ansible-role-sudoers
|
||||
|
||||
- job:
|
||||
name: ansible-role-sudoers-fedora-latest
|
||||
parent: ansible-role-sudoers
|
||||
nodeset: fedora-latest
|
||||
|
||||
- job:
|
||||
name: ansible-role-sudoers-ubuntu-bionic
|
||||
parent: ansible-role-sudoers
|
||||
nodeset: ubuntu-bionic
|
||||
|
||||
- job:
|
||||
name: ansible-role-sudoers-ubuntu-xenial
|
||||
parent: ansible-role-sudoers
|
||||
nodeset: ubuntu-xenial
|
||||
|
||||
- project:
|
||||
templates:
|
||||
- windmill-jobs-fedora-latest
|
||||
- windmill-jobs-bionic
|
||||
- windmill-jobs-xenial
|
||||
check:
|
||||
jobs:
|
||||
- ansible-role-sudoers-fedora-latest
|
||||
- ansible-role-sudoers-ubuntu-bionic
|
||||
- ansible-role-sudoers-ubuntu-xenial
|
||||
- tox-linters
|
||||
gate:
|
||||
jobs:
|
||||
- ansible-role-sudoers-fedora-latest
|
||||
- ansible-role-sudoers-ubuntu-bionic
|
||||
- ansible-role-sudoers-ubuntu-xenial
|
||||
- tox-linters
|
@ -1,2 +0,0 @@
|
||||
[defaults]
|
||||
roles_path = ../..
|
@ -1,2 +1 @@
|
||||
[all]
|
||||
localhost ansible_connection=local
|
||||
localhost
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Copyright 2015 Red Hat, Inc.
|
||||
# Copyright 2018 Red Hat, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@ -12,16 +12,9 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
---
|
||||
- hosts: localhost
|
||||
- hosts: all
|
||||
vars:
|
||||
rolename: "{{ lookup('pipe', 'pwd') | dirname | basename }}"
|
||||
pre_tasks:
|
||||
# Make sure OS does not have a stale package cache.
|
||||
- name: Update apt cache.
|
||||
become: yes
|
||||
apt:
|
||||
update_cache: yes
|
||||
when: ansible_os_family == 'Debian'
|
||||
rolename: ansible-role-sudoers
|
||||
|
||||
roles:
|
||||
- "{{ rolename }}"
|
18
tox.ini
18
tox.ini
@ -4,20 +4,10 @@ envlist = docs,linters
|
||||
skipsdist = True
|
||||
|
||||
[testenv]
|
||||
basepython = python3
|
||||
deps = -r{toxinidir}/requirements.txt
|
||||
-r{toxinidir}/test-requirements.txt
|
||||
|
||||
[testenv:functional]
|
||||
commands =
|
||||
# NOTE(pabelanger): Because ansible default ansible_user to null now, we need to pass it via CLI.
|
||||
ansible-playbook -i tests/inventory tests/test.yaml -e ansible_user={env:USER}
|
||||
passenv =
|
||||
HOME
|
||||
USER
|
||||
setenv =
|
||||
ANSIBLE_CONFIG = {toxinidir}/tests/ansible.cfg
|
||||
PYTHONUNBUFFERED = 1
|
||||
|
||||
[testenv:docs]
|
||||
commands = python setup.py build_sphinx
|
||||
|
||||
@ -34,14 +24,14 @@ exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build
|
||||
|
||||
[testenv:linters]
|
||||
setenv =
|
||||
ANSIBLE_CONFIG = tests/ansible.cfg
|
||||
ANSIBLE_ROLES_PATH = ..
|
||||
whitelist_externals = bash
|
||||
commands =
|
||||
# PEP8 Lint Check
|
||||
flake8
|
||||
# Ansible Lint Check
|
||||
bash -c "find . -type f -regex '.*.y[a]?ml' -print0 | xargs -t -n1 -0 \
|
||||
ansible-lint"
|
||||
bash -c "find . -not -path '*/\.*' -type f -regex '.*.y[a]?ml' -print0 | \
|
||||
xargs -t -n1 -0 ansible-lint"
|
||||
# Ansible Syntax Check
|
||||
bash -c "find tests -type f -regex '.*.y[a]?ml' -print | xargs -t -n1 \
|
||||
ansible-playbook --syntax-check -i tests/inventory \
|
||||
|
Loading…
Reference in New Issue
Block a user