diff --git a/.github/workflows/e2e_test.yaml b/.github/workflows/e2e_test.yaml index ca84e62bae..b847ee0218 100644 --- a/.github/workflows/e2e_test.yaml +++ b/.github/workflows/e2e_test.yaml @@ -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 }} @@ -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 diff --git a/.github/workflows/integration_test.yaml b/.github/workflows/integration_test.yaml index 649d47df23..226d48644b 100644 --- a/.github/workflows/integration_test.yaml +++ b/.github/workflows/integration_test.yaml @@ -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 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c88ff8b1f4..210b1fe60d 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,7 +1,9 @@ name: Tests on: - pull_request: + # TODO: tmp disable for testing. + # pull_request: + workflow_dispatch: jobs: unit-tests: diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index a9436a0259..26a57ee79f 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -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: diff --git a/tests/integration/requirements.txt b/tests/integration/requirements.txt index 062f66c0ba..d489f228c3 100644 --- a/tests/integration/requirements.txt +++ b/tests/integration/requirements.txt @@ -4,3 +4,6 @@ kombu==5.* pygithub pymongo==4.* tenacity==9.1.2 +# TODO: Remove +openstacksdk==4.5.0 +requests==2.32.5 diff --git a/tests/integration/test_tmp.py b/tests/integration/test_tmp.py new file mode 100644 index 0000000000..2ccba8a184 --- /dev/null +++ b/tests/integration/test_tmp.py @@ -0,0 +1,23 @@ +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, + )