Skip to content

Commit

Permalink
Debug
Browse files Browse the repository at this point in the history
  • Loading branch information
saltiyazan committed Oct 10, 2024
1 parent 364e4ec commit 53f1025
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions tests/integration/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ async def test_build_and_deploy(ops_test: OpsTest, request: pytest.FixtureReques
await ops_test.model.deploy(
"loki-k8s", application_name=LOKI_APPLICATION_NAME, trust=True, channel="stable"
)
await ops_test.model.deploy(
TRAEIK_K8S_APPLICATION_NAME,
application_name=TRAEIK_K8S_APPLICATION_NAME,
trust=True,
channel="stable",
)
await ops_test.model.wait_for_idle(apps=[APP_NAME], status="active", timeout=1000)


Expand Down Expand Up @@ -192,12 +198,6 @@ async def test_given_loki_and_prometheus_related_to_notary_all_charm_statuses_ac
async def test_given_application_deployed_when_related_to_traefik_k8s_then_all_statuses_active(
ops_test: OpsTest,
):
await ops_test.model.deploy(
TRAEIK_K8S_APPLICATION_NAME,
application_name=TRAEIK_K8S_APPLICATION_NAME,
trust=True,
channel="stable",
)
# TODO (Tracked in TLSENG-475): This is a workaround so Traefik has the same CA as Notary
# This should be removed and certificate transfer should be used instead
# Notary k8s implements V1 of the certificate transfer interface,
Expand All @@ -218,6 +218,9 @@ async def test_given_application_deployed_when_related_to_traefik_k8s_then_all_s
raise_on_error=True,
)
endpoint = await get_external_notary_endpoint(ops_test)
logger.info("===========")
logger.info(endpoint)
logger.info("===========")
client = Notary(url=endpoint)
assert client.is_api_available()

Expand All @@ -232,6 +235,9 @@ async def get_notary_endpoint(ops_test: OpsTest) -> str:
async def get_external_notary_endpoint(ops_test: OpsTest) -> str:
assert ops_test.model
traefik_proxied_endpoints = await run_show_traefik_proxied_endpoints_action(ops_test)
logger.info("===========")
logger.info(traefik_proxied_endpoints)
logger.info("===========")
return json.loads(traefik_proxied_endpoints).get(APP_NAME, "").get("url", "")


Expand Down Expand Up @@ -267,6 +273,9 @@ async def run_show_traefik_proxied_endpoints_action(ops_test: OpsTest) -> str:
traefik_k8s_unit = ops_test.model.units[f"{TRAEIK_K8S_APPLICATION_NAME}/0"]
action = await traefik_k8s_unit.run_action(action_name="show-proxied-endpoints") # type: ignore
action_output = await ops_test.model.get_action_output(action_uuid=action.entity_id, wait=30)
logger.info("===========")
logger.info(action_output)
logger.info("===========")
return action_output.get("proxied-endpoints", "")


Expand Down

0 comments on commit 53f1025

Please sign in to comment.