tripleo-quickstart-extras/roles/validate-tempest/tasks/pre-tempest.yml

93 lines
2.7 KiB
YAML

---
- name: Set the number of workers in tempest
set_fact:
tempest_workers: "{{ ansible_processor_vcpus|int // 2 }}"
when: tempest_workers is not defined
- name: Set rc file to be sourced to run tempest
set_fact:
rc_file: "{{ working_dir }}/{% if tempest_undercloud %}stackrc{% else %}overcloudrc{% endif %}"
- name: Create overcloud tempest setup script
template:
src: tempest-setup.j2
dest: "{{ working_dir }}/tempest-setup.sh"
mode: 0744
- name: Deprecation message for test_regex
debug:
msg: "WARNING: The variable test_regex is deprecated and will be removed by end of ROCKY release in the favor of test_white_regex."
when: test_regex is defined
- name: Load skip list variables (undercloud or overcloud)
include_vars:
file: "tempest_skip_{{ release }}.yml"
when: skip_file_src != ''
- name: Create tempest skipfile
template:
src: "{{ skip_file_src }}"
dest: "{{ working_dir }}/{{ skip_file }}"
mode: 0644
when: skip_file_src != ''
- name: Create tempest white file
template:
src: "{{ tempest_whitelist_file_src }}"
dest: "{{ working_dir }}/{{ tempest_whitelist_file }}"
mode: 0644
when: tempest_whitelist|length > 0
- name: Install packages to generate subunit results
become: yes
package: name={{ item }} state=present
with_items:
- python-subunit
- subunit-filters
- python-os-testr
when: tempest_format in ['container', 'packages']
- name: Install stestr
become: yes
package: name=python-stestr state=present
when: tempest_format in ['container', 'packages'] and release not in ['newton', 'ocata']
- name: Install pip
easy_install:
name: pip
state: present
become: true
- ignore_errors: true
block:
- name: Copying bugcheck files
synchronize:
src: bugcheck/
dest: "{{ working_dir }}/bugcheck/"
use_ssh_args: true
- name: Copying skip file
synchronize:
src: "vars/tempest_skip_{{ release }}.yml"
dest: "{{ working_dir }}/bugcheck/"
use_ssh_args: true
- name: Setting virtualenv
shell: >
virtualenv "{{ working_dir }}/bugcheck/.venv"
- name: Installing requirements
pip:
requirements: "{{ working_dir }}/bugcheck/requirements.txt"
virtualenv: "{{ working_dir }}/bugcheck/.venv"
- name: Verifying bugs in bugzilla and launchpad and generating skip file
shell: >
source "{{ working_dir }}"/bugcheck/.venv/bin/activate;
python bugcheck.py --skip-file "{{ working_dir }}/bugcheck/tempest_skip_{{ release }}.yml"
--to-file "{{ working_dir }}/{{ skip_file }}" --format txt
args:
chdir: "{{ working_dir }}/bugcheck"
ignore_errors: yes
when: check_tempest_bugs|bool