-
Notifications
You must be signed in to change notification settings - Fork 117
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Goal: Add comprehensive tests for OTel functionality with > 90% coverage.
Tasks
- Create
tests/pytest/test_otel_utils.pywith fixtures:in_memory_exporter- Capture spans/logs for assertionswith_otel_sdk- Context manager to enable OTel for testsassert_span_exists(name, attributes)- Helper for assertions
- Create
tests/pytest/test_otel_session.pyto test:- Session start span with correct attributes
- Session end span
- Collection level controls span creation
- Session ID included in spans
- Create
tests/pytest/test_otel_reactive.pyto test:- Reactive flush creates update span
- Calc/Effect execution creates child spans
- Span nesting (update → calc/effect)
- Label generation
- Source attribute extraction
- Create
tests/pytest/test_otel_collect.pyto test:- Environment variable controls default level
- Context manager overrides
- Decorator overrides
- Nested context managers
- Create
tests/pytest/test_otel_async.pyto test:- Spans propagate through async boundaries
- Concurrent reactive executions maintain correct context
- Extended tasks maintain span context
Acceptance Criteria
- All tests pass
- Coverage > 90% for
shiny/otel/code - Tests verify span structure, attributes, and nesting
- Tests verify context propagation in async scenarios
- Tests verify collection level controls work correctly
- Tests verify error recording and sanitization
Files to Create
tests/pytest/test_otel_utils.pytests/pytest/test_otel_session.pytests/pytest/test_otel_reactive.pytests/pytest/test_otel_collect.pytests/pytest/test_otel_async.py
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request