Skip to content

Commit

Permalink
drop relation name constant, fix waiting for apps
Browse files Browse the repository at this point in the history
  • Loading branch information
rgildein committed Jun 10, 2024
1 parent 486c8a1 commit 49e9580
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 1 addition & 3 deletions src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

METRICS_PATH = "/metrics"
METRICS_PORT = "5558"
LOGGING_RELATION_NAME = "logging"


class Operator(CharmBase):
Expand Down Expand Up @@ -55,9 +54,8 @@ def __init__(self, *args):
}
],
)
self._logging = LogForwarder(charm=self, relation_name=LOGGING_RELATION_NAME)

self.dashboard_provider = GrafanaDashboardProvider(self)
self._logging = LogForwarder(charm=self)

self._container_name = "dex"
self._namespace = self.model.name
Expand Down
9 changes: 8 additions & 1 deletion tests/integration/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ async def test_build_and_deploy(ops_test):
await ops_test.model.wait_for_idle(
apps=[DEX_AUTH_APP_NAME], status="active", raise_on_blocked=True, timeout=600
)
assert ops_test.model.applications[DEX_AUTH_APP_NAME].units[0].workload_status == "active"

# Deploying grafana-agent-k8s and add all relations
await deploy_and_assert_grafana_agent(
Expand Down Expand Up @@ -169,6 +168,14 @@ async def test_relations(ops_test: OpsTest):
await ops_test.model.applications[OIDC_GATEKEEPER].set_config({"public-url": public_url})

await ops_test.model.wait_for_idle(
apps=[
DEX_AUTH_APP_NAME,
ISTIO_PILOT,
ISTIO_GATEWAY_APP_NAME,
OIDC_GATEKEEPER,
KUBEFLOW_PROFILES,
KUBEFLOW_DASHBOARD,
],
status="active",
raise_on_blocked=False,
raise_on_error=True,
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def harness():
def test_log_forwarding(harness):
with patch("charm.LogForwarder") as mock_logging:
harness.begin()
mock_logging.assert_called_once_with(charm=harness.charm, relation_name="logging")
mock_logging.assert_called_once_with(charm=harness.charm)


@patch("charm.KubernetesServicePatch", lambda *_, **__: None)
Expand Down

0 comments on commit 49e9580

Please sign in to comment.