Skip to content

Commit b6cda45

Browse files
committed
reverted
1 parent 3bdb2ae commit b6cda45

27 files changed

+35
-203
lines changed

services/dynamic-sidecar/tests/conftest.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
setenvs_from_dict,
2929
setenvs_from_envfile,
3030
)
31-
from pytest_simcore.helpers.postgres_tools import PostgresTestConfig
3231
from simcore_service_dynamic_sidecar.core.reserved_space import (
3332
remove_reserved_disk_space,
3433
)
@@ -151,6 +150,13 @@ def mock_storage_check(mocker: MockerFixture) -> None:
151150
)
152151

153152

153+
@pytest.fixture
154+
def mock_postgres_check(mocker: MockerFixture) -> None:
155+
mocker.patch(
156+
"simcore_service_dynamic_sidecar.core.external_dependencies.wait_for_database_liveness",
157+
)
158+
159+
154160
@pytest.fixture
155161
def mock_rabbit_check(mocker: MockerFixture) -> None:
156162
mocker.patch(
@@ -201,8 +207,8 @@ def base_mock_envs(
201207

202208
@pytest.fixture
203209
def mock_environment(
204-
postgres_host_config: PostgresTestConfig,
205210
mock_storage_check: None,
211+
mock_postgres_check: None,
206212
mock_rabbit_check: None,
207213
monkeypatch: pytest.MonkeyPatch,
208214
base_mock_envs: EnvVarsDict,
@@ -243,6 +249,10 @@ def mock_environment(
243249
"DY_SIDECAR_USER_ID": f"{user_id}",
244250
"DY_SIDECAR_USER_SERVICES_HAVE_INTERNET_ACCESS": "false",
245251
"DYNAMIC_SIDECAR_COMPOSE_NAMESPACE": compose_namespace,
252+
"POSTGRES_DB": "test",
253+
"POSTGRES_HOST": "test",
254+
"POSTGRES_PASSWORD": "test",
255+
"POSTGRES_USER": "test",
246256
"R_CLONE_PROVIDER": "MINIO",
247257
"RABBIT_HOST": "test",
248258
"RABBIT_PASSWORD": "test",

services/dynamic-sidecar/tests/unit/conftest.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from unittest.mock import AsyncMock
99

1010
import pytest
11-
import sqlalchemy as sa
1211
from aiodocker.volumes import DockerVolume
1312
from async_asgi_testclient import TestClient
1413
from fastapi import FastAPI
@@ -31,9 +30,17 @@
3130
logger = logging.getLogger(__name__)
3231

3332

33+
#
34+
# APP and CLIENT fixtures
35+
#
36+
# In this context by default all external services are
37+
# mocked (e.g. registry, rabbitmq, ...)
38+
#
39+
#
40+
41+
3442
@pytest.fixture
3543
def app(
36-
postgres_db: sa.engine.Engine,
3744
mock_environment: EnvVarsDict,
3845
mock_registry_service: AsyncMock,
3946
mock_core_rabbitmq: dict[str, AsyncMock],

services/dynamic-sidecar/tests/unit/test__oas_spec.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,6 @@
99
from fastapi import FastAPI
1010
from pytest_simcore.helpers.monkeypatch_envs import EnvVarsDict
1111

12-
pytest_simcore_core_services_selection = [
13-
"postgres",
14-
]
15-
16-
pytest_simcore_ops_services_selection = [
17-
"adminer",
18-
]
19-
2012

2113
@pytest.fixture
2214
def mock_environment(mock_environment_with_envdevel: EnvVarsDict) -> None:

services/dynamic-sidecar/tests/unit/test_api_rest_containers.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,6 @@
4747
from tenacity.stop import stop_after_delay
4848
from tenacity.wait import wait_fixed
4949

50-
pytest_simcore_core_services_selection = [
51-
"postgres",
52-
]
53-
54-
pytest_simcore_ops_services_selection = [
55-
"adminer",
56-
]
57-
5850
WAIT_FOR_OUTPUTS_WATCHER: Final[float] = 0.1
5951
FAST_POLLING_INTERVAL: Final[float] = 0.1
6052

services/dynamic-sidecar/tests/unit/test_api_rest_containers_long_running_tasks.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,6 @@
4747
from simcore_service_dynamic_sidecar.modules.outputs._context import OutputsContext
4848
from simcore_service_dynamic_sidecar.modules.outputs._manager import OutputsManager
4949

50-
pytest_simcore_core_services_selection = [
51-
"postgres",
52-
]
53-
54-
pytest_simcore_ops_services_selection = [
55-
"adminer",
56-
]
57-
5850
FAST_STATUS_POLL: Final[float] = 0.1
5951
CREATE_SERVICE_CONTAINERS_TIMEOUT: Final[float] = 60
6052
DEFAULT_COMMAND_TIMEOUT: Final[int] = 5

services/dynamic-sidecar/tests/unit/test_api_rest_disk.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,6 @@
77
_RESERVED_DISK_SPACE_NAME,
88
)
99

10-
pytest_simcore_core_services_selection = [
11-
"postgres",
12-
]
13-
14-
pytest_simcore_ops_services_selection = [
15-
"adminer",
16-
]
17-
1810

1911
async def test_reserved_disk_space_freed(
2012
cleanup_reserved_disk_space: None, test_client: TestClient

services/dynamic-sidecar/tests/unit/test_api_rest_health.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,6 @@
77
ApplicationHealth,
88
)
99

10-
pytest_simcore_core_services_selection = [
11-
"postgres",
12-
]
13-
14-
pytest_simcore_ops_services_selection = [
15-
"adminer",
16-
]
17-
1810

1911
async def test_is_healthy(test_client: TestClient) -> None:
2012
test_client.application.state.application_health.is_healthy = True

services/dynamic-sidecar/tests/unit/test_api_rest_prometheus_metrics.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,6 @@
3232
UserServicesMetrics,
3333
)
3434

35-
pytest_simcore_core_services_selection = [
36-
"postgres",
37-
]
38-
39-
pytest_simcore_ops_services_selection = [
40-
"adminer",
41-
]
42-
4335
_FAST_STATUS_POLL: Final[float] = 0.1
4436
_CREATE_SERVICE_CONTAINERS_TIMEOUT: Final[float] = 60
4537

services/dynamic-sidecar/tests/unit/test_api_rest_volumes.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,6 @@
99
from simcore_service_dynamic_sidecar._meta import API_VTAG
1010
from simcore_service_dynamic_sidecar.models.shared_store import SharedStore
1111

12-
pytest_simcore_core_services_selection = [
13-
"postgres",
14-
]
15-
16-
pytest_simcore_ops_services_selection = [
17-
"adminer",
18-
]
19-
2012

2113
@pytest.mark.parametrize(
2214
"volume_category, initial_expected_status",

services/dynamic-sidecar/tests/unit/test_api_rest_workflow_service_metrics.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,6 @@
4949
from tenacity.stop import stop_after_delay
5050
from tenacity.wait import wait_fixed
5151

52-
pytest_simcore_core_services_selection = [
53-
"postgres",
54-
]
55-
56-
pytest_simcore_ops_services_selection = [
57-
"adminer",
58-
]
59-
6052
_FAST_STATUS_POLL: Final[float] = 0.1
6153
_CREATE_SERVICE_CONTAINERS_TIMEOUT: Final[float] = 60
6254
_BASE_HEART_BEAT_INTERVAL: Final[float] = 0.1

0 commit comments

Comments
 (0)