Skip to content

Commit a53a91c

Browse files
committed
fixed test. removed aiopg
1 parent 9ca5e5a commit a53a91c

File tree

3 files changed

+9
-21
lines changed

3 files changed

+9
-21
lines changed

services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/external_dependencies.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
from common_library.errors_classes import OsparcErrorMixin
22
from fastapi import FastAPI
3+
from servicelib.db_async_engine import connect_to_db
34
from servicelib.utils import logged_gather
5+
from settings_library.postgres import PostgresSettings
46

5-
from .postgres import wait_for_postgres_liveness
67
from .rabbitmq import wait_for_rabbitmq_liveness
78
from .registry import wait_for_registries_liveness
9+
from .settings import ApplicationSettings
810
from .storage import wait_for_storage_liveness
911

1012

@@ -21,9 +23,13 @@ def setup_check_dependencies(app: FastAPI) -> None:
2123
# start rapidly, for this reason they are run in
2224
# parallel.
2325
async def on_startup() -> None:
26+
app_settings = app.state.settings
27+
assert isinstance(app_settings, ApplicationSettings) # nosec
28+
postgres_settings = app_settings.POSTGRES_SETTINGS
29+
assert isinstance(postgres_settings, PostgresSettings) # nosec
2430
liveliness_results = await logged_gather(
2531
*[
26-
wait_for_postgres_liveness(app),
32+
connect_to_db(app, postgres_settings),
2733
wait_for_rabbitmq_liveness(app),
2834
wait_for_registries_liveness(app),
2935
wait_for_storage_liveness(app),

services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/postgres.py

Lines changed: 0 additions & 18 deletions
This file was deleted.

services/dynamic-sidecar/tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def mock_storage_check(mocker: MockerFixture) -> None:
152152
@pytest.fixture
153153
def mock_postgres_check(mocker: MockerFixture) -> None:
154154
mocker.patch(
155-
"simcore_service_dynamic_sidecar.core.external_dependencies.wait_for_postgres_liveness",
155+
"simcore_service_dynamic_sidecar.core.external_dependencies.connect_to_db",
156156
)
157157

158158

0 commit comments

Comments
 (0)