3333from simcore_service_webserver .users .plugin import setup_users
3434
3535
36+ @pytest .fixture (scope = "session" )
37+ def service_name () -> str :
38+ # Overrides service_name fixture needed in docker_compose_service_environment_dict fixture
39+ return "wb-garbage-collector"
40+
41+
3642@pytest .fixture (scope = "session" )
3743def fast_service_deletion_delay () -> int :
3844 """
@@ -46,20 +52,20 @@ def fast_service_deletion_delay() -> int:
4652def app_environment (
4753 fast_service_deletion_delay : int ,
4854 monkeypatch : pytest .MonkeyPatch ,
49- app_environment : EnvVarsDict ,
55+ docker_compose_service_environment_dict : EnvVarsDict ,
56+ env_devel_dict : EnvVarsDict ,
5057) -> EnvVarsDict :
51- # NOTE: undos some app_environment settings
52- monkeypatch .delenv ("WEBSERVER_GARBAGE_COLLECTOR" , raising = False )
53- app_environment .pop ("WEBSERVER_GARBAGE_COLLECTOR" , None )
5458
55- return app_environment | setenvs_from_dict (
59+ return setenvs_from_dict (
5660 monkeypatch ,
5761 {
62+ ** docker_compose_service_environment_dict ,
5863 "WEBSERVER_COMPUTATION" : "1" ,
5964 "WEBSERVER_NOTIFICATIONS" : "1" ,
6065 # sets TTL of a resource after logout
6166 "RESOURCE_MANAGER_RESOURCE_TTL_S" : f"{ fast_service_deletion_delay } " ,
62- "GARBAGE_COLLECTOR_INTERVAL_S" : "30" ,
67+ # "WEBSERVER_PROJECTS must be enabled for close_project fixture"
68+ "WEBSERVER_PROJECTS" : env_devel_dict ["WEBSERVER_PROJECTS" ],
6369 },
6470 )
6571
@@ -75,11 +81,8 @@ async def client(
7581) -> TestClient :
7682 app = create_safe_application ()
7783
78- assert "WEBSERVER_GARBAGE_COLLECTOR" not in app_environment
79-
8084 settings = setup_settings (app )
8185 assert settings .WEBSERVER_GARBAGE_COLLECTOR is not None
82- assert settings .WEBSERVER_PROJECTS is not None
8386
8487 setup_db (app )
8588 setup_session (app )
@@ -88,7 +91,12 @@ async def client(
8891 setup_login (app )
8992 setup_users (app )
9093 setup_socketio (app )
94+
95+ assert (
96+ settings .WEBSERVER_PROJECTS is not None
97+ ), "WEBSERVER_PROJECTS must be enabled for close_project fixture"
9198 assert setup_projects (app )
99+
92100 setup_director_v2 (app )
93101 assert setup_resource_manager (app )
94102 setup_rabbitmq (app )
0 commit comments