tripleo-ci/roles/run-test/tasks/main.yaml

155 lines
5.1 KiB
YAML

- name: Set legacy log path
include_role:
name: set-zuul-log-path-fact
- block:
- name: Check overridable settings
vars:
allowed_overrides:
- 'artg_repos_dir'
- 'cirros_image'
- 'dlrn_hash_tag'
- 'dlrn_hash_tag_newest'
- 'run_tempest'
- 'standalone_container_cli'
- 'standalone_environment_files'
- 'standalone_upgrade'
- 'tempest_cloud_name'
- 'tempest_extra_config'
- 'tempest_format'
- 'tempest_plugins'
- 'tempest_private_net_provider_type'
- 'tempest_run_concurrency'
- 'tempest_run_skipped'
- 'tempest_services'
- 'tempest_tempest_conf_overrides'
- 'tempest_test_image_path'
- 'tempest_test_whitelist'
- 'tempest_use_skiplist'
- 'tempest_whitelist'
- 'tempest_workers'
- 'test_black_regex'
- 'test_white_regex'
- 'to_build'
- 'undercloud_enable_paunch'
- 'use_os_tempest'
- 'validate_ha_overcloud'
- 'validate_services'
- 'tempest_tempestconf_profile_overrides'
fail:
msg: "ERROR: {{ item }} is not overridable."
when: item not in allowed_overrides
with_items: "{{ featureset_override }}"
- name: Generate standalone_custom_env_files from standalone_environment_files
set_fact:
featureset_override: "{{ featureset_override | combine(custom_env, recursive=true) }}"
vars:
tht_dir: /usr/share/openstack-tripleo-heat-templates/
custom_env:
standalone_custom_env_files: |
{{ featureset_override.standalone_environment_files |
default([]) |
map('regex_replace', '^', tht_dir ) | list }}
when: featureset_override['standalone_environment_files'] is defined
- include_role:
name: ceph-loop-device
when: standalone_ceph is defined and standalone_ceph
- name: Generate featureset overriding file
template:
src: templates/featureset-override.j2
dest: "{{ tripleo_root }}/tripleo-ci/featureset-override.yaml"
mode: 0755
force: yes
- name: Include some extra for generating toci scripts
set_fact:
extra_vars: "--extra-vars @{{ tripleo_root }}/tripleo-ci/featureset-override.yaml"
when: featureset_override is defined and featureset_override
- name: Generate role variable file
template:
src: templates/role-vars.j2
dest: "{{ workspace }}/logs/role-vars.yaml"
mode: 0755
force: yes
- name: Include role variables to be passed to quickstart
set_fact:
role_vars: "--extra-vars @{{ workspace }}/logs/role-vars.yaml"
- name: render toci_gate_test script
template:
src: templates/toci_gate_test.sh.j2
dest: "{{ tripleo_root }}/tripleo-ci/toci_gate_test.sh"
mode: 0755
force: yes
- name: render toci_quickstart script
template:
src: templates/toci_quickstart.sh.j2
dest: "{{ tripleo_root }}/tripleo-ci/toci_quickstart.sh"
mode: 0755
force: yes
- name: render common_vars script
template:
src: templates/common_vars.bash.j2
dest: "{{ tripleo_root }}/tripleo-ci/scripts/common_vars.bash"
force: yes
- name: render oooq_common_functions script
template:
src: templates/oooq_common_functions.sh.j2
dest: "{{ tripleo_root }}/tripleo-ci/scripts/oooq_common_functions.sh"
force: yes
- name: render ready releases.sh file
copy:
content: "{{ ready_releases_file }}"
dest: "{{ workspace }}/logs/releases.sh"
mode: 0644
force: yes
when: ready_releases_file is defined
- name: run toci_gate_test.sh
shell:
cmd: |
set -e
set -x
{% if nodes is defined %}
export TOCI_JOBTYPE={{ environment_type }}-{{ nodes }}-featureset{{ featureset }}
{% else %}
export TOCI_JOBTYPE={{ environment_type }}-featureset{{ featureset }}
{% endif %}
export DISTRIBUTION={{ ansible_distribution }}
export DISTRIBUTION_MAJOR_VERSION={{ ansible_distribution_major_version }}
{% if nodes is defined %}
export NODES_FILE={{ nodes_file }}
{% endif %}
# ZUUL does not set these for periodic jobs
export ZUUL_BRANCH=${ZUUL_BRANCH:-master}
export ZUUL_REF=${ZUUL_REF:-None}
# Compatibility with zuul v3 variables
export JOB_NAME={{ zuul.job }}
export LOG_PATH={{ zuul_log_path }}
export BRANCH_OVERRIDE="{{ branch_override | default('default') }}"
if [ "$BRANCH_OVERRIDE" != "default" ] ; then
export OVERRIDE_ZUUL_BRANCH=$BRANCH_OVERRIDE
if [[ $BRANCH_OVERRIDE =~ ^stable/ ]] ; then
export UPPER_CONSTRAINTS_FILE=https://releases.openstack.org/constraints/upper/${BRANCH_OVERRIDE#stable/}
export PIP_CONSTRAINT=https://releases.openstack.org/constraints/upper/${BRANCH_OVERRIDE#stable/}
fi
fi
export PYTHONUNBUFFERED=true
export TRIPLEO_ROOT={{ tripleo_root }}
# NOTE(trown) We can move this into the multinode environment file once we
# migrate the 2-node jobs over to zuulv3
bash -xe $TRIPLEO_ROOT/tripleo-ci/toci_gate_test.sh
executable: /bin/bash
chdir: '{{ tripleo_root }}'
environment: '{{ zuul | zuul_legacy_vars }}'
changed_when: true