Merge "Enable ARA reports for system-config bridge CI jobs"

This commit is contained in:
Zuul 2018-12-12 23:19:02 +00:00 committed by Gerrit Code Review
commit 2cfe6061a8
4 changed files with 51 additions and 1 deletions

View File

@ -127,6 +127,8 @@
pre-run: playbooks/zuul/run-base-pre.yaml
run: playbooks/zuul/run-base.yaml
post-run: playbooks/zuul/run-base-post.yaml
vars:
install_ansible_ara_enable: true
- job:
name: system-config-run-base
@ -166,11 +168,14 @@
- name: github.com/ansible/ansible
override-checkout: devel
- name: openstack/openstacksdk
- name: openstack/ara
vars:
bridge_ansible_name: '{{ ansible_user_dir}}/src/github.com/ansible/ansible'
bridge_ansible_version: null
bridge_openstacksdk_name: '{{ ansible_user_dir }}/src/git.openstack.org/openstack/openstacksdk'
bridge_openstacksdk_version: null
bridge_ara_name: '{{ ansible_user_dir}}/src/git.openstack.org/openstack/ara'
bridge_ara_version: null
- job:
name: system-config-run-eavesdrop

View File

@ -15,6 +15,11 @@
install_ansible_version: '{{ bridge_ansible_version | default("2.7.3") }}'
install_ansible_openstacksdk_name: '{{ bridge_openstacksdk_name | default("openstacksdk") }}'
install_ansible_openstacksdk_version: '{{ bridge_openstacksdk_verison | default("latest") }}'
# NOTE(ianw): At 2018-12, ARA is only enabled during gate
# testing jobs as we decide if or how to store data on
# production bridge.o.o
install_ansible_ara_name: '{{ bridge_ara_name | default("ara") }}'
install_ansible_ara_version: '{{ bridge_ara_version | default("0.16.1") }}'
- root-keys
- ansible-cron
- cloud-launcher-cron

View File

@ -1,5 +1,19 @@
- hosts: localhost
tasks:
- name: Ensure log directories exist
file:
path: "{{ item }}"
state: directory
with_items:
- "{{ zuul.executor.log_root }}/bridge.o.o"
- "{{ zuul.executor.log_root }}/bridge.o.o/ara-report"
- hosts: bridge.openstack.org
tasks:
- name: Set log directory
set_fact:
log_dir: "{{ zuul.executor.log_root }}/bridge.o.o"
- name: Register junit.xml file
stat:
path: "{{ zuul.project.src_dir }}/junit.xml"
@ -13,9 +27,28 @@
verify_host: true
when: _junit.stat.exists|bool
# Because during the test we run ansible as root, we need
# to allow ourselves permissions to copy the results
- name: Open ARA results permissions
file:
dest: /var/cache/ansible
mode: u=rwX,g=rX,o=rX
recurse: yes
become: yes
# Note called ansible.sqlite so the middleware on
# logs.o.o picks it up for display
- name: Collect testing ARA results
synchronize:
dest: "{{ log_dir }}/ara-report/ansible.sqlite"
mode: pull
src: "/var/cache/ansible/ara.sqlite"
verify_host: true
ignore_errors: true
- name: Collect ansible configuration
synchronize:
dest: "{{ zuul.executor.log_root }}"
dest: "{{ log_dir }}/etc"
mode: pull
src: "/etc/ansible"
verify_host: true

View File

@ -58,3 +58,10 @@ def test_authorized_keys(host):
content = authorized_keys.content.decode('utf8')
lines = content.split('\n')
assert len(lines) >= 3
def test_ara(host):
ara = host.run('ara playbook list')
assert ara.rc == 0
database = host.file('/var/cache/ansible/ara.sqlite')
assert database.exists