tripleo-ci-health-queries/playbooks/er.yml
frenzyfriday b5e608ae8a Make test_results folder visible in zuul
This patch moves test result logs [1] to tox folder [2]
so that it is automatically added to the list of log files by zuul

[1] sova.log, test_results/*
[2] .tox/<envname>/log

Change-Id: I57e4b05e199ded91b5ab26fa4054d6bbf1192fd2
2021-05-20 16:38:11 +02:00

36 lines
1.1 KiB
YAML

---
- name: Validate that ER can parse what we produce
hosts: localhost
connection: local
gather_facts: true
vars:
er_dir: '../output/elastic-recheck'
test_results_dir: "../.tox/py{{ ansible_python_version.split('.')[:-1] | join('') }}/log/test_results"
tasks:
- name: Make sure dir for test output exists
file:
path: "{{ test_results_dir }}"
state: directory
mode: 0755
- name: Get list of er files from er directory
find:
paths: "{{ er_dir }}"
register: er_files_output
- name: Run elastic_recheck_query for all er files
vars:
output_file: "{{ test_results_dir }}/{{ item.path | basename }}.log"
shell: |
set -e
elastic-recheck-query "{{ item.path }}" > "{{ output_file }}" 2>&1
! grep -q "pyelasticsearch.exceptions.ElasticHttpError" "{{ output_file }}"
# This also fails if an exception is found inside the output files
loop: "{{ er_files_output.files }}"
loop_control:
label: "{{ item.path | basename }}"
register: er_output
changed_when: false