From 23e152329202f285587889c282400e2cbb9c311f Mon Sep 17 00:00:00 2001 From: Orfeas Kourkakis Date: Mon, 26 Aug 2024 18:18:38 +0300 Subject: [PATCH] tests: build charms sequentially --- tests/test_bundle.py | 7 ++++--- tests/test_bundle_tls_provider.py | 12 +++++------- tests/test_bundle_tls_secret.py | 12 +++++------- tests/test_cos_integration.py | 7 ++++--- 4 files changed, 18 insertions(+), 20 deletions(-) diff --git a/tests/test_bundle.py b/tests/test_bundle.py index 2a5b5687..584a4d48 100644 --- a/tests/test_bundle.py +++ b/tests/test_bundle.py @@ -80,13 +80,14 @@ async def test_kubectl_access(ops_test: OpsTest): async def test_build_and_deploy_istio_charms(ops_test: OpsTest): # Build, deploy, and relate istio charms charms_path = "./charms/istio" - istio_charms = await ops_test.build_charms(f"{charms_path}-gateway", f"{charms_path}-pilot") + istio_pilot = await ops_test.build_charm(f"{charms_path}-pilot") + istio_gateway = await ops_test.build_charm(f"{charms_path}-gateway") await ops_test.model.deploy( - istio_charms["istio-pilot"], application_name=ISTIO_PILOT, series="focal", trust=True + istio_pilot, application_name=ISTIO_PILOT, series="focal", trust=True ) await ops_test.model.deploy( - istio_charms["istio-gateway"], + istio_gateway, application_name=ISTIO_GATEWAY_APP_NAME, series="focal", config={"kind": "ingress"}, diff --git a/tests/test_bundle_tls_provider.py b/tests/test_bundle_tls_provider.py index 7bd8433b..74850556 100644 --- a/tests/test_bundle_tls_provider.py +++ b/tests/test_bundle_tls_provider.py @@ -29,18 +29,16 @@ def lightkube_client() -> lightkube.Client: async def test_build_and_deploy_istio_charms(ops_test: OpsTest): """Build and deploy istio-operators with TLS configuration.""" charms_path = "./charms/istio" - istio_charms = await ops_test.build_charms(f"{charms_path}-gateway", f"{charms_path}-pilot") + istio_pilot = await ops_test.build_charm(f"{charms_path}-pilot") + istio_gateway = await ops_test.build_charm(f"{charms_path}-gateway") await ops_test.model.deploy( - istio_charms["istio-pilot"], - application_name=ISTIO_PILOT, - config={"default-gateway": DEFAULT_GATEWAY_NAME}, - trust=True, + istio_pilot, application_name=ISTIO_PILOT, series="focal", trust=True ) - await ops_test.model.deploy( - istio_charms["istio-gateway"], + istio_gateway, application_name=ISTIO_GATEWAY_APP_NAME, + series="focal", config={"kind": "ingress"}, trust=True, ) diff --git a/tests/test_bundle_tls_secret.py b/tests/test_bundle_tls_secret.py index f9726b1d..261427b8 100644 --- a/tests/test_bundle_tls_secret.py +++ b/tests/test_bundle_tls_secret.py @@ -26,18 +26,16 @@ def lightkube_client() -> lightkube.Client: async def test_build_and_deploy_istio_charms(ops_test: OpsTest): """Build and deploy istio-operators with TLS configuration.""" charms_path = "./charms/istio" - istio_charms = await ops_test.build_charms(f"{charms_path}-gateway", f"{charms_path}-pilot") + istio_pilot = await ops_test.build_charm(f"{charms_path}-pilot") + istio_gateway = await ops_test.build_charm(f"{charms_path}-gateway") await ops_test.model.deploy( - istio_charms["istio-pilot"], - application_name=ISTIO_PILOT, - config={"default-gateway": DEFAULT_GATEWAY_NAME}, - trust=True, + istio_pilot, application_name=ISTIO_PILOT, series="focal", trust=True ) - await ops_test.model.deploy( - istio_charms["istio-gateway"], + istio_gateway, application_name=ISTIO_GATEWAY_APP_NAME, + series="focal", config={"kind": "ingress"}, trust=True, ) diff --git a/tests/test_cos_integration.py b/tests/test_cos_integration.py index 7743040a..a243f51b 100644 --- a/tests/test_cos_integration.py +++ b/tests/test_cos_integration.py @@ -30,13 +30,14 @@ async def test_build_and_deploy_istio_charms(ops_test: OpsTest): # Build, deploy, and relate istio charms charms_path = "./charms/istio" - istio_charms = await ops_test.build_charms(f"{charms_path}-gateway", f"{charms_path}-pilot") + istio_pilot = await ops_test.build_charm(f"{charms_path}-pilot") + istio_gateway = await ops_test.build_charm(f"{charms_path}-gateway") await ops_test.model.deploy( - istio_charms["istio-pilot"], application_name=ISTIO_PILOT, series="focal", trust=True + istio_pilot, application_name=ISTIO_PILOT, series="focal", trust=True ) await ops_test.model.deploy( - istio_charms["istio-gateway"], + istio_gateway, application_name=ISTIO_GATEWAY_APP_NAME, series="focal", config={"kind": "ingress"},