Run tox by module name (python -m tox)
Change-Id: Iafb1d3efe6d44d58f2c8bf7f72026b4873d725d9
This commit is contained in:
parent
84b2561afd
commit
71483d333d
@ -38,7 +38,7 @@
|
|||||||
- name: "run Tox InfraRed plugin"
|
- name: "run Tox InfraRed plugin"
|
||||||
shell:
|
shell:
|
||||||
cmd: >
|
cmd: >
|
||||||
'{{ tox_executable }}' -e infrared -- --collect-dir '{{ test_collect_dir }}'
|
{{ tox_executable }} -e infrared -- --collect-dir '{{ test_collect_dir }}'
|
||||||
chdir: '{{ test_dir }}'
|
chdir: '{{ test_dir }}'
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
register: run_tox
|
register: run_tox
|
||||||
|
@ -1,39 +1,23 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
- name: "ensure Tox is installed"
|
- name: "ensure Tox is installed"
|
||||||
command: |
|
command: >
|
||||||
'{{ python_executable }}' -m pip install --user 'tox>={{ tox_min_version }}'
|
{{ python_executable }} -m pip install --user 'tox>={{ tox_min_version }}'
|
||||||
register: install_tox
|
register: install_tox
|
||||||
changed_when: "'Successfully installed' in install_tox.stdout"
|
changed_when: "'Successfully installed' in install_tox.stdout"
|
||||||
|
|
||||||
|
- name: "set tox_executable fact"
|
||||||
- block:
|
set_fact:
|
||||||
- name: "get '{{ tox_command }}' full path"
|
tox_executable: "{{ python_executable }} -m tox"
|
||||||
shell: |
|
|
||||||
export PATH={{ python_exe_path }}
|
|
||||||
which '{{ tox_command }}'
|
|
||||||
register: get_tox_path
|
|
||||||
|
|
||||||
- name: "set tox_executable fact"
|
|
||||||
set_fact:
|
|
||||||
tox_executable: '{{ get_tox_path.stdout_lines | first }}'
|
|
||||||
|
|
||||||
rescue:
|
|
||||||
- name: "set tox_executable fact"
|
|
||||||
set_fact:
|
|
||||||
tox_executable: '{{ ansible_user_dir }}/.local/bin/tox'
|
|
||||||
|
|
||||||
|
|
||||||
- name: "get installed Tox version"
|
- name: "get installed Tox version"
|
||||||
command: "'{{ tox_executable }}' --version"
|
command: "{{ tox_executable }} --version"
|
||||||
register: get_tox_version
|
register: get_tox_version
|
||||||
|
|
||||||
|
|
||||||
- name: "update tox_version fact"
|
- name: "update tox_version fact"
|
||||||
set_fact:
|
set_fact:
|
||||||
tox_version: '{{ get_tox_version.stdout_lines | first }}'
|
tox_version: '{{ get_tox_version.stdout_lines | first }}'
|
||||||
|
|
||||||
|
|
||||||
- name: "show Tox facts"
|
- name: "show Tox facts"
|
||||||
debug:
|
debug:
|
||||||
msg:
|
msg:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user