diff --git a/src/runner.py b/src/runner.py index a13fa2b88..2a4348467 100644 --- a/src/runner.py +++ b/src/runner.py @@ -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") diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 1685323e9..12b5125b9 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -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]) diff --git a/tox.ini b/tox.ini index c3c4a94ee..c1f5e9565 100644 --- a/tox.ini +++ b/tox.ini @@ -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.*