Skip to content

Commit

Permalink
fix: aproxy noble message (#271)
Browse files Browse the repository at this point in the history
* fix: aproxy noble message

* fix: catch only started message

* fix: and the messages from stdout

* fix: pin pytest version

* grafana agent revision pin

* add commejt

* fix: add series
  • Loading branch information
yanksyoon authored Apr 30, 2024
1 parent c7de9e6 commit a01eb78
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -624,10 +624,10 @@ def _configure_aproxy(self, proxy_address: str) -> None:
["snap", "set", "aproxy", f"proxy={proxy_address}", f"listen=:{aproxy_port}"]
)
exit_code, stdout, _ = self.instance.execute(["snap", "logs", "aproxy.aproxy", "-n=all"])
if (
exit_code != 0
or "Started Service for snap application aproxy.aproxy"
not in stdout.read().decode("utf-8")
stdout_message = stdout.read().decode("utf-8")
if exit_code != 0 or (
"Started Service for snap application aproxy.aproxy" not in stdout_message
and "Started snap.aproxy.aproxy.service" not in stdout_message
):
raise RunnerAproxyError("Aproxy service did not configure correctly")

Expand Down
9 changes: 8 additions & 1 deletion tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,14 @@ async def app_with_grafana_agent_integrated_fixture(
model: Model, app_no_runner: Application
) -> AsyncIterator[Application]:
"""Setup the charm to be integrated with grafana-agent using the cos-agent integration."""
grafana_agent = await model.deploy("grafana-agent", channel="latest/edge")
# Pin grafana agent revisions since the recent releases are not compatible with juju 2.9
# (due to usage of juju secrets)
grafana_agent = await model.deploy(
"grafana-agent",
channel="latest/edge",
revision=105,
series="jammy",
)
await model.relate(f"{app_no_runner.name}:cos-agent", f"{grafana_agent.name}:cos-agent")
await model.wait_for_idle(apps=[app_no_runner.name], status=ACTIVE)
await model.wait_for_idle(apps=[grafana_agent.name])
Expand Down
4 changes: 3 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ description = Run integration tests
pass_env =
PYTEST_ADDOPTS
deps =
pytest
# Pin pytest version until the following issue is resolved.
# https://github.com/charmed-kubernetes/pytest-operator/issues/131
pytest==8.1.1
juju3.2: juju==3.2.*
juju3.1: juju==3.1.*
juju2.9: juju==2.9.*
Expand Down

0 comments on commit a01eb78

Please sign in to comment.