From b5e608ae8ad2d1768b3cd1a5fe054c05460b48c3 Mon Sep 17 00:00:00 2001 From: frenzyfriday Date: Thu, 6 May 2021 15:29:40 +0200 Subject: [PATCH] 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//log Change-Id: I57e4b05e199ded91b5ab26fa4054d6bbf1192fd2 --- playbooks/er.yml | 2 +- playbooks/sova.yml | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/playbooks/er.yml b/playbooks/er.yml index 7b85a15..ae5a11b 100644 --- a/playbooks/er.yml +++ b/playbooks/er.yml @@ -6,7 +6,7 @@ vars: er_dir: '../output/elastic-recheck' - test_results_dir: '../test_results' + test_results_dir: "../.tox/py{{ ansible_python_version.split('.')[:-1] | join('') }}/log/test_results" tasks: - name: Make sure dir for test output exists diff --git a/playbooks/sova.yml b/playbooks/sova.yml index ec27e33..9b8e2bd 100644 --- a/playbooks/sova.yml +++ b/playbooks/sova.yml @@ -11,6 +11,7 @@ samples_log: "{{ samples_dir }}/errors-testing.err" queries_file: "{{ lookup('file', playbook_dir + '/../src/data/queries.yml') | from_yaml }}" query_ids: [] + sova_log: "../.tox/py{{ ansible_python_version.split('.')[:-1] | join('') }}/log/sova.log" tasks: - name: Display file to be tested debug: @@ -31,7 +32,7 @@ config: "{{ sova_cfg_file }}" files: console: "{{ samples_log }}" - result: "sova.log" + result: "{{ sova_log }}" result_file_dir: "{{ (playbook_dir, '../output') | path_join | realpath }}" register: result @@ -44,11 +45,11 @@ msg: "Unexpected result: {{ result }}" when: > samples_log not in result.processed_files - or result.file_written != 'sova.log' + or result.file_written != sova_log - name: Get list of failures detected by sova set_fact: - failure_list: "{{ lookup('file', 'sova.log').split('\n')[0].split(' ') }}" + failure_list: "{{ lookup('file', sova_log).split('\n')[0].split(' ') }}" - name: Fail if sova doesn't find a match for all the regexes fail: