Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/e2e_test.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
name: End-to-End tests

on:
pull_request:
# TODO: tmp disable for testing.
# pull_request:
workflow_dispatch:


concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand All @@ -21,7 +24,7 @@ jobs:
modules: '["test_e2e"]'
extra-arguments: "-m openstack"
self-hosted-runner: true
self-hosted-runner-label: stg-private-endpoint
self-hosted-runner-label: pfe-ci

required_status_checks:
name: Required E2E Test Status Checks
Expand Down
49 changes: 27 additions & 22 deletions .github/workflows/integration_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,37 @@ concurrency:
jobs:
openstack-integration-tests-private-endpoint:
name: Integration test using private-endpoint
uses: canonical/operator-workflows/.github/workflows/integration_test.yaml@main
uses: canonical/operator-workflows/.github/workflows/integration_test.yaml@tmp-integration-test-args
secrets: inherit
with:
juju-channel: 3.6/stable
provider: lxd
test-tox-env: integration-juju3.6
modules: '["test_charm_metrics_failure", "test_charm_metrics_success", "test_charm_fork_repo", "test_charm_fork_path_change", "test_charm_no_runner", "test_charm_runner", "test_debug_ssh", "test_charm_upgrade", "test_reactive", "test_jobmanager_prespawned", "test_jobmanager_reactive"]'
modules: '["test_tmp"]'
# TODO: disable for debugging
# modules: '["test_charm_metrics_failure", "test_charm_metrics_success", "test_charm_fork_repo", "test_charm_fork_path_change", "test_charm_no_runner", "test_charm_runner", "test_debug_ssh", "test_charm_upgrade", "test_reactive", "test_jobmanager_prespawned", "test_jobmanager_reactive"]'
extra-arguments: '-m openstack --log-format="%(asctime)s %(levelname)s %(message)s"'
self-hosted-runner: true
self-hosted-runner-label: stg-private-endpoint
openstack-integration-tests-cross-controller-private-endpoint:
name: Cross controller integration test using private-endpoint
uses: canonical/operator-workflows/.github/workflows/integration_test.yaml@main
secrets: inherit
with:
juju-channel: 3.6/stable
pre-run-script: tests/integration/setup-integration-tests.sh
provider: lxd
test-tox-env: integration-juju3.6
modules: '["test_prometheus_metrics"]'
extra-arguments: '-m openstack --log-format="%(asctime)s %(levelname)s %(message)s"'
self-hosted-runner: true
self-hosted-runner-label: stg-private-endpoint
allure-report:
if: ${{ (success() || failure()) && github.event_name == 'schedule' }}
needs:
- openstack-integration-tests-private-endpoint
- openstack-integration-tests-cross-controller-private-endpoint
uses: canonical/operator-workflows/.github/workflows/allure_report.yaml@main
self-hosted-runner-label: pfe-ci
tmate-debug: true
tmate-timeout: 3000
# TODO: re-enable
# openstack-integration-tests-cross-controller-private-endpoint:
# name: Cross controller integration test using private-endpoint
# uses: canonical/operator-workflows/.github/workflows/integration_test.yaml@tmp-integration-test-args
# secrets: inherit
# with:
# juju-channel: 3.6/stable
# pre-run-script: tests/integration/setup-integration-tests.sh
# provider: lxd
# test-tox-env: integration-juju3.6
# modules: '["test_prometheus_metrics"]'
# extra-arguments: '-m openstack --log-format="%(asctime)s %(levelname)s %(message)s"'
# self-hosted-runner: true
# self-hosted-runner-label: pfe-ci
# allure-report:
# if: ${{ (success() || failure()) && github.event_name == 'schedule' }}
# needs:
# - openstack-integration-tests-private-endpoint
# - openstack-integration-tests-cross-controller-private-endpoint
# uses: canonical/operator-workflows/.github/workflows/allure_report.yaml@main
4 changes: 3 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: Tests

on:
pull_request:
# TODO: tmp disable for testing.
# pull_request:
workflow_dispatch:

jobs:
unit-tests:
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,8 @@ async def image_builder_fixture(
"github-runner-image-builder",
application_name=application_name,
channel="latest/edge",
# TODO: Temp switch to a fix revision
revision=120,
config=image_builder_config,
)
else:
Expand Down
3 changes: 3 additions & 0 deletions tests/integration/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ kombu==5.*
pygithub
pymongo==4.*
tenacity==9.1.2
# TODO: Remove
openstacksdk==4.5.0
requests==2.32.5
23 changes: 23 additions & 0 deletions tests/integration/test_tmp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import requests

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import requests
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.
import requests

from openstack.connection import Connection

def test_openstack(openstack_connection: Connection):
output_filename = "test.image"

request = requests.get(
"https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img",
timeout=60 * 20,
stream=True,
) # nosec: B310, B113

with open(output_filename, "wb") as file:
for chunk in request.iter_content(1024 * 1024): # 1 MB chunks
file.write(chunk)

openstack_connection.create_image(
name="tmp_test",
filename=output_filename,
properties={"architecture": "amd64"},
allow_duplicates=True,
wait=True,
)
Loading