Skip to content

Commit

Permalink
tests: point all the integration charm deps to their 1.8 versions
Browse files Browse the repository at this point in the history
The integration tests were deploying versions of dependency charms that do not correspond to the current release of this charm(s). This commit brings all the correct versions and configure charms accordingly to ensure the integration tests execute in the same environment as this version of the charm(s) was design for.
  • Loading branch information
DnPlas committed Apr 4, 2024
1 parent aee6aa4 commit 793a502
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions tests/integration/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,24 @@
import yaml
from pytest_operator.plugin import OpsTest

# Test dependencies
DEX_AUTH = "dex-auth"
DEX_AUTH_CHANNEL = "2.36/stable"
TRUST_DEX_AUTH = True
ISTIO_PILOT = "istio-pilot"
ISTIO_PILOT_CHANNEL = "1.17/stable"
TRUST_ISTIO_PILOT = True

METADATA = yaml.safe_load(Path("./metadata.yaml").read_text())
PUBLIC_URL = "test-url"
APP_NAME = METADATA["name"]
APP_PREV_VERSION = "ckf-1.7/stable"
TRUST_PREV_APP = True
OIDC_CONFIG = {
"client-name": "Ambassador Auth OIDC",
"client-secret": "oidc-client-secret",
}
ISTIO_PILOT = "istio-pilot"
DEX_AUTH = "dex-auth"
PUBLIC_URL = "test-url"

image_path = METADATA["resources"]["oci-image"]["upstream-source"]
RESOURCES = {"oci-image": image_path}

Expand Down Expand Up @@ -49,8 +58,8 @@ async def test_deploy(self, ops_test: OpsTest):

@pytest.mark.abort_on_fail
async def test_relations(self, ops_test: OpsTest):
await ops_test.model.deploy(ISTIO_PILOT, channel="1.16/stable", trust=True)
await ops_test.model.deploy(DEX_AUTH, channel="2.31/stable", trust=True)
await ops_test.model.deploy(ISTIO_PILOT, channel=ISTIO_PILOT_CHANNEL, trust=TRUST_ISTIO_PILOT)
await ops_test.model.deploy(DEX_AUTH, channel=DEX_AUTH_CHANNEL, trust=TRUST_DEX_AUTH)
await ops_test.model.add_relation(ISTIO_PILOT, DEX_AUTH)
await ops_test.model.add_relation(f"{ISTIO_PILOT}:ingress", f"{APP_NAME}:ingress")
await ops_test.model.add_relation(
Expand Down Expand Up @@ -80,15 +89,15 @@ async def test_remove_application(self, ops_test: OpsTest):
async def test_upgrade(self, ops_test: OpsTest):
"""Test that charm can be upgraded from podspec to sidecar.
For this test we use 1.7/stable channel as the source for podspec charm.
For this test we use APP_PREV_VERSION channel as the source for podspec charm.
Note: juju has a bug due to which you have to first scale podspec charm to 0,
then refresh, then scale up newly deployed app.
See https://github.com/juju/juju/pull/15701 for more info.
"""
print(f"Deploy {APP_NAME} from stable channel")
await ops_test.model.deploy(
APP_NAME, channel="ckf-1.7/stable", trust=True, config=OIDC_CONFIG
APP_NAME, channel=APP_PREV_VERSION, trust=TRUST_PREV_APP, config=OIDC_CONFIG
)
await ops_test.model.add_relation(f"{ISTIO_PILOT}:ingress", f"{APP_NAME}:ingress")
await ops_test.model.add_relation(
Expand Down

0 comments on commit 793a502

Please sign in to comment.