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
This commit is contained in:
Michel Peterson 2018-02-27 23:04:36 +02:00
parent 48099a5347
commit 724a520adf
3 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -1,3 +1,3 @@
---
tox_envlist: ""
zuul_work_dir: "{{ zuul.project.src_dir }}"
zuul_work_dir: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}"

View File

@ -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