diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 1236fec..c41dd77 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -3,11 +3,12 @@ """Trino charm integration test config.""" +import asyncio import logging import pytest import pytest_asyncio -from helpers import APP_NAME, METADATA, NGINX_NAME, WORKER_NAME +from helpers import APP_NAME, METADATA, NGINX_NAME, WORKER_NAME, POSTGRES_NAME from pytest_operator.plugin import OpsTest logger = logging.getLogger(__name__) @@ -17,6 +18,17 @@ @pytest_asyncio.fixture(name="deploy", scope="module") async def deploy(ops_test: OpsTest): """Deploy the app.""" + asyncio.gather( + ops_test.model.deploy(POSTGRES_NAME, channel="14", trust=True), + ) + async with ops_test.fast_forward(): + await ops_test.model.wait_for_idle( + apps=[POSTGRES_NAME], + status="active", + raise_on_blocked=False, + timeout=2000, + ) + charm = await ops_test.build_charm(".") resources = { "trino-image": METADATA["resources"]["trino-image"]["upstream-source"] diff --git a/tox.ini b/tox.ini index ea3a246..97573d5 100644 --- a/tox.ini +++ b/tox.ini @@ -27,7 +27,7 @@ passenv = description = Run integration tests deps = ipdb==0.13.9 - juju==3.2.0.1 + juju==3.1.0.1 pytest==7.4.0 pytest-operator==0.29.0 pytest-asyncio==0.21.0 @@ -41,7 +41,7 @@ commands = description = Run integration tests deps = ipdb==0.13.9 - juju==3.2.0.1 + juju==3.1.0.1 pytest==7.4.0 pytest-operator==0.29.0 pytest-asyncio==0.21.0 @@ -55,7 +55,7 @@ commands = description = Run integration tests deps = ipdb==0.13.9 - juju==3.2.0.1 + juju==3.1.0.1 pytest==7.4.0 pytest-operator==0.29.0 pytest-asyncio==0.21.0