Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: point all the integration charm deps to their 1.8 versions #143

Merged
merged 2 commits into from
Apr 4, 2024
Merged
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
25 changes: 18 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,10 @@ 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 +91,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
Loading