zuul-jobs/roles/fetch-subunit-output/tasks/main.yaml
Monty Taylor f6a92ecb6c
Make subunit processing more resilient
Use subunit2html from tox envs instead of os-testr-env

We have an openstack-infra hard-coded location in this role. Rework it
to try looking in the tox env if one exists or to look on the system.

Leave /usr/os-testr-env in as a fallback but with a debug statement so
that we can track instances of the fallback being used.

tox_envlist can be a comma separated list. If it is, the "find
subunit2html in a tox env" logic isn't going to work.

Use a shell script so that we can do a first-found logic similar to what
we use in ensure-sphinx for finding requirements files.

It's a big bash blob. Put it in a file so it syntax highlights correctly
and execute it with the script module.

Change-Id: I0b468840fd04a379007fe5aca07feb2eaf7081ac
2018-01-21 10:39:49 -06:00

20 lines
629 B
YAML

# We're not using with_first_found because the files are remote, not local.
# We want to use stestr if it exists or fallback to testr - and we want to
# prefer files found in tox envs.
- name: Find stestr or testr executable
script: "find-testr.sh {{ zuul_work_dir }}"
register: testr_command
- when:
- testr_command.rc == 0
- testr_command.stdout_lines
block:
- name: Generate subunit file
shell:
cmd: "{{ testr_command.stdout_lines[0] }} last --subunit > ./testrepository.subunit"
chdir: "{{ zuul_work_dir }}"
- name: Process and fetch subunit results
include: process.yaml