From 2fff09989bfdf1922c1e65b0169a4c37c5b1ec95 Mon Sep 17 00:00:00 2001 From: Jarek Potiuk Date: Tue, 27 Oct 2026 23:09:32 +0100 Subject: [PATCH] Ignore the runner's OTEL_* variables in the observability shared tests Shared distribution tests run on the CI runner itself rather than in Breeze, and RunsOn runners export OTEL_* variables for their own OpenTelemetry collector. Those take precedence over the Airflow configuration, so the tests expecting the endpoint from the configuration failed on such runners. Generated-by: Claude Opus 5 --- shared/observability/tests/conftest.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/shared/observability/tests/conftest.py b/shared/observability/tests/conftest.py index 93aecf261843a..3815664d04ae0 100644 --- a/shared/observability/tests/conftest.py +++ b/shared/observability/tests/conftest.py @@ -18,4 +18,15 @@ import os +import pytest + os.environ["_AIRFLOW__AS_LIBRARY"] = "true" + + +@pytest.fixture(autouse=True) +def clear_otel_env_vars(monkeypatch): + # These tests run on the CI runner itself, and a runner may export OTEL_* variables for its own + # OpenTelemetry collector (RunsOn does), which take precedence over the Airflow configuration. + for name in list(os.environ): + if name.startswith("OTEL_"): + monkeypatch.delenv(name)