Skip to content

Commit 322a3ce

Browse files
committed
tsts
1 parent 12380b0 commit 322a3ce

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

services/web/server/tests/unit/isolated/conftest.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# pylint: disable=redefined-outer-name
2+
# pylint: disable=unused-argument
3+
# pylint: disable=unused-variable
4+
# pylint: disable=too-many-arguments
5+
6+
17
import json
28
import os
39
import random
@@ -176,10 +182,11 @@ def mock_env_dockerfile_build(monkeypatch: pytest.MonkeyPatch) -> EnvVarsDict:
176182
@pytest.fixture
177183
def mock_webserver_service_environment(
178184
monkeypatch: pytest.MonkeyPatch,
179-
mock_env_makefile: EnvVarsDict, # pylint: disable=redefined-outer-name
180-
mock_env_devel_environment: EnvVarsDict, # pylint: disable=redefined-outer-name
181-
mock_env_dockerfile_build: EnvVarsDict, # pylint: disable=redefined-outer-name
182-
mock_env_deployer_pipeline: EnvVarsDict, # pylint: disable=redefined-outer-name
185+
mock_env_makefile: EnvVarsDict,
186+
mock_env_devel_environment: EnvVarsDict,
187+
mock_env_dockerfile_build: EnvVarsDict,
188+
mock_env_deployer_pipeline: EnvVarsDict,
189+
service_name: str,
183190
) -> EnvVarsDict:
184191
"""
185192
Mocks environment produce in the docker compose config with a .env (.env-devel)
@@ -221,6 +228,7 @@ def mock_webserver_service_environment(
221228
"SWARM_STACK_NAME": os.environ.get("SWARM_STACK_NAME", "simcore"),
222229
"WEBSERVER_LOGLEVEL": os.environ.get("LOG_LEVEL", "WARNING"),
223230
"SESSION_COOKIE_MAX_AGE": str(7 * 24 * 60 * 60),
231+
"WEBSERVER_RPC_NAMESPACE": service_name,
224232
},
225233
)
226234

services/web/server/tests/unit/with_dbs/conftest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ def app_environment(
154154
mock_env_devel_environment: EnvVarsDict,
155155
storage_test_server_port: int,
156156
monkeypatch_setenv_from_app_config: Callable[[AppConfigDict], EnvVarsDict],
157+
service_name: str,
157158
) -> EnvVarsDict:
158159
# WARNING: this fixture is commonly overriden. Check before renaming.
159160
"""overridable fixture that defines the ENV for the webserver application
@@ -179,7 +180,7 @@ def app_environment(app_environment: EnvVarsDict, monkeypatch: pytest.MonkeyPatc
179180
# this emulates hostname: "wb-{{.Node.Hostname}}-{{.Task.Slot}}" in docker-compose that
180181
# affects PostgresSettings.POSTGRES_CLIENT_NAME
181182
"HOSTNAME": "wb-test_host.0",
182-
"WEBSERVER_RPC_NAMESPACE": "null", # FIXME: hack!
183+
"WEBSERVER_RPC_NAMESPACE": service_name,
183184
},
184185
)
185186
)

0 commit comments

Comments
 (0)