2727from pytest_mock import MockerFixture
2828from pytest_simcore .helpers .webserver_login import UserInfoDict , log_client_in
2929from pytest_simcore .helpers .webserver_projects import create_project , empty_project_data
30+ from servicelib .aiohttp import status
3031from servicelib .aiohttp .application import create_safe_application
3132from settings_library .rabbit import RabbitSettings
3233from settings_library .redis import RedisDatabase , RedisSettings
6364log = logging .getLogger (__name__ )
6465
6566pytest_simcore_core_services_selection = [
66- "migration" ,
67+ "migration" , # NOTE: rebuild!
6768 "postgres" ,
6869 "rabbit" ,
6970 "redis" ,
70- "storage" ,
71+ "storage" , # NOTE: rebuild!
7172]
7273pytest_simcore_ops_services_selection = [
7374 "minio" ,
7475 "adminer" ,
76+ "redis-commander" ,
7577]
7678
7779
@@ -98,11 +100,6 @@ async def _delete_all_redis_keys(redis_settings: RedisSettings):
98100 await client .aclose (close_connection_pool = True )
99101
100102
101- @pytest .fixture (scope = "session" )
102- def osparc_product_name () -> str :
103- return "osparc"
104-
105-
106103@pytest .fixture
107104async def director_v2_service_mock (
108105 mocker : MockerFixture ,
@@ -130,7 +127,7 @@ async def director_v2_service_mock(
130127 with aioresponses (passthrough = PASSTHROUGH_REQUESTS_PREFIXES ) as mock :
131128 mock .get (
132129 get_computation_pattern ,
133- status = 202 ,
130+ status = status . HTTP_202_ACCEPTED ,
134131 payload = {"state" : str (RunningState .NOT_STARTED .value )},
135132 repeat = True ,
136133 )
@@ -192,16 +189,19 @@ async def client(
192189def disable_garbage_collector_task (mocker : MockerFixture ) -> mock .MagicMock :
193190 """patch the setup of the garbage collector so we can call it manually"""
194191
195- async def _fake_background_task (app : web .Application ):
196- # startup
197- await asyncio .sleep (0.1 )
198- yield
199- # teardown
200- await asyncio .sleep (0.1 )
192+ def _fake_factory ():
193+ async def _cleanup_ctx_fun (app : web .Application ):
194+ # startup
195+ await asyncio .sleep (0.1 )
196+ yield
197+ # teardown
198+ await asyncio .sleep (0.1 )
199+
200+ return _cleanup_ctx_fun
201201
202202 return mocker .patch (
203203 "simcore_service_webserver.garbage_collector.plugin._tasks_core.create_background_task_for_garbage_collection" ,
204- side_effect = _fake_background_task ,
204+ side_effect = _fake_factory ,
205205 )
206206
207207
0 commit comments