Skip to content

Commit 7dbec39

Browse files
authored
Merge pull request #1074 from stackhpc/stackhpc-openstack-tests
Run StackHPC OpenStack tests in aio CI
2 parents 915658a + b0a6305 commit 7dbec39

File tree

3 files changed

+129
-2
lines changed

3 files changed

+129
-2
lines changed

.github/workflows/stackhpc-all-in-one.yml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,16 +366,39 @@ jobs:
366366
env:
367367
KAYOBE_AUTOMATION_SSH_PRIVATE_KEY: ${{ steps.ssh_key.outputs.ssh_key }}
368368

369+
- name: StackHPC OpenStack tests
370+
id: stackhpc-openstack-tests
371+
continue-on-error: true
372+
run: |
373+
mkdir -p sot-results
374+
docker run -t --rm \
375+
-v $(pwd):/stack/kayobe-automation-env/src/kayobe-config \
376+
-v $(pwd)/sot-results:/stack/sot-results \
377+
-e KAYOBE_ENVIRONMENT -e KAYOBE_VAULT_PASSWORD -e KAYOBE_AUTOMATION_SSH_PRIVATE_KEY \
378+
$KAYOBE_IMAGE \
379+
/stack/kayobe-automation-env/src/kayobe-config/.automation/pipeline/playbook-run.sh '$KAYOBE_CONFIG_PATH/ansible/stackhpc-openstack-tests.yml'
380+
env:
381+
KAYOBE_AUTOMATION_SSH_PRIVATE_KEY: ${{ steps.ssh_key.outputs.ssh_key }}
382+
369383
- name: Upload test result artifacts
370384
uses: actions/upload-artifact@v4
371385
with:
372-
name: tempest-results-${{ inputs.os_distribution }}-${{ inputs.os_release }}-${{ inputs.neutron_plugin }}${{ inputs.upgrade && '-upgrade' }}
373-
path: tempest-artifacts/*
386+
name: test-results-${{ inputs.os_distribution }}-${{ inputs.os_release }}-${{ inputs.neutron_plugin }}${{ inputs.upgrade && '-upgrade' || '' }}
387+
path: |
388+
tempest-artifacts/
389+
sot-results/
374390
375391
- name: Fail if any Tempest tests failed
376392
run: |
377393
test $(wc -l < tempest-artifacts/failed-tests) -lt 1
378394
395+
- name: Fail if any StackHPC OpenStack tests failed
396+
run: |
397+
echo "Some StackHPC OpenStack tests failed."
398+
echo "See HTML results artifact (sot-results) for details."
399+
exit 1
400+
if: steps.stackhpc-openstack-tests.outcome == 'failure'
401+
379402
- name: Destroy
380403
run: terraform destroy -auto-approve
381404
working-directory: ${{ github.workspace }}/terraform/aio
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
---
2+
- name: Run StackHPC OpenStack tests
3+
hosts: tempest_runner
4+
tags:
5+
- stackhpc-openstack-tests
6+
vars:
7+
sot_venv: "{{ virtualenv_path }}/sot-venv"
8+
sot_repo: "https://github.com/stackhpc/stackhpc-openstack-tests"
9+
sot_version: "v0.0.1"
10+
sot_timeout: 30
11+
results_path_local: "{{ lookup('env', 'HOME') }}/sot-results"
12+
tasks:
13+
- block:
14+
- name: Create a temporary directory for tests repo
15+
ansible.builtin.tempfile:
16+
state: directory
17+
suffix: sot-repo
18+
register: repo_tmpdir
19+
20+
- name: Create a temporary directory for results
21+
ansible.builtin.tempfile:
22+
state: directory
23+
suffix: sot-results
24+
register: results_tmpdir
25+
26+
- name: Clone the StackHPC OpenStack tests repository
27+
ansible.builtin.git:
28+
repo: "{{ sot_repo }}"
29+
version: "{{ sot_version }}"
30+
dest: "{{ repo_tmpdir.path }}"
31+
depth: 1
32+
single_branch: true
33+
34+
- name: Ensure the latest versions of pip and setuptools are installed # noqa package-latest
35+
ansible.builtin.pip:
36+
name: "{{ item.name }}"
37+
state: latest
38+
virtualenv: "{{ sot_venv }}"
39+
virtualenv_command: "python3 -m venv"
40+
with_items:
41+
- { name: pip }
42+
- { name: setuptools }
43+
44+
- name: Ensure required Python packages are installed
45+
ansible.builtin.pip:
46+
name:
47+
- "{{ repo_tmpdir.path }}"
48+
- "-r{{ repo_tmpdir.path }}/requirements.txt"
49+
- pytest-html
50+
- pytest-timeout
51+
virtualenv: "{{ sot_venv }}"
52+
53+
- name: Include Kolla Ansible passwords
54+
ansible.builtin.include_vars:
55+
file: "{{ kayobe_env_config_path }}/kolla/passwords.yml"
56+
name: kolla_passwords
57+
58+
- name: Run StackHPC OpenStack tests
59+
ansible.builtin.command:
60+
cmd: >
61+
{{ sot_venv }}/bin/py.test
62+
--html={{ results_tmpdir.path }}/stackhpc-openstack-tests.html
63+
--self-contained-html
64+
--pyargs stackhpc_openstack_tests
65+
--timeout {{ sot_timeout }}
66+
-vv
67+
environment:
68+
OPENSEARCH_HOSTS: "{{ sot_opensearch_hosts }}"
69+
OPENSEARCH_PORT: "{{ sot_opensearch_port }}"
70+
OPENSEARCH_TLS: "{{ sot_opensearch_tls }}"
71+
PROMETHEUS_URL: "{{ sot_prometheus_url }}"
72+
PROMETHEUS_USERNAME: "{{ sot_prometheus_username }}"
73+
PROMETHEUS_PASSWORD: "{{ sot_prometheus_password }}"
74+
vars:
75+
kolla_external_scheme: "{{ 'https' if kolla_enable_tls_external | bool else 'http' }}"
76+
kolla_internal_scheme: "{{ 'https' if kolla_enable_tls_internal | bool else 'http' }}"
77+
sot_opensearch_hosts: "{{ kolla_internal_fqdn }}"
78+
sot_opensearch_port: 9200
79+
sot_opensearch_tls: false
80+
sot_prometheus_url: "{{ kolla_internal_scheme }}://{{ kolla_internal_fqdn }}:9091"
81+
sot_prometheus_username: "admin"
82+
sot_prometheus_password: "{{ kolla_passwords.prometheus_password }}"
83+
always:
84+
- name: Fetch results
85+
ansible.builtin.fetch:
86+
src: "{{ results_tmpdir.path }}/stackhpc-openstack-tests.html"
87+
dest: "{{ results_path_local }}/"
88+
flat: true
89+
90+
- name: Clean up temporary directory
91+
ansible.builtin.file:
92+
path: "{{ item }}"
93+
state: absent
94+
loop:
95+
- "{{ repo_tmpdir.path }}"
96+
- "{{ results_tmpdir.path }}"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
features:
3+
- |
4+
Adds a new ``stackhpc-openstack-tests.yml`` playbook that executes tests in
5+
the `StackHPC OpenStack Tests
6+
<https://github.com/stackhpc/stackhpc-openstack-tests>`__ repository. Both
7+
the playbook and tests are currently experimental, and are currently
8+
targeting only an all-in-one CI use case.

0 commit comments

Comments
 (0)