Skip to content

Commit 10141f7

Browse files
committed
add dependencies
1 parent 295889d commit 10141f7

16 files changed

+137
-15
lines changed

services/dynamic-sidecar/tests/unit/test_api_rest_containers.py renamed to services/dynamic-sidecar/tests/unit/__test_api_rest_containers.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55

66
import asyncio
77
import json
8-
from collections.abc import AsyncIterable
8+
from collections.abc import AsyncIterable, AsyncIterator
99
from inspect import signature
1010
from pathlib import Path
11-
from typing import Any, AsyncIterator, Final
11+
from typing import Any, Final
1212
from unittest.mock import AsyncMock, Mock
1313
from uuid import uuid4
1414

@@ -47,6 +47,14 @@
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+
5058
WAIT_FOR_OUTPUTS_WATCHER: Final[float] = 0.1
5159
FAST_POLLING_INTERVAL: Final[float] = 0.1
5260

@@ -135,7 +143,6 @@ async def _start_containers(
135143

136144

137145
async def _docker_ps_a_container_names() -> list[str]:
138-
# TODO: replace with aiodocker this is legacy by now
139146
command = 'docker ps -a --format "{{.Names}}"'
140147
success, stdout, *_ = await async_command(command=command, timeout=None)
141148

@@ -163,7 +170,9 @@ async def _assert_compose_spec_pulled(compose_spec: str, settings: ApplicationSe
163170

164171

165172
@pytest.fixture
166-
def mock_environment(mock_rabbitmq_envs: EnvVarsDict) -> EnvVarsDict:
173+
def mock_environment(
174+
mock_environment: EnvVarsDict, mock_rabbitmq_envs: EnvVarsDict
175+
) -> EnvVarsDict:
167176
return mock_rabbitmq_envs
168177

169178

@@ -451,7 +460,6 @@ def _expected_error_string(status_code: int) -> dict[str, Any]:
451460
}
452461

453462
for container in started_containers:
454-
455463
# inspect container
456464
response = await test_client.get(f"/{API_VTAG}/containers/{container}")
457465
assert response.status_code == mock_aiodocker_containers_get, response.text
@@ -702,9 +710,9 @@ def define_inactivity_command(
702710
@pytest.fixture
703711
def mock_shared_store(app: FastAPI) -> None:
704712
shared_store: SharedStore = app.state.shared_store
705-
shared_store.original_to_container_names[
713+
shared_store.original_to_container_names["mock_container_name"] = (
706714
"mock_container_name"
707-
] = "mock_container_name"
715+
)
708716

709717

710718
async def test_containers_activity_command_failed(

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@
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+
5058
FAST_STATUS_POLL: Final[float] = 0.1
5159
CREATE_SERVICE_CONTAINERS_TIMEOUT: Final[float] = 60
5260
DEFAULT_COMMAND_TIMEOUT: Final[int] = 5
@@ -389,9 +397,11 @@ async def test_create_containers_task(
389397
mock_metrics_params: CreateServiceMetricsAdditionalParams,
390398
shared_store: SharedStore,
391399
) -> None:
392-
last_progress_message: tuple[str, float] | None = None
400+
last_progress_message: tuple[str, ProgressPercent | None] | None = None
393401

394-
async def create_progress(message: str, percent: float, _: TaskId) -> None:
402+
async def create_progress(
403+
message: str, percent: ProgressPercent | None, _: TaskId
404+
) -> None:
395405
nonlocal last_progress_message
396406
last_progress_message = (message, percent)
397407
print(message, percent)

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@
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+
1018

1119
async def test_reserved_disk_space_freed(
1220
cleanup_reserved_disk_space: None, test_client: TestClient

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

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

35+
pytest_simcore_core_services_selection = [
36+
"postgres",
37+
]
38+
39+
pytest_simcore_ops_services_selection = [
40+
"adminer",
41+
]
42+
3543
_FAST_STATUS_POLL: Final[float] = 0.1
3644
_CREATE_SERVICE_CONTAINERS_TIMEOUT: Final[float] = 60
3745

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@
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+
1220

1321
@pytest.mark.parametrize(
1422
"volume_category, initial_expected_status",

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@
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+
5260
_FAST_STATUS_POLL: Final[float] = 0.1
5361
_CREATE_SERVICE_CONTAINERS_TIMEOUT: Final[float] = 60
5462
_BASE_HEART_BEAT_INTERVAL: Final[float] = 0.1

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
# pylint:disable=redefined-outer-name
33
# pylint:disable=unused-argument
44

5-
from collections.abc import Awaitable, Callable
6-
from typing import AsyncIterable
5+
from collections.abc import AsyncIterable, Awaitable, Callable
76
from unittest.mock import AsyncMock
87

98
import pytest
@@ -23,10 +22,15 @@
2322
)
2423

2524
pytest_simcore_core_services_selection = [
25+
"postgres",
2626
"redis",
2727
"rabbit",
2828
]
2929

30+
pytest_simcore_ops_services_selection = [
31+
"adminer",
32+
]
33+
3034

3135
@pytest.fixture
3236
def mock_environment(

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@
1111
from simcore_service_dynamic_sidecar.cli import main
1212
from typer.testing import CliRunner
1313

14+
pytest_simcore_core_services_selection = [
15+
"postgres",
16+
]
17+
18+
pytest_simcore_ops_services_selection = [
19+
"adminer",
20+
]
21+
1422

1523
@pytest.fixture
1624
def cli_runner(mock_environment: EnvVarsDict) -> CliRunner:

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@
1111
from simcore_service_dynamic_sidecar.core.settings import ApplicationSettings
1212
from simcore_service_dynamic_sidecar.models.shared_store import SharedStore
1313

14+
pytest_simcore_core_services_selection = [
15+
"postgres",
16+
]
17+
18+
pytest_simcore_ops_services_selection = [
19+
"adminer",
20+
]
21+
1422

1523
def test_create_app(mock_environment_with_envdevel: EnvVarsDict):
1624
app = create_app()

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@
2323
from simcore_service_dynamic_sidecar.core.settings import ApplicationSettings
2424
from simcore_service_dynamic_sidecar.core.utils import CommandResult
2525

26+
pytest_simcore_core_services_selection = [
27+
"postgres",
28+
]
29+
30+
pytest_simcore_ops_services_selection = [
31+
"adminer",
32+
]
33+
2634
SLEEP_TIME_S = 60
2735
COMPOSE_SPEC_SAMPLE = {
2836
"services": {

0 commit comments

Comments
 (0)