From 0f34275580f6b51539798e3d125c26c437538d03 Mon Sep 17 00:00:00 2001 From: Mia Altieri Date: Mon, 19 Feb 2024 15:06:04 +0000 Subject: [PATCH] update test charm --- tests/integration/application/src/charm.py | 2 +- tests/integration/helpers.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/integration/application/src/charm.py b/tests/integration/application/src/charm.py index 3b3738bd..1f2deea7 100755 --- a/tests/integration/application/src/charm.py +++ b/tests/integration/application/src/charm.py @@ -34,7 +34,7 @@ def __init__(self, *args): # relation events for mongos client self.database = DatabaseRequires( self, - relation_name="mongos_proxy", + relation_name="mongos", database_name="my-test-db", extra_user_roles=EXTRA_USER_ROLES, ) diff --git a/tests/integration/helpers.py b/tests/integration/helpers.py index 35c39751..e731c5ca 100644 --- a/tests/integration/helpers.py +++ b/tests/integration/helpers.py @@ -26,7 +26,7 @@ async def check_mongos( ops_test: OpsTest, unit: ops.model.Unit, auth: bool, - app_name: Optional[str], + app_name: Optional[str] = None, uri: str = None, external: bool = False, ) -> bool: @@ -71,10 +71,10 @@ async def generate_mongos_uri( host = ( MONGOS_SOCKET if not external - else await get_ip_address(ops_test, app_name=MONGOS_APP_NAME) + else f"{await get_ip_address(ops_test, app_name=MONGOS_APP_NAME)}:27018" ) if not auth: - return f"mongodb://{host}:27018" + return f"mongodb://{host}" secret_uri = await get_application_relation_data( ops_test, app_name, "mongos", "secret-user"