From 844b4150669a062280134c00cf61c76fa41a4004 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Fri, 27 May 2016 12:28:13 -0700 Subject: [PATCH] Mark tasks expected to fail with EXPECTED FAILURE. This allows for automated identification of tasks which are expected to fail, but which cannot use ignore_errors because they need to fail. --- test/integration/roles/test_force_handlers/tasks/main.yml | 6 +++--- test/integration/test_blocks/fail.yml | 3 ++- test/integration/test_blocks/main.yml | 4 ++-- test/integration/test_test_infra.yml | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/test/integration/roles/test_force_handlers/tasks/main.yml b/test/integration/roles/test_force_handlers/tasks/main.yml index a3948756d71..ea01660ba76 100644 --- a/test/integration/roles/test_force_handlers/tasks/main.yml +++ b/test/integration/roles/test_force_handlers/tasks/main.yml @@ -10,15 +10,15 @@ - echoing handler when: inventory_hostname == 'A' or inventory_hostname == 'B' -- name: fail task for all +- name: EXPECTED FAILURE fail task for all fail: msg="Fail All" when: fail_all is defined and fail_all -- name: fail task for A +- name: EXPECTED FAILURE fail task for A fail: msg="Fail A" when: inventory_hostname == 'A' -- name: fail task for C +- name: EXPECTED FAILURE fail task for C fail: msg="Fail C" when: inventory_hostname == 'C' diff --git a/test/integration/test_blocks/fail.yml b/test/integration/test_blocks/fail.yml index ca8575a907e..ae94655136d 100644 --- a/test/integration/test_blocks/fail.yml +++ b/test/integration/test_blocks/fail.yml @@ -1 +1,2 @@ -- fail: msg="{{msg}}" +- name: EXPECTED FAILURE + fail: msg="{{msg}}" diff --git a/test/integration/test_blocks/main.yml b/test/integration/test_blocks/main.yml index d318145ac9a..a80a62b7533 100644 --- a/test/integration/test_blocks/main.yml +++ b/test/integration/test_blocks/main.yml @@ -15,7 +15,7 @@ - name: set block tasks run flag set_fact: block_tasks_run: true - - name: fail in tasks + - name: EXPECTED FAILURE fail in tasks fail: - name: tasks flag should not be set after failure set_fact: @@ -24,7 +24,7 @@ - name: set block rescue run flag set_fact: block_rescue_run: true - - name: fail in rescue + - name: EXPECTED FAILURE fail in rescue fail: - name: tasks flag should not be set after failure in rescue set_fact: diff --git a/test/integration/test_test_infra.yml b/test/integration/test_test_infra.yml index 48028ad8a7e..13c570530a8 100644 --- a/test/integration/test_test_infra.yml +++ b/test/integration/test_test_infra.yml @@ -20,7 +20,7 @@ - debug: msg: assert works ({{ assert_out.failed }}) - - name: ensure fail action stops execution + - name: EXPECTED FAILURE ensure fail action stops execution fail: msg: fail actually failed (this is expected)