-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run StackHPC OpenStack tests in aio CI
- Loading branch information
1 parent
9c07a7c
commit 99bc1c8
Showing
3 changed files
with
109 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
--- | ||
- name: Run StackHPC OpenStack tests | ||
hosts: tempest_runner | ||
tags: | ||
- stackhpc-openstack-tests | ||
vars: | ||
sot_venv: "{{ virtualenv_path }}/sot-venv" | ||
sot_repo: "https://github.com/stackhpc/stackhpc-openstack-tests" | ||
# FIXME: | ||
sot_version: "poc" | ||
sot_timeout: 30 | ||
results_path_local: "{{ lookup('env', 'HOME') }}/sot-results" | ||
tasks: | ||
- block: | ||
- name: Create a temporary directory for tests repo | ||
ansible.builtin.tempfile: | ||
state: directory | ||
suffix: sot-repo | ||
register: repo_tmpdir | ||
|
||
- name: Create a temporary directory for results | ||
ansible.builtin.tempfile: | ||
state: directory | ||
suffix: sot-results | ||
register: results_tmpdir | ||
|
||
- name: Clone the StackHPC OpenStack tests repository | ||
ansible.builtin.git: | ||
repo: "{{ sot_repo }}" | ||
version: "{{ sot_version }}" | ||
dest: "{{ repo_tmpdir.path }}" | ||
depth: 1 | ||
single_branch: true | ||
|
||
- name: Ensure the latest versions of pip and setuptools are installed # noqa package-latest | ||
ansible.builtin.pip: | ||
name: "{{ item.name }}" | ||
state: latest | ||
virtualenv: "{{ sot_venv }}" | ||
virtualenv_command: "python3 -m venv" | ||
with_items: | ||
- { name: pip } | ||
- { name: setuptools } | ||
|
||
- name: Ensure required Python packages are installed | ||
ansible.builtin.pip: | ||
name: | ||
- "{{ repo_tmpdir.path }}" | ||
- "-r{{ repo_tmpdir.path }}/requirements.txt" | ||
- pytest-html | ||
- pytest-timeout | ||
virtualenv: "{{ sot_venv }}" | ||
|
||
- name: Run StackHPC OpenStack tests | ||
ansible.builtin.command: | ||
cmd: > | ||
{{ sot_venv }}/bin/py.test | ||
--html={{ results_tmpdir.path }}/stackhpc-openstack-tests.html | ||
--self-contained-html | ||
--pyargs stackhpc_openstack_tests | ||
--timeout {{ sot_timeout }} | ||
environment: | ||
OPENSEARCH_HOSTS: "{% for host in groups['controllers'] %}{{ internal_net_name | net_ip(host) }}{% if not loop.last %},{% endif %}{% endfor %}" | ||
OPENSEARCH_PORT: "9200" | ||
OPENSEARCH_TLS: "false" | ||
PROMETHEUS_URL: "{{ 'https' if kolla_enable_tls_internal | bool else 'http' }}://{{ kolla_internal_fqdn }}:9091" | ||
always: | ||
- name: Fetch results | ||
ansible.builtin.fetch: | ||
src: "{{ results_tmpdir.path }}/stackhpc-openstack-tests.html" | ||
dest: "{{ results_path_local }}/" | ||
flat: true | ||
|
||
- name: Clean up temporary directory | ||
ansible.builtin.file: | ||
path: "{{ item }}" | ||
state: absent | ||
loop: | ||
- "{{ repo_tmpdir.path }}" | ||
- "{{ results_tmpdir.path }}" |