Skip to content

Commit

Permalink
Rename stackhpc-openstack-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-Welsh committed Jan 14, 2025
1 parent 4a55d94 commit c728fa4
Show file tree
Hide file tree
Showing 4 changed files with 113 additions and 12 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/stackhpc-all-in-one.yml
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ jobs:
KAYOBE_AUTOMATION_SSH_PRIVATE_KEY: ${{ steps.ssh_key.outputs.ssh_key }}

- name: StackHPC OpenStack tests
id: stackhpc-openstack-tests
id: stackhpc-cloud-tests
continue-on-error: true
run: |
mkdir -p sot-results
Expand All @@ -448,7 +448,7 @@ jobs:
-v $(pwd)/sot-results:/stack/sot-results \
-e KAYOBE_ENVIRONMENT -e KAYOBE_VAULT_PASSWORD -e KAYOBE_AUTOMATION_SSH_PRIVATE_KEY \
$KAYOBE_IMAGE \
/stack/kayobe-automation-env/src/kayobe-config/.automation/pipeline/playbook-run.sh '$KAYOBE_CONFIG_PATH/ansible/stackhpc-openstack-tests.yml'
/stack/kayobe-automation-env/src/kayobe-config/.automation/pipeline/playbook-run.sh '$KAYOBE_CONFIG_PATH/ansible/stackhpc-cloud-tests.yml'
env:
KAYOBE_AUTOMATION_SSH_PRIVATE_KEY: ${{ steps.ssh_key.outputs.ssh_key }}

Expand All @@ -474,7 +474,7 @@ jobs:
diagnostics/
tempest-artifacts/
sot-results/
if: ${{ !cancelled() && (steps.tempest.outcome == 'success' || steps.stackhpc-openstack-tests.outcome == 'success' || steps.diagnostics.outcome == 'success') }}
if: ${{ !cancelled() && (steps.tempest.outcome == 'success' || steps.stackhpc-cloud-tests.outcome == 'success' || steps.diagnostics.outcome == 'success') }}

- name: Fail if any Tempest tests failed
run: |
Expand All @@ -485,7 +485,7 @@ jobs:
echo "Some StackHPC OpenStack tests failed."
echo "See HTML results artifact (sot-results) for details."
exit 1
if: steps.stackhpc-openstack-tests.outcome == 'failure'
if: steps.stackhpc-cloud-tests.outcome == 'failure'

- name: Destroy
run: terraform destroy -auto-approve
Expand Down
6 changes: 3 additions & 3 deletions doc/source/contributor/testing-ci-automation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ The workflow performs the following high-level steps:
#. If this is an upgrade job, upgrade the cloud under test to the target
release.
#. Run Tempest and `StackHPC OpenStack Tests
<https://github.com/stackhpc/stackhpc-openstack-tests>`_ to test the cloud.
<https://github.com/stackhpc/stackhpc-cloud-tests>`_ to test the cloud.
#. Collect diagnostic information.
#. Upload results as an artifact.
#. Destroy the VM using Terraform.
Expand Down Expand Up @@ -346,11 +346,11 @@ The workflow performs the following high-level steps:
#. Register test resources in the cloud under test (images, flavors, networks,
subnets, routers, etc.).
#. Run Tempest and `StackHPC OpenStack Tests
<https://github.com/stackhpc/stackhpc-openstack-tests>`__ to test the cloud.
<https://github.com/stackhpc/stackhpc-cloud-tests>`__ to test the cloud.
#. If this is an upgrade job, upgrade the cloud under test to the target
release.
#. Run Tempest and `StackHPC OpenStack Tests
<https://github.com/stackhpc/stackhpc-openstack-tests>`__ to test the cloud.
<https://github.com/stackhpc/stackhpc-cloud-tests>`__ to test the cloud.
#. Collect diagnostic information.
#. Upload results as an artifact.
#. Destroy the VMs using Terraform.
Expand Down
101 changes: 101 additions & 0 deletions etc/kayobe/ansible/stackhpc-cloud-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
---
- name: Run StackHPC OpenStack tests
hosts: tempest_runner
tags:
- stackhpc-cloud-tests
vars:
sot_venv: "{{ virtualenv_path }}/sot-venv"
sot_repo: https://github.com/stackhpc/stackhpc-cloud-tests
sot_version: v0.0.1
sot_timeout: 30
results_path_local: "{{ lookup('env', 'HOME') }}/sot-results"
tasks:
- name: Stackhpc OpenStack tests
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 individual Python packages are installed
ansible.builtin.pip:
name:
- "{{ repo_tmpdir.path }}"
- pytest-html
- pytest-timeout
virtualenv: "{{ sot_venv }}"

