Skip to content

Commit

Permalink
test postgresql deploy from beginning
Browse files Browse the repository at this point in the history
  • Loading branch information
AmberCharitos committed Mar 25, 2024
1 parent 2226a8c commit 2730ed7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
14 changes: 13 additions & 1 deletion tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand All @@ -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"]
Expand Down
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 2730ed7

Please sign in to comment.