Skip to content

Commit

Permalink
Workaround for operator-workflow issues
Browse files Browse the repository at this point in the history
  • Loading branch information
yhaliaw committed Jul 1, 2024
1 parent 1ff61a2 commit ee321c5
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 8 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/integration_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,44 @@ on:
pull_request:

# TODO: debug
# The branch for operator-workflow should be main once the issue is resolved.

jobs:
# test option values defined at test/conftest.py are passed on via repository secret
# INTEGRATION_TEST_ARGS to operator-workflows automatically.
integration-tests-juju2:
name: Integration test with juju 2.9
uses: canonical/operator-workflows/.github/workflows/integration_test.yaml@main
uses: canonical/operator-workflows/.github/workflows/integration_test.yaml@temporary_update_dump_logs_action
secrets: inherit
with:
juju-channel: 2.9/stable
pre-run-script: scripts/pre-integration-test.sh
provider: lxd
test-tox-env: integration-juju2.9
# modules: '["test_charm_base_image", "test_charm_fork_repo", "test_charm_no_runner", "test_charm_scheduled_events", "test_charm_lxd_runner", "test_charm_runner", "test_charm_metrics_success", "test_charm_metrics_failure", "test_self_hosted_runner", "test_charm_with_proxy", "test_charm_with_juju_storage", "test_debug_ssh", "test_charm_upgrade"]'
modules: '["test_charm_runner"]'
modules: '["test_charm_runner", "test_charm_metrics_failure"]'
integration-tests:
name: Integration test with juju 3.1
uses: canonical/operator-workflows/.github/workflows/integration_test.yaml@main
uses: canonical/operator-workflows/.github/workflows/integration_test.yaml@temporary_update_dump_logs_action
secrets: inherit
with:
juju-channel: 3.1/stable
pre-run-script: scripts/pre-integration-test.sh
provider: lxd
test-tox-env: integration-juju3.1
# modules: '["test_charm_base_image", "test_charm_fork_repo", "test_charm_no_runner", "test_charm_scheduled_events", "test_charm_lxd_runner", "test_charm_runner", "test_charm_metrics_success", "test_charm_metrics_failure", "test_self_hosted_runner", "test_charm_with_proxy", "test_charm_with_juju_storage", "test_debug_ssh", "test_charm_upgrade"]'
modules: '["test_charm_runner"]'
modules: '["test_charm_runner", "test_charm_metrics_failure"]'
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@temporary_update_dump_logs_action
secrets: inherit
with:
juju-channel: 3.2/stable
pre-run-script: scripts/setup-lxd.sh
provider: lxd
test-tox-env: integration-juju3.2
# modules: '["test_charm_metrics_failure", "test_charm_metrics_success", "test_charm_fork_repo", "test_charm_runner", "test_e2e"]'
modules: '["test_charm_runner"]'
modules: '["test_charm_runner", "test_charm_metrics_failure"]'
extra-arguments: "-m openstack --openstack-flavor-name=builder-cpu4-ram8-disk50 --http-proxy=http://squid.internal:3128 --https-proxy=http://squid.internal:3128 --no-proxy=keystone.ps6.canonical.com,glance.ps6.canonical.com,nova.ps6.canonical.com,neutron.ps6.canonical.com"
self-hosted-runner: true
self-hosted-runner-label: stg-private-endpoint
10 changes: 8 additions & 2 deletions tests/integration/test_charm_metrics_failure.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ async def app_fixture(
unit = app_for_metric.units[0]
await clear_metrics_log(unit)
await print_loop_device_info(unit, loop_device)
await app_for_metric.set_config(
{
VIRTUAL_MACHINES_CONFIG_NAME: "0",
"repo-policy-compliance-token": "",
"repo-policy-compliance-url": "",
}
)
await reconcile(app=app_for_metric, model=model)

yield app_for_metric

Expand Down Expand Up @@ -100,8 +108,6 @@ async def test_charm_issues_metrics_for_failed_repo_policy(
await app.set_config(
{
VIRTUAL_MACHINES_CONFIG_NAME: "0",
"repo-policy-compliance-token": "",
"repo-policy-compliance-url": "",
}
)
await reconcile(app=app, model=model)
Expand Down
12 changes: 12 additions & 0 deletions tests/integration/test_charm_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,15 @@
InstanceType,
)
from tests.integration.helpers import lxd
<<<<<<< Updated upstream
from tests.integration.helpers.common import DISPATCH_TEST_WORKFLOW_FILENAME, InstanceHelper, dispatch_workflow
=======
from tests.integration.helpers.common import (
DISPATCH_TEST_WORKFLOW_FILENAME,
InstanceHelper,
dispatch_workflow,
)
>>>>>>> Stashed changes
from tests.integration.helpers.openstack import OpenStackInstanceHelper, setup_repo_policy


Expand Down Expand Up @@ -126,6 +134,10 @@ async def test_flush_runner_and_resource_config(
assert len(new_runner_names) == 1
assert new_runner_names[0] != runner_names[0]

<<<<<<< Updated upstream
=======

>>>>>>> Stashed changes
@pytest.mark.openstack
@pytest.mark.asyncio
@pytest.mark.abort_on_fail
Expand Down

0 comments on commit ee321c5

Please sign in to comment.