Skip to content

Commit

Permalink
Rename some tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
jimf5 committed Nov 11, 2024
1 parent 0cd0426 commit b0b61bc
Showing 1 changed file with 38 additions and 40 deletions.
78 changes: 38 additions & 40 deletions tests/test_otel.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,14 +468,14 @@ def test_no_custom_metrics(
("X-Otel-Parent-Sampled", "1", 1),
],
ids=[
"otel_trace_id-no context-span0",
"otel_span_id-no context-span0",
"no otel_parent_id-no context-span0",
"otel_parent_sampled is 0-no context-span0",
"otel_trace_id-with context-span1",
"otel_span_id-with context-span1",
"otel_parent_id-with context-span1",
"otel_parent_sampled is 1-with context-span1",
"otel_trace_id-no context",
"otel_span_id-no context",
"no otel_parent_id-no context",
"otel_parent_sampled is 0-no context",
"otel_trace_id-with context",
"otel_span_id-with context",
"otel_parent_id-with context",
"otel_parent_sampled is 1-with context",
],
)
def test_variables(
Expand All @@ -488,16 +488,14 @@ def test_variables(
assert headers.get(name) == value

@pytest.mark.xfail(True, reason="otel variables are present when no trace")
@pytest.mark.parametrize("idx", [10, 11], ids=["trace off"] * 2)
@pytest.mark.parametrize(
("value", "idx"), [(None, 10), (None, 11)], ids=["trace off"] * 2
)
@pytest.mark.parametrize(
"name",
("name", "value"),
[
"X-Otel-Trace-Id",
"X-Otel-Span-Id",
"X-Otel-Parent-Id",
"X-Otel-Parent-Sampled",
("X-Otel-Trace-Id", None),
("X-Otel-Span-Id", None),
("X-Otel-Parent-Id", None),
("X-Otel-Parent-Sampled", None),
],
ids=[
"otel_trace_id",
Expand Down Expand Up @@ -546,36 +544,36 @@ def test_no_variables(self, http_ver, headers, name, value, idx, otel_mode):
("X-Otel-Tracestate", context["Tracestate"], 9),
],
ids=[
"ignore-no parent id-no context-span2",
"ignore-no traceparent-no context-span2",
"ignore-no tracestate-no context-span2",
"ignore-no parent id-with context-span3",
"ignore-old traceparent-with context-span3",
"ignore-old tracestate-with context-span3",
"ignore-no parent id-no context",
"ignore-no traceparent-no context",
"ignore-no tracestate-no context",
"ignore-no parent id-with context",
"ignore-old traceparent-with context",
"ignore-old tracestate-with context",
]
+ [
"extract-no parent id-no context-span4",
"extract-no traceparent-no context-span4",
"extract-no tracestate-no context-span4",
"extract-old parent id-with context-span5",
"extract-old traceparent-with context-span5",
"extract-old tracestate-with context-span5",
"extract-no parent id-no context",
"extract-no traceparent-no context",
"extract-no tracestate-no context",
"extract-old parent id-with context",
"extract-old traceparent-with context",
"extract-old tracestate-with context",
]
+ [
"inject-no parent id-no context-span6",
"inject-new traceparent-no context-span6",
"inject-no tracestate-no context-span6",
"inject-no parent id-with context-span7",
"inject-new traceparent-with context-span7",
"inject-no tracestate-with context-span7",
"inject-no parent id-no context",
"inject-new traceparent-no context",
"inject-no tracestate-no context",
"inject-no parent id-with context",
"inject-new traceparent-with context",
"inject-no tracestate-with context",
]
+ [
"propagate-no parent id-no context-span8",
"propagate-new traceparent-no context-span8",
"propagate-no tracestate-no context-span8",
"propagate-old parent id-with context-span9",
"propagate-updated traceparent(new span id)-with context-span9",
"propagate-old tracestate-with context-span9",
"propagate-no parent id-no context",
"propagate-new traceparent-no context",
"propagate-no tracestate-no context",
"propagate-old parent id-with context",
"propagate-updated traceparent(new span id)-with context",
"propagate-old tracestate-with context",
],
)
def test_trace_context(
Expand Down

0 comments on commit b0b61bc

Please sign in to comment.