From b0b61bc1f1948a3ec79e8c684908a2b8bd639f7f Mon Sep 17 00:00:00 2001 From: Eugene Grebenschikov Date: Sun, 10 Nov 2024 16:54:49 -0800 Subject: [PATCH] Rename some tests. --- tests/test_otel.py | 78 ++++++++++++++++++++++------------------------ 1 file changed, 38 insertions(+), 40 deletions(-) diff --git a/tests/test_otel.py b/tests/test_otel.py index 47fa780b..1f44915b 100644 --- a/tests/test_otel.py +++ b/tests/test_otel.py @@ -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( @@ -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", @@ -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(