From 712ba62553259fd336393725420b4867609deb15 Mon Sep 17 00:00:00 2001 From: Ed Santiago Date: Tue, 12 May 2020 06:38:17 -0600 Subject: [PATCH] Yet more ansible hackery: create results.yml Gating tests are still failing. Actually, the BATS portion is all passing, it just seems to be the end part (infrastructure) that fails. Let's try creating a results.yml file. Signed-off-by: Ed Santiago --- .../run_bats_tests/tasks/run_one_test.yml | 22 +++++++++++-------- tests/test_podman.yml | 5 ++++- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/tests/roles/run_bats_tests/tasks/run_one_test.yml b/tests/roles/run_bats_tests/tasks/run_one_test.yml index 2451606..9304d21 100644 --- a/tests/roles/run_bats_tests/tasks/run_one_test.yml +++ b/tests/roles/run_bats_tests/tasks/run_one_test.yml @@ -46,18 +46,22 @@ - summary # Collect all the one-line PASS/FAIL results in one file, test.log +# Write the same thing, in a different format, to results.yml +# https://docs.fedoraproject.org/en-US/ci/standard-test-interface/ - name: "{{ test.name }} | keep running tally of test results" - local_action: shell cat "{{ artifacts }}/test.{{ test_name_oneword }}.summary.log" >>"{{ artifacts }}/test.log" + local_action: + module: shell + cmd: | + cd {{ artifacts }} + cat "test.{{ test_name_oneword }}.summary.log" >>test.log -# ...then delete the oneliner file, to keep things clean. -- name: "{{ test.name }} | clean up status file" - local_action: file dest="{{ artifacts }}/test.{{ test_name_oneword }}.summary.log" state=absent + status=$(awk '{print $1}' >results.yml + echo " result: $status" >>results.yml + echo " logs: test.{{ test_name_oneword }}.bats.log" >>results.yml -# FIXME: do the same with results.yml: -# - test: {{ test.name }} -# result: pass or fail -# logs: -# - test.{{ test_name_oneword }}.bats.log + # delete the oneliner file, to keep artifacts dir clean + rm -f test.{{ test_name_oneword }}.summary.log - name: "{{ test.name }} | remove remote logs and helpers" file: diff --git a/tests/test_podman.yml b/tests/test_podman.yml index 27927de..9caf564 100644 --- a/tests/test_podman.yml +++ b/tests/test_podman.yml @@ -17,9 +17,12 @@ - name: remove stale log files local_action: shell rm -f {{ artifacts }}/test*.log - - name: clear test results + - name: clear test results (test.log) local_action: command truncate --size=0 {{ artifacts }}/test.log + - name: clear test results (results.yml) + local_action: copy content="requires:\n" dest={{ artifacts }}/results.yml + # These are the actual tests: set cgroups vN, then run root/rootless tests. - name: set cgroups and run podman tests include_tasks: test_podman_cgroups_vn.yml