From bcf5417f80d7cc1881f84da4da26c6a2bceea9c4 Mon Sep 17 00:00:00 2001 From: matusdrobuliak66 Date: Mon, 9 Dec 2024 16:45:33 +0100 Subject: [PATCH 1/2] fix --- services/web/server/tests/unit/isolated/test_tracing.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/web/server/tests/unit/isolated/test_tracing.py b/services/web/server/tests/unit/isolated/test_tracing.py index ddec0d10422..b906d6756a0 100644 --- a/services/web/server/tests/unit/isolated/test_tracing.py +++ b/services/web/server/tests/unit/isolated/test_tracing.py @@ -18,13 +18,15 @@ def mock_webserver_service_environment( monkeypatch: pytest.MonkeyPatch, mock_webserver_service_environment: EnvVarsDict ) -> EnvVarsDict: - return mock_webserver_service_environment | setenvs_from_dict( + envs = mock_webserver_service_environment | setenvs_from_dict( monkeypatch, { "TRACING_OPENTELEMETRY_COLLECTOR_ENDPOINT": "http://opentelemetry-collector", "TRACING_OPENTELEMETRY_COLLECTOR_PORT": "4318", }, ) + envs.pop("WEBSERVER_TRACING") + return envs def test_middleware_restrictions_opentelemetry_is_second_middleware( From 215b3a431b19f3794e37b5044c73fd638c5ffa49 Mon Sep 17 00:00:00 2001 From: matusdrobuliak66 Date: Mon, 9 Dec 2024 18:49:55 +0100 Subject: [PATCH 2/2] review @pcrespov --- services/web/server/tests/unit/isolated/test_tracing.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/services/web/server/tests/unit/isolated/test_tracing.py b/services/web/server/tests/unit/isolated/test_tracing.py index b906d6756a0..c236e446ab9 100644 --- a/services/web/server/tests/unit/isolated/test_tracing.py +++ b/services/web/server/tests/unit/isolated/test_tracing.py @@ -17,7 +17,7 @@ def mock_webserver_service_environment( monkeypatch: pytest.MonkeyPatch, mock_webserver_service_environment: EnvVarsDict ) -> EnvVarsDict: - + monkeypatch.delenv("WEBSERVER_TRACING") envs = mock_webserver_service_environment | setenvs_from_dict( monkeypatch, { @@ -25,7 +25,6 @@ def mock_webserver_service_environment( "TRACING_OPENTELEMETRY_COLLECTOR_PORT": "4318", }, ) - envs.pop("WEBSERVER_TRACING") return envs