diff --git a/.github/workflows/integration_test.yaml b/.github/workflows/integration_test.yaml index b1a4998a..64936605 100644 --- a/.github/workflows/integration_test.yaml +++ b/.github/workflows/integration_test.yaml @@ -16,3 +16,5 @@ jobs: extra-arguments: --localstack-address 172.17.0.1 -m "not (requires_secrets)" pre-run-script: localstack-installation.sh trivy-image-config: "trivy.yaml" + juju-channel: 3.1/stable + channel: 1.28-strict/stable diff --git a/.github/workflows/integration_test_with_secrets.yaml b/.github/workflows/integration_test_with_secrets.yaml index 10ae1000..6f47ac99 100644 --- a/.github/workflows/integration_test_with_secrets.yaml +++ b/.github/workflows/integration_test_with_secrets.yaml @@ -16,3 +16,5 @@ jobs: extra-arguments: --localstack-address 172.17.0.1 -m "requires_secrets" pre-run-script: localstack-installation.sh trivy-image-config: "trivy.yaml" + juju-channel: 3.1/stable + channel: 1.28-strict/stable diff --git a/tests/integration/test_charm.py b/tests/integration/test_charm.py index 7d7bc09e..05bd0130 100644 --- a/tests/integration/test_charm.py +++ b/tests/integration/test_charm.py @@ -48,10 +48,11 @@ async def test_prom_exporter_is_up(app: Application): assert discourse_unit cmd = f"/usr/bin/curl -m 30 http://localhost:{PROMETHEUS_PORT}/metrics" action = await discourse_unit.run(cmd, timeout=60) - code = action.results.get("Code") - stdout = action.results.get("Stdout") - stderr = action.results.get("Stderr") - assert code == "0", f"{cmd} failed ({code}): {stderr or stdout}" + await action.wait() + code = action.results.get("return-code") + stdout = action.results.get("stdout") + stderr = action.results.get("stderr") + assert code == 0, f"{cmd} failed ({code}): {stderr or stdout}" @pytest.mark.asyncio @@ -96,7 +97,8 @@ async def test_s3_conf(app: Application, localstack_address: str, model: Model): action = await app.units[0].run( # type: ignore f'echo "{s3_conf["ip_address"]} {s3_conf["bucket"]}.s3.{s3_conf["domain"]}" >> /etc/hosts' ) - assert action.results.get("Code") == "0", "Can't inject S3 IP in Discourse hosts" + await action.wait() + assert action.results.get("return-code") == 0, "Can't inject S3 IP in Discourse hosts" logger.info("Injected bucket subdomain in hosts, configuring settings for discourse") # Application does actually have attribute set_config diff --git a/tox.ini b/tox.ini index d87d4aed..2a18a46d 100644 --- a/tox.ini +++ b/tox.ini @@ -45,7 +45,7 @@ deps = flake8-docstrings-complete flake8-test-docs isort - juju<3.0 + juju>=3.0 mypy ops>=2.6.0 ops-lib-pgsql @@ -112,7 +112,7 @@ deps = boto3 bs4 cosl - juju<3.0 + juju>=3.0 pytest pytest-operator pytest-asyncio