Use tools/ci/tox script for running tests and making reports
Move infrared plugin role to roles/infrared Change-Id: I7ca5505122bbbff1ea78e974f575e2bda1752d76
This commit is contained in:
parent
008c9fcca0
commit
89dba0a8fa
@ -1,15 +0,0 @@
|
||||
- name: Create Tobiko report
|
||||
shell: |
|
||||
cd "{{ test.dir }}"
|
||||
source "{{ test.venv }}/bin/activate"
|
||||
tox -e report
|
||||
|
||||
- fetch:
|
||||
src: "{{ test.dir }}/{{ item }}"
|
||||
dest: "{{ inventory_dir }}/tobiko_results_{{ test.results_dir_suffix }}/"
|
||||
flat: yes
|
||||
loop:
|
||||
- tobiko.conf
|
||||
- tobiko.log
|
||||
- tobiko_results.html
|
||||
- tobiko_results.xml
|
@ -1,6 +0,0 @@
|
||||
- name: Run Tobiko Tests
|
||||
shell: |
|
||||
cd "{{ test.dir }}"
|
||||
source "{{ test.overcloudrc }}"
|
||||
source "{{ test.venv }}/bin/activate"
|
||||
tox -e {{ test.tests }}
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
config:
|
||||
plugin_type: test
|
||||
entry_point: ./infrared/main.yml
|
||||
entry_point: ./roles/infrared/main.yml
|
||||
|
||||
subparsers:
|
||||
tobiko:
|
||||
@ -26,11 +26,6 @@ subparsers:
|
||||
default: "{{ ansible_env.HOME }}/overcloudrc"
|
||||
help: |
|
||||
The path to the overcloudrc file
|
||||
venv:
|
||||
type: Value
|
||||
default: "{{ ansible_env.HOME }}/tobiko_venv"
|
||||
help: |
|
||||
path of existing virtual environment
|
||||
floating_network:
|
||||
type: Value
|
||||
default: "public"
|
||||
@ -40,7 +35,7 @@ subparsers:
|
||||
type: Value
|
||||
help: |
|
||||
The set of tests to execute
|
||||
default: neutron
|
||||
default: scenario
|
||||
results_dir_suffix:
|
||||
type: Value
|
||||
help: |
|
||||
|
@ -41,29 +41,3 @@
|
||||
|
||||
- debug: var=git_log.stdout_lines
|
||||
when: test.refsec != ''
|
||||
|
||||
- name: Create Virtualenv if python >= 3
|
||||
vars:
|
||||
packages: ['pip', 'setuptools', 'tox']
|
||||
pip:
|
||||
virtualenv: "{{ test.venv }}"
|
||||
name: "{{ packages }}"
|
||||
state: latest
|
||||
when: ansible_python.version.major >=3
|
||||
|
||||
- name: Create Virtualenv if python <= 2
|
||||
vars:
|
||||
packages: ['pip', 'setuptools', 'tox<=2.5.0']
|
||||
pip:
|
||||
virtualenv: "{{ test.venv }}"
|
||||
name: "{{ packages }}"
|
||||
state: present
|
||||
when: ansible_python.version.major <=2
|
||||
|
||||
- name: Install Tobiko
|
||||
pip:
|
||||
chdir: "{{ test.dir }}"
|
||||
name: "."
|
||||
virtualenv: "{{ test.venv }}"
|
||||
editable: true
|
||||
extra_args: "-c https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt -r {{ test.dir }}/requirements.txt"
|
19
roles/infrared/tasks/report.yml
Normal file
19
roles/infrared/tasks/report.yml
Normal file
@ -0,0 +1,19 @@
|
||||
---
|
||||
|
||||
- name: Create Tobiko report
|
||||
shell:
|
||||
chdir: "{{ test.dir }}"
|
||||
cmd: |
|
||||
source "{{ test.overcloudrc }}"
|
||||
tools/ci/tox -e report
|
||||
|
||||
|
||||
- fetch:
|
||||
src: "{{ test.dir }}/{{ item }}"
|
||||
dest: "{{ inventory_dir }}/tobiko_results_{{ test.results_dir_suffix }}/"
|
||||
flat: yes
|
||||
loop:
|
||||
- tobiko.conf
|
||||
- tobiko.log
|
||||
- tobiko_results.html
|
||||
- tobiko_results.xml
|
8
roles/infrared/tasks/run.yml
Normal file
8
roles/infrared/tasks/run.yml
Normal file
@ -0,0 +1,8 @@
|
||||
---
|
||||
|
||||
- name: Run Tobiko Tests
|
||||
shell:
|
||||
chdir: "{{ test.dir }}"
|
||||
cmd: |
|
||||
source "{{ test.overcloudrc }}"
|
||||
tools/ci/tox -e "{{ test.tests }}"
|
Loading…
Reference in New Issue
Block a user