68 lines
1.5 KiB
YAML
68 lines
1.5 KiB
YAML
---
|
|
|
|
- name: "set Tox command line fact"
|
|
set_fact:
|
|
tox_command_line: >
|
|
{{ tox_command }}
|
|
{% if tox_envlist %} -e {{ tox_envlist | quote }} {% endif %}
|
|
{{ tox_extra_args }}
|
|
|
|
|
|
- name: "normalize white spaces from Tox command line"
|
|
set_fact:
|
|
tox_command_line: '{{ tox_command_line.split() | join(" ") }}'
|
|
|
|
|
|
- name: "show tox variables"
|
|
debug:
|
|
msg:
|
|
tox_command_line: '{{ tox_command_line }}'
|
|
tox_description: '{{ tox_description }}'
|
|
tox_dir: '{{ tox_dir }}'
|
|
tox_environment: '{{ tox_environment | combine(tox_constrain_env) }}'
|
|
tox_report_env: '{{ tox_report_env | combine(tox_constrain_env) }}'
|
|
|
|
|
|
- name: "{{ tox_description }}"
|
|
command:
|
|
chdir: '{{ tox_dir }}'
|
|
cmd: '{{ tox_command_line }}'
|
|
register:
|
|
run_tox
|
|
environment: '{{ tox_environment | combine(tox_constrain_env) }}'
|
|
ignore_errors: yes
|
|
|
|
|
|
- name: "show test cases results"
|
|
debug: var=run_tox.stdout_lines
|
|
when:
|
|
- (run_tox.stdout_lines | length) > 0
|
|
|
|
|
|
- name: "generate test case report files"
|
|
shell:
|
|
chdir: "{{ tobiko_dir }}"
|
|
cmd: |
|
|
{{ tox_command }} -e report
|
|
register:
|
|
make_report
|
|
environment: '{{ tox_report_env | combine(tox_constrain_env) }}'
|
|
ignore_errors: yes
|
|
|
|
|
|
- name:
|
|
block:
|
|
- name: "show test cases errors"
|
|
debug: var=run_tox.stderr_lines
|
|
when:
|
|
- (run_tox.stderr_lines | length) > 0
|
|
|
|
- name: 'report test cases failure'
|
|
debug:
|
|
msg: 'test cases have failed'
|
|
failed_when: yes
|
|
|
|
when:
|
|
- run_tox is defined
|
|
- run_tox is failed
|