Enable ARA reports for system-config bridge CI jobs
This change takes the ARA report from the "inner" run of the base playbooks on our bridge.o.o node and publishes it into the final log output. This is then displayed by the middleware. Create a new log hierarchy with a "bridge.o.o" to make it clear the logs here are related to the test running on that node. Move the ansible config under there too. Change-Id: I74122db09f0f712836a0ee820c6fac87c3c9c734
This commit is contained in:
parent
35e87d6879
commit
3bed6e0fd3
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user