Skip to content

Commit f9d777e

Browse files
committed
Merge fixes of PR #8431
1 parent 3fdfac0 commit f9d777e

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

services/web/server/tests/integration/01/test_exporter_requests_handlers.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import pytest
1515
import redis.asyncio as aioredis
1616
from aiohttp.test_utils import TestClient
17+
from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_dict
1718
from pytest_simcore.helpers.webserver_login import LoggedUser, UserInfoDict
1819
from pytest_simcore.helpers.webserver_projects import (
1920
create_project,
@@ -152,6 +153,7 @@ async def client(
152153
redis_client: aioredis.Redis,
153154
rabbit_service: RabbitSettings,
154155
simcore_services_ready: None,
156+
monkeypatch: pytest.MonkeyPatch,
155157
) -> Iterable[TestClient]:
156158
# test config & env vars ----------------------
157159
cfg = deepcopy(app_config)
@@ -163,11 +165,24 @@ async def client(
163165

164166
monkeypatch_setenv_from_app_config(cfg)
165167

168+
monkeypatch.delenv("WEBSERVER_SCICRUNCH", raising=False)
169+
setenvs_from_dict(
170+
monkeypatch,
171+
{
172+
"SCICRUNCH_API_KEY": "REPLACE_ME_with_valid_api_key",
173+
"WEBSERVER_RPC_NAMESPACE": "webserver",
174+
},
175+
)
176+
166177
# app setup ----------------------------------
167178
app = create_safe_application(cfg)
168179

169180
# activates only security+restAPI sub-modules
170-
assert setup_settings(app)
181+
app_settings = setup_settings(app)
182+
183+
assert app_settings.WEBSERVER_SCICRUNCH is not None
184+
assert app_settings.WEBSERVER_RABBITMQ is not None
185+
assert app_settings.WEBSERVER_EXPORTER is not None
171186
assert (
172187
exporter_settings.get_plugin_settings(app) is not None
173188
), "Should capture defaults"

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,13 @@ def app_mock(mocker: MockerFixture):
4747
return app
4848

4949

50-
def test_unique_application_keys(app_mock, mock_env_devel_environment: dict[str, str]):
50+
def test_unique_application_keys(
51+
app_mock,
52+
mock_env_devel_environment: dict[str, str],
53+
monkeypatch: pytest.MonkeyPatch,
54+
):
55+
monkeypatch.setenv("WEBSERVER_RPC_NAMESPACE", "null")
56+
5157
setup_settings(app_mock)
5258
setup_rest(app_mock)
5359
setup_diagnostics(app_mock)

0 commit comments

Comments
 (0)