Skip to content

Commit bdba487

Browse files
committed
fixed tests dependencies
1 parent 1e1d504 commit bdba487

8 files changed

+53
-14
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
from servicelib.rabbitmq.rpc_interfaces.dynamic_sidecar import disk_usage
1616
from settings_library.rabbit import RabbitSettings
1717
from settings_library.redis import RedisSettings
18-
from simcore_service_dynamic_sidecar.core.application import create_app
1918
from simcore_service_dynamic_sidecar.core.settings import ApplicationSettings
2019
from simcore_service_dynamic_sidecar.modules.system_monitor._disk_usage import (
2120
get_disk_usage_monitor,
@@ -54,8 +53,7 @@ def mock_environment(
5453

5554

5655
@pytest.fixture
57-
async def app(mock_environment: EnvVarsDict) -> AsyncIterable[FastAPI]:
58-
app = create_app()
56+
async def app(app: FastAPI, mock_environment: EnvVarsDict) -> AsyncIterable[FastAPI]:
5957
async with LifespanManager(app):
6058
yield app
6159

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@
1717
)
1818
from simcore_service_dynamic_sidecar.modules.mounted_fs import MountedVolumes
1919

20+
pytest_simcore_core_services_selection = [
21+
"postgres",
22+
]
23+
24+
pytest_simcore_ops_services_selection = [
25+
"adminer",
26+
]
27+
2028

2129
@pytest.fixture
2230
def incoming_iseg_compose_file_content() -> str:

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,13 @@
1717
_name_from_full_path,
1818
)
1919

20-
# UTILS
20+
pytest_simcore_core_services_selection = [
21+
"postgres",
22+
]
23+
24+
pytest_simcore_ops_services_selection = [
25+
"adminer",
26+
]
2127

2228

2329
def _replace_slashes(path: Path) -> str:

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
from pytest_simcore.helpers.monkeypatch_envs import EnvVarsDict, setenvs_from_dict
3939
from servicelib.utils import logged_gather
4040
from settings_library.rabbit import RabbitSettings
41-
from simcore_service_dynamic_sidecar.core.application import create_app
4241
from simcore_service_dynamic_sidecar.core.settings import ApplicationSettings
4342
from simcore_service_dynamic_sidecar.modules.notifications import (
4443
PortNotifier,
@@ -84,6 +83,7 @@ def mock_environment(
8483

8584
@pytest.fixture
8685
async def app(
86+
app: FastAPI,
8787
mock_environment: EnvVarsDict,
8888
mock_registry_service: AsyncMock,
8989
mock_storage_check: None,
@@ -94,7 +94,6 @@ async def app(
9494
return_value=[],
9595
)
9696

97-
app: FastAPI = create_app()
9897
async with LifespanManager(app):
9998
yield app
10099

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
# pylint:disable=unused-argument
33

44
import asyncio
5+
from collections.abc import AsyncIterator
56
from pathlib import Path
6-
from typing import AsyncIterator
77
from unittest.mock import AsyncMock
88

99
import pytest
@@ -24,15 +24,22 @@
2424
from tenacity.stop import stop_after_delay
2525
from tenacity.wait import wait_fixed
2626

27+
pytest_simcore_core_services_selection = [
28+
"postgres",
29+
]
30+
31+
pytest_simcore_ops_services_selection = [
32+
"adminer",
33+
]
34+
35+
2736
_TENACITY_RETRY_PARAMS = {
2837
"reraise": True,
2938
"retry": retry_if_exception_type(AssertionError),
3039
"stop": stop_after_delay(10),
3140
"wait": wait_fixed(0.01),
3241
}
3342

34-
# FIXTURES
35-
3643

3744
@pytest.fixture
3845
def outputs_path(tmp_path: Path) -> Path:

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@
2929
FileSystemEvent,
3030
)
3131

32+
pytest_simcore_core_services_selection = [
33+
"postgres",
34+
]
35+
36+
pytest_simcore_ops_services_selection = [
37+
"adminer",
38+
]
39+
3240

3341
@pytest.fixture
3442
def path_to_observe(tmp_path: Path) -> Path:
@@ -232,7 +240,6 @@ def get(self) -> Any | None:
232240
def test_port_keys_event_handler_triggers_for_events(
233241
mock_state_path: Path, event: FileSystemEvent, expected_port_key: str | None
234242
) -> None:
235-
236243
queue = _MockAioQueue()
237244

238245
event_handler = _PortKeysEventHandler(mock_state_path, queue)

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
import asyncio
66
import inspect
7+
from collections.abc import AsyncIterator, Iterator
78
from dataclasses import dataclass
89
from inspect import FullArgSpec
910
from pathlib import Path
10-
from typing import AsyncIterator, Iterator
1111
from unittest.mock import AsyncMock
1212

1313
import pytest
@@ -36,7 +36,13 @@
3636
setup_outputs_manager,
3737
)
3838

39-
# UTILS
39+
pytest_simcore_core_services_selection = [
40+
"postgres",
41+
]
42+
43+
pytest_simcore_ops_services_selection = [
44+
"adminer",
45+
]
4046

4147

4248
@dataclass
@@ -106,7 +112,7 @@ async def _mock_upload_outputs(*args, **kwargs) -> None:
106112
side_effect=_mock_upload_outputs,
107113
)
108114

109-
yield error_toggle
115+
return error_toggle
110116

111117

112118
@pytest.fixture(params=[1, 4, 10])

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@
4646
from tenacity.stop import stop_after_delay
4747
from tenacity.wait import wait_fixed
4848

49+
pytest_simcore_core_services_selection = [
50+
"postgres",
51+
]
52+
53+
pytest_simcore_ops_services_selection = [
54+
"adminer",
55+
]
56+
4957
_TENACITY_RETRY_PARAMS = {
5058
"reraise": True,
5159
"retry": retry_if_exception_type(AssertionError),
@@ -196,7 +204,7 @@ def file_generation_info(request: pytest.FixtureRequest) -> FileGenerationInfo:
196204
# UTILS
197205

198206

199-
async def random_events_in_path( # noqa: C901
207+
async def random_events_in_path(
200208
*,
201209
port_key_path: Path,
202210
files_per_port_key: NonNegativeInt,

0 commit comments

Comments
 (0)