Skip to content

Commit d330b30

Browse files
committed
test: skip the serve flow-span probe when opentelemetry is absent
opentelemetry is an optional lfx extra, and the probe imports it in a subprocess that inherits the test interpreter. On an lfx install that did not opt in, which is what the isolated lfx CI job is, the probe errored instead of skipping. Passed locally only because the root venv has the extra.
1 parent d451bf9 commit d330b30

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/lfx/tests/unit/cli/test_serve_app_flow_span.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@
1515
import tempfile
1616
from pathlib import Path
1717

18+
import pytest
19+
20+
# opentelemetry is an optional lfx extra (``lfx[otel]``), and the probe below imports it in a
21+
# subprocess that inherits this interpreter. Without the guard this errors instead of skipping
22+
# on an lfx install that did not opt in, which is exactly what the isolated lfx CI job is.
23+
pytest.importorskip("opentelemetry")
24+
1825
FLOW_ID = "22222222-2222-2222-2222-222222222222"
1926
API_KEY = "probe-key" # pragma: allowlist secret
2027

0 commit comments

Comments
 (0)