From 86d23b5d087e906bbdcd7a51a862106064723016 Mon Sep 17 00:00:00 2001 From: Eduardo Olivares Date: Wed, 29 Jun 2022 16:00:56 +0200 Subject: [PATCH] Do not fail when a certain python version is not available When a tobiko test step fails because it requires a python version that is not available, the result should not be failed Change-Id: I1b1ab5d005d75319873610b03c85b02c8824c202 --- roles/tobiko-ensure-python3/tasks/install.yaml | 10 ++++++++++ roles/tobiko-run/tasks/run.yaml | 1 + 2 files changed, 11 insertions(+) diff --git a/roles/tobiko-ensure-python3/tasks/install.yaml b/roles/tobiko-ensure-python3/tasks/install.yaml index 99ef5f44f..61006a3a9 100644 --- a/roles/tobiko-ensure-python3/tasks/install.yaml +++ b/roles/tobiko-ensure-python3/tasks/install.yaml @@ -21,6 +21,11 @@ - compile_python3 | bool +- name: "initialize found_python_version" + set_fact: + found_python_version: false + + - name: "get '{{ python_command }}' full path" shell: | export PATH={{ python_exe_path }} @@ -29,6 +34,11 @@ changed_when: no +- name: "update found_python_version" + set_fact: + found_python_version: true + + - name: "get '{{ get_python_exe.stdout_lines | first }}' info" script: cmd: get_python_info.py --base --quiet diff --git a/roles/tobiko-run/tasks/run.yaml b/roles/tobiko-run/tasks/run.yaml index b79678aca..ae765488f 100644 --- a/roles/tobiko-run/tasks/run.yaml +++ b/roles/tobiko-run/tasks/run.yaml @@ -24,6 +24,7 @@ - name: "add step failure: '{{ tox_step_name }}'" set_fact: test_step_failures: '{{ test_step_failures + [test_step] }}' + when: 'found_python_version is not defined or found_python_version == true' - name: "abort execution at first failure" debug: var=test_step