- name: Ensure Python requirements file packages are installed
ansible.builtin.pip:
requirements: "{{ repo_tmpdir.path }}/requirements.txt"
virtualenv: "{{ sot_venv }}"

- name: Include Kolla Ansible passwords
ansible.builtin.include_vars:
file: "{{ kayobe_env_config_path }}/kolla/passwords.yml"
name: kolla_passwords

- name: Run StackHPC OpenStack tests
ansible.builtin.command:
cmd: >
{{ sot_venv }}/bin/py.test
--html={{ results_tmpdir.path }}/stackhpc-cloud-tests.html
--self-contained-html
--pyargs stackhpc_cloud_tests
--timeout {{ sot_timeout }}
-vv
environment:
OPENSEARCH_HOSTS: "{{ sot_opensearch_hosts }}"
OPENSEARCH_PORT: "{{ sot_opensearch_port }}"
OPENSEARCH_TLS: "{{ sot_opensearch_tls }}"
PROMETHEUS_URL: "{{ sot_prometheus_url }}"
PROMETHEUS_USERNAME: "{{ sot_prometheus_username }}"
PROMETHEUS_PASSWORD: "{{ sot_prometheus_password }}"
vars:
kolla_external_scheme: "{{ 'https' if kolla_enable_tls_external | bool else 'http' }}"
kolla_internal_scheme: "{{ 'https' if kolla_enable_tls_internal | bool else 'http' }}"
sot_opensearch_hosts: "{{ kolla_internal_fqdn }}"
sot_opensearch_port: 9200
sot_opensearch_tls: false
sot_prometheus_url: "{{ kolla_internal_scheme }}://{{ kolla_internal_fqdn }}:9091"
sot_prometheus_username: admin
sot_prometheus_password: "{{ kolla_passwords.prometheus_password }}"
always:
- name: Fetch results
ansible.builtin.fetch:
src: "{{ results_tmpdir.path }}/stackhpc-cloud-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 }}"
10 changes: 5 additions & 5 deletions etc/kayobe/ansible/stackhpc-openstack-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
- name: Run StackHPC OpenStack tests
hosts: tempest_runner
tags:
- stackhpc-openstack-tests
- stackhpc-cloud-tests
vars:
sot_venv: "{{ virtualenv_path }}/sot-venv"
sot_repo: https://github.com/stackhpc/stackhpc-openstack-tests
sot_repo: https://github.com/stackhpc/stackhpc-cloud-tests
sot_version: v0.0.1
sot_timeout: 30
results_path_local: "{{ lookup('env', 'HOME') }}/sot-results"
Expand Down Expand Up @@ -64,9 +64,9 @@
ansible.builtin.command:
cmd: >
{{ sot_venv }}/bin/py.test
--html={{ results_tmpdir.path }}/stackhpc-openstack-tests.html
--html={{ results_tmpdir.path }}/stackhpc-cloud-tests.html
--self-contained-html
--pyargs stackhpc_openstack_tests
--pyargs stackhpc_cloud_tests
--timeout {{ sot_timeout }}
-vv
environment:
Expand All @@ -88,7 +88,7 @@
always:
- name: Fetch results
ansible.builtin.fetch:
src: "{{ results_tmpdir.path }}/stackhpc-openstack-tests.html"
src: "{{ results_tmpdir.path }}/stackhpc-cloud-tests.html"
dest: "{{ results_path_local }}/"
flat: true

Expand Down

0 comments on commit c728fa4

Please sign in to comment.