From 724a520adfbff78f2642a00f9c4089cf3bfb8c26 Mon Sep 17 00:00:00 2001 From: Michel Peterson Date: Tue, 27 Feb 2018 23:04:36 +0200 Subject: [PATCH] Fix lookup of subunit files in fetch-subunit-output The role allows override of the zuul_work_dir variable, however in the step where it retrieves the test results is the only step where it prepends the directory with a fixed path. This breaks the step if the zuul_work_dir given is a fully qualified path. This patch defaults the zuul_work_dir to a fully qualified directory and standarizes the usage zuul_work_dir across the role. Change-Id: I62bc7571f625586a0d1b660f896e0c7cbaeae6e1 --- roles/fetch-subunit-output/README.rst | 4 ++-- roles/fetch-subunit-output/defaults/main.yaml | 2 +- roles/fetch-subunit-output/tasks/process.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/roles/fetch-subunit-output/README.rst b/roles/fetch-subunit-output/README.rst index 1d9c992bb..283b1d786 100644 --- a/roles/fetch-subunit-output/README.rst +++ b/roles/fetch-subunit-output/README.rst @@ -3,9 +3,9 @@ Collect subunit outputs **Role Variables** .. zuul:rolevar:: zuul_work_dir - :default: {{ zuul.project.src_dir }} + :default: {{ ansible_user_dir }}/{{ zuul.project.src_dir }} - Directory to work in + Directory to work in. It has to be a fully qualified path. .. zuul:rolevar:: tox_envlist diff --git a/roles/fetch-subunit-output/defaults/main.yaml b/roles/fetch-subunit-output/defaults/main.yaml index 95a9e3b77..8cc97ff70 100644 --- a/roles/fetch-subunit-output/defaults/main.yaml +++ b/roles/fetch-subunit-output/defaults/main.yaml @@ -1,3 +1,3 @@ --- tox_envlist: "" -zuul_work_dir: "{{ zuul.project.src_dir }}" +zuul_work_dir: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}" diff --git a/roles/fetch-subunit-output/tasks/process.yaml b/roles/fetch-subunit-output/tasks/process.yaml index e8eda69cc..71edd0aef 100644 --- a/roles/fetch-subunit-output/tasks/process.yaml +++ b/roles/fetch-subunit-output/tasks/process.yaml @@ -10,7 +10,7 @@ - name: Find subunit files find: paths: - - "{{ ansible_user_dir }}/{{ zuul_work_dir }}" + - "{{ zuul_work_dir }}" patterns: - testr_results.html - testrepository.subunit