Skip to content

Commit 900a687

Browse files
committed
Run StackHPC OpenStack tests in aio CI
1 parent 9c07a7c commit 900a687

File tree

3 files changed

+108
-91
lines changed

3 files changed

+108
-91
lines changed

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

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,16 +366,38 @@ 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+
docker run -t --rm \
374+
-v $(pwd):/stack/kayobe-automation-env/src/kayobe-config \
375+
-v $(pwd)/sot-results:/stack/sot-results \
376+
-e KAYOBE_ENVIRONMENT -e KAYOBE_VAULT_PASSWORD -e KAYOBE_AUTOMATION_SSH_PRIVATE_KEY \
377+
$KAYOBE_IMAGE \
378+
/stack/kayobe-automation-env/src/kayobe-config/.automation/pipeline/playbook-run.sh '$KAYOBE_CONFIG_PATH/ansible/stackhpc-openstack-tests.yml'
379+
env:
380+
KAYOBE_AUTOMATION_SSH_PRIVATE_KEY: ${{ steps.ssh_key.outputs.ssh_key }}
381+
369382
- name: Upload test result artifacts
370383
uses: actions/upload-artifact@v4
371384
with:
372-
name: tempest-results-${{ inputs.os_distribution }}-${{ inputs.os_release }}-${{ inputs.neutron_plugin }}${{ inputs.upgrade && '-upgrade' }}
373-
path: tempest-artifacts/*
385+
name: test-results-${{ inputs.os_distribution }}-${{ inputs.os_release }}-${{ inputs.neutron_plugin }}${{ inputs.upgrade && '-upgrade' }}
386+
path: >
387+
tempest-artifacts/
388+
sot-results/
374389
375390
- name: Fail if any Tempest tests failed
376391
run: |
377392
test $(wc -l < tempest-artifacts/failed-tests) -lt 1
378393
394+
- name: Fail if any StackHPC OpenStack tests failed
395+
run: |
396+
echo "Some StackHPC OpenStack tests failed."
397+
echo "See HTML results artifact (sot-results) for details."
398+
exit 1
399+
if: steps.stackhpc-openstack-tests.outcome == 'failure'
400+
379401
- name: Destroy
380402
run: terraform destroy -auto-approve
381403
working-directory: ${{ github.workspace }}/terraform/aio

.github/workflows/stackhpc-pull-request.yml

Lines changed: 4 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ concurrency:
77
name: Pull request
88
'on':
99
pull_request:
10+
# FIXME:
11+
push:
12+
branches:
13+
- stackhpc-openstack-tests
1014
jobs:
1115
# Detect which files have changed and use this to run jobs conditionally.
1216
# Note that we can't use the workflow-level paths attribute since this
@@ -105,92 +109,3 @@ jobs:
105109
if: ${{ needs.check-changes.outputs.aio == 'true' }}
106110
secrets: inherit
107111
if: ${{ ! failure() && ! cancelled() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
108-
109-
all-in-one-ubuntu-jammy-ovn:
110-
name: aio (Ubuntu Jammy OVN)
111-
needs:
112-
- check-changes
113-
- build-kayobe-image
114-
uses: ./.github/workflows/stackhpc-all-in-one.yml
115-
with:
116-
kayobe_image: ${{ needs.build-kayobe-image.outputs.kayobe_image }}
117-
os_distribution: ubuntu
118-
os_release: jammy
119-
ssh_username: ubuntu
120-
neutron_plugin: ovn
121-
OS_CLOUD: openstack
122-
if: ${{ needs.check-changes.outputs.aio == 'true' }}
123-
secrets: inherit
124-
if: ${{ ! failure() && ! cancelled() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
125-
126-
all-in-one-rocky-9-ovs:
127-
name: aio (Rocky 9 OVS)
128-
needs:
129-
- check-changes
130-
- build-kayobe-image
131-
uses: ./.github/workflows/stackhpc-all-in-one.yml
132-
with:
133-
kayobe_image: ${{ needs.build-kayobe-image.outputs.kayobe_image }}
134-
os_distribution: rocky
135-
os_release: "9"
136-
ssh_username: cloud-user
137-
neutron_plugin: ovs
138-
OS_CLOUD: openstack
139-
if: ${{ needs.check-changes.outputs.aio == 'true' }}
140-
secrets: inherit
141-
if: ${{ ! failure() && ! cancelled() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
142-
143-
all-in-one-rocky-9-ovn:
144-
name: aio (Rocky 9 OVN)
145-
needs:
146-
- check-changes
147-
- build-kayobe-image
148-
uses: ./.github/workflows/stackhpc-all-in-one.yml
149-
with:
150-
kayobe_image: ${{ needs.build-kayobe-image.outputs.kayobe_image }}
151-
os_distribution: rocky
152-
os_release: "9"
153-
ssh_username: cloud-user
154-
neutron_plugin: ovn
155-
OS_CLOUD: openstack
156-
if: ${{ needs.check-changes.outputs.aio == 'true' }}
157-
secrets: inherit
158-
if: ${{ ! failure() && ! cancelled() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
159-
160-
# Test two upgrade scenarios: Ubuntu Jammy OVS and Rocky 9 OVN.
161-
162-
all-in-one-upgrade-ubuntu-jammy-ovs:
163-
name: aio upgrade (Ubuntu Jammy OVS)
164-
needs:
165-
- check-changes
166-
- build-kayobe-image
167-
uses: ./.github/workflows/stackhpc-all-in-one.yml
168-
with:
169-
kayobe_image: ${{ needs.build-kayobe-image.outputs.kayobe_image }}
170-
os_distribution: ubuntu
171-
os_release: jammy
172-
ssh_username: ubuntu
173-
neutron_plugin: ovs
174-
OS_CLOUD: openstack
175-
if: ${{ needs.check-changes.outputs.aio == 'true' }}
176-
upgrade: true
177-
secrets: inherit
178-
if: ${{ ! failure() && ! cancelled() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
179-
180-
all-in-one-upgrade-rocky-9-ovn:
181-
name: aio upgrade (Rocky 9 OVN)
182-
needs:
183-
- check-changes
184-
- build-kayobe-image
185-
uses: ./.github/workflows/stackhpc-all-in-one.yml
186-
with:
187-
kayobe_image: ${{ needs.build-kayobe-image.outputs.kayobe_image }}
188-
os_distribution: rocky
189-
os_release: "9"
190-
ssh_username: cloud-user
191-
neutron_plugin: ovn
192-
OS_CLOUD: openstack
193-
if: ${{ needs.check-changes.outputs.aio == 'true' }}
194-
upgrade: true
195-
secrets: inherit
196-
if: ${{ ! failure() && ! cancelled() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
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+
# FIXME:
10+
sot_version: "poc"
11+
sot_timeout: 30
12+
results_path_local: "{{ lookup('env', 'HOME') }}/sot-results"
13+
tasks:
14+
- block:
15+
- name: Create a temporary directory for tests repo
16+
ansible.builtin.tempfile:
17+
state: directory
18+
suffix: sot-repo
19+
register: repo_tmpdir
20+
21+
- name: Create a temporary directory for results
22+
ansible.builtin.tempfile:
23+
state: directory
24+
suffix: sot-results
25+
register: results_tmpdir
26+
27+
- name: Clone the StackHPC OpenStack tests repository
28+
ansible.builtin.git:
29+
repo: "{{ sot_repo }}"
30+
version: "{{ sot_version }}"
31+
dest: "{{ repo_tmpdir.path }}"
32+
depth: 1
33+
single_branch: true
34+
35+
- name: Ensure the latest versions of pip and setuptools are installed # noqa package-latest
36+
ansible.builtin.pip:
37+
name: "{{ item.name }}"
38+
state: latest
39+
virtualenv: "{{ sot_venv }}"
40+
virtualenv_command: "python3 -m venv"
41+
with_items:
42+
- { name: pip }
43+
- { name: setuptools }
44+
45+
- name: Ensure required Python packages are installed
46+
ansible.builtin.pip:
47+
name:
48+
- "{{ repo_tmpdir.path }}"
49+
- "-r{{ repo_tmpdir.path }}/requirements.txt"
50+
- pytest-html
51+
- pytest-timeout
52+
virtualenv: "{{ sot_venv }}"
53+
54+
- name: Run StackHPC OpenStack tests
55+
ansible.builtin.command:
56+
cmd: >
57+
{{ sot_venv }}/bin/py.test
58+
--html={{ results_tmpdir.path }}/stackhpc-openstack-tests.html
59+
--self-contained-html
60+
--pyargs stackhpc_openstack_tests
61+
--timeout {{ sot_timeout }}
62+
environment:
63+
OPENSEARCH_HOSTS: "{% for host in groups['controllers'] %}{{ internal_net_name | net_ip(host) }}{% if not loop.last %},{% endif %}{% endfor %}"
64+
OPENSEARCH_PORT: "9200"
65+
OPENSEARCH_TLS: "false"
66+
PROMETHEUS_URL: "{{ 'https' if kolla_enable_internal_tls | bool else 'http' }}://{{ kolla_internal_fqdn }}:9091"
67+
always:
68+
- name: Fetch results
69+
ansible.builtin.fetch:
70+
src: "{{ results_tmpdir.path }}/stackhpc-openstack-tests.html"
71+
dest: "{{ results_path_local }}/"
72+
flat: true
73+
74+
- name: Clean up temporary directory
75+
ansible.builtin.file:
76+
path: "{{ item }}"
77+
state: absent
78+
loop:
79+
- "{{ repo_tmpdir.path }}"
80+
- "{{ results_tmpdir.path }}"

0 commit comments

Comments
 (0)