Skip to content

Commit b4dcd5f

Browse files
committed
Run StackHPC OpenStack tests in aio CI
This change adds a new playbook, stackhpc-openstack-tests.yml, that uses the new stackhpc-openstack-tests repository to perform testing of the deployment that is not covered by Rally or Tempest. Currently this includes Prometheus and OpenSearch. The all-in-one CI test has been updated to run this new test suite, and the results are included in the test results artifact.
1 parent 9c07a7c commit b4dcd5f

File tree

3 files changed

+117
-2
lines changed

3 files changed

+117
-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

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

Lines changed: 4 additions & 0 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
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
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: "prometheus-opensearch"
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: Include Kolla Ansible passwords
55+
ansible.builtin.include_vars:
56+
file: "{{ kayobe_env_config_path }}/kolla/passwords.yml"
57+
name: kolla_passwords
58+
59+
- name: Run StackHPC OpenStack tests
60+
ansible.builtin.command:
61+
cmd: >
62+
{{ sot_venv }}/bin/py.test
63+
--html={{ results_tmpdir.path }}/stackhpc-openstack-tests.html
64+
--self-contained-html
65+
--pyargs stackhpc_openstack_tests
66+
--timeout {{ sot_timeout }}
67+
-v
68+
environment:
69+
OPENSEARCH_HOSTS: "{% for host in groups['controllers'] %}{{ internal_net_name | net_ip(host) }}{% if not loop.last %},{% endif %}{% endfor %}"
70+
OPENSEARCH_PORT: "9200"
71+
OPENSEARCH_TLS: "false"
72+
PROMETHEUS_URL: "{{ 'https' if kolla_enable_tls_internal | bool else 'http' }}://{{ kolla_internal_fqdn }}:9091"
73+
PROMETHEUS_USERNAME: "admin"
74+
PROMETHEUS_PASSWORD: "{{ kolla_passwords.prometheus_password }}"
75+
always:
76+
- name: Fetch results
77+
ansible.builtin.fetch:
78+
src: "{{ results_tmpdir.path }}/stackhpc-openstack-tests.html"
79+
dest: "{{ results_path_local }}/"
80+
flat: true
81+
82+
- name: Clean up temporary directory
83+
ansible.builtin.file:
84+
path: "{{ item }}"
85+
state: absent
86+
loop:
87+
- "{{ repo_tmpdir.path }}"
88+
- "{{ results_tmpdir.path }}"

0 commit comments

Comments
 (0)