Skip to content

Commit 508d822

Browse files
committed
refactor: enhance app_environment fixture to include docker compose service environment
1 parent e93110d commit 508d822

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,17 @@ async def drop_all_preferences(
2828
def app_environment(
2929
monkeypatch: pytest.MonkeyPatch,
3030
app_environment: EnvVarsDict,
31+
docker_compose_service_environment_dict: EnvVarsDict,
3132
) -> EnvVarsDict:
3233
return app_environment | setenvs_from_dict(
3334
monkeypatch,
3435
{
36+
**docker_compose_service_environment_dict,
3537
# disable tracing for tests
3638
"TRACING_OPENTELEMETRY_COLLECTOR_ENDPOINT": "null",
3739
"TRACING_OPENTELEMETRY_COLLECTOR_PORT": "null",
3840
"WEBSERVER_TRACING": "null",
41+
"WEBSERVER_RPC_NAMESPACE": "null",
3942
},
4043
)
4144

services/web/server/tests/unit/with_dbs/03/test__openapi_specs.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,18 @@ def openapi_specs_path(api_version_prefix: str) -> Path:
2727
@pytest.fixture
2828
def app_environment(
2929
mock_env_devel_environment: EnvVarsDict,
30+
docker_compose_service_environment_dict: EnvVarsDict,
3031
monkeypatch: pytest.MonkeyPatch,
3132
faker: Faker,
3233
) -> EnvVarsDict:
3334
# Needed to enable WEBSERVER_ACTIVITY using PROMETEUS below
3435
monkeypatch.delenv("WEBSERVER_ACTIVITY", raising=False)
36+
docker_compose_service_environment_dict.pop("WEBSERVER_ACTIVITY", None)
3537

3638
return mock_env_devel_environment | setenvs_from_dict(
3739
monkeypatch,
3840
{
41+
**docker_compose_service_environment_dict,
3942
# disable bundle configs
4043
"WEBSERVER_DB_LISTENER": "0",
4144
"WEBSERVER_GARBAGE_COLLECTOR": "null",

services/web/server/tests/unit/with_dbs/03/test_session_access_policies.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
@pytest.fixture
3232
async def client(
3333
aiohttp_client: Callable,
34-
mock_webserver_service_environment: EnvVarsDict,
34+
app_environment: EnvVarsDict,
3535
) -> TestClient:
3636
routes = web.RouteTableDef()
3737

0 commit comments

Comments
 (0)