|
8 | 8 | from typing import Any |
9 | 9 | from unittest import mock |
10 | 10 |
|
11 | | -import aiopg |
12 | | -import aiopg.sa |
13 | 11 | import pytest |
14 | 12 | import socketio |
15 | 13 | import sqlalchemy as sa |
16 | 14 | from aiohttp.test_utils import TestClient |
| 15 | +from aioresponses import aioresponses as AioResponsesMock |
17 | 16 | from faker import Faker |
18 | 17 | from models_library.api_schemas_webserver.socketio import SocketIORoomStr |
19 | 18 | from models_library.progress_bar import ProgressReport |
|
63 | 62 | ) |
64 | 63 | from simcore_service_webserver.socketio.models import WebSocketNodeProgress |
65 | 64 | from simcore_service_webserver.socketio.plugin import setup_socketio |
| 65 | +from sqlalchemy.ext.asyncio import AsyncEngine |
66 | 66 | from tenacity import RetryError |
67 | 67 | from tenacity.asyncio import AsyncRetrying |
68 | 68 | from tenacity.retry import retry_always, retry_if_exception_type |
|
76 | 76 | ] |
77 | 77 |
|
78 | 78 | pytest_simcore_ops_services_selection = [ |
| 79 | + "adminer", |
79 | 80 | "redis-commander", |
80 | 81 | ] |
81 | 82 |
|
@@ -410,14 +411,15 @@ async def mocked_dynamic_services_interface( |
410 | 411 | ) |
411 | 412 | async def test_progress_computational_workflow( |
412 | 413 | mocked_dynamic_services_interface, |
| 414 | + director_v2_service_mock: AioResponsesMock, |
413 | 415 | client: TestClient, |
414 | 416 | rabbitmq_publisher: RabbitMQClient, |
415 | 417 | user_project: ProjectDict, |
416 | 418 | create_socketio_connection: Callable[ |
417 | 419 | [str | None, TestClient | None], Awaitable[tuple[socketio.AsyncClient, str]] |
418 | 420 | ], |
419 | 421 | mocker: MockerFixture, |
420 | | - aiopg_engine: aiopg.sa.Engine, |
| 422 | + sqlalchemy_async_engine: AsyncEngine, |
421 | 423 | subscribe_to_logs: bool, |
422 | 424 | # user |
423 | 425 | sender_same_user_id: bool, |
@@ -468,15 +470,14 @@ async def test_progress_computational_workflow( |
468 | 470 | await _assert_handler_not_called(mock_progress_handler) |
469 | 471 |
|
470 | 472 | # check the database. doing it after the waiting calls above is safe |
471 | | - async with aiopg_engine.acquire() as conn: |
| 473 | + async with sqlalchemy_async_engine.connect() as conn: |
472 | 474 | assert projects is not None |
473 | 475 | result = await conn.execute( |
474 | 476 | sa.select(projects.c.workbench).where( |
475 | 477 | projects.c.uuid == str(user_project_id) |
476 | 478 | ) |
477 | 479 | ) |
478 | | - row = await result.fetchone() |
479 | | - assert row |
| 480 | + row = result.one() |
480 | 481 | project_workbench = dict(row[projects.c.workbench]) |
481 | 482 | # NOTE: the progress might still be present but is not used anymore |
482 | 483 | assert ( |
|
0 commit comments