From db3cee07a9ee010a6bfa4c9592362bef01e5b17b Mon Sep 17 00:00:00 2001 From: Daniel Getu Date: Fri, 21 May 2021 20:16:05 -0700 Subject: [PATCH] Fix broken unrelated tests --- .../tests/test_jaeger_exporter_protobuf.py | 9 +++++---- .../tests/test_jaeger_exporter_thrift.py | 9 +++++---- .../tests/encoder/common_tests.py | 10 +++++----- .../tests/encoder/test_v1_json.py | 2 +- .../tests/encoder/test_v2_json.py | 2 +- .../tests/test_zipkin_exporter.py | 4 +++- .../tests/encoder/common_tests.py | 10 +++++----- .../tests/test_zipkin_exporter.py | 2 +- 8 files changed, 26 insertions(+), 22 deletions(-) diff --git a/exporter/opentelemetry-exporter-jaeger-proto-grpc/tests/test_jaeger_exporter_protobuf.py b/exporter/opentelemetry-exporter-jaeger-proto-grpc/tests/test_jaeger_exporter_protobuf.py index 383e33d0f16..84192f68012 100644 --- a/exporter/opentelemetry-exporter-jaeger-proto-grpc/tests/test_jaeger_exporter_protobuf.py +++ b/exporter/opentelemetry-exporter-jaeger-proto-grpc/tests/test_jaeger_exporter_protobuf.py @@ -159,20 +159,20 @@ def test_translate_to_jaeger(self): links=(link,), kind=trace_api.SpanKind.CLIENT, resource=Resource( - attributes={"key_resource": "some_resource"} + attributes={"key_resource": "some_resource"}, schema_url="" ), ), trace._Span( name=span_names[1], context=parent_span_context, parent=None, - resource=Resource({}), + resource=Resource({}, ""), ), trace._Span( name=span_names[2], context=other_context, parent=None, - resource=Resource({}), + resource=Resource({}, ""), instrumentation_info=InstrumentationInfo( name="name", version="version" ), @@ -399,7 +399,8 @@ def test_max_tag_value_length(self): resource=Resource( attributes={ "key_resource": "some_resource some_resource some_more_resource" - } + }, + schema_url="", ), context=trace_api.SpanContext( trace_id=0x000000000000000000000000DEADBEEF, diff --git a/exporter/opentelemetry-exporter-jaeger-thrift/tests/test_jaeger_exporter_thrift.py b/exporter/opentelemetry-exporter-jaeger-thrift/tests/test_jaeger_exporter_thrift.py index 9c1773d4fad..8a0253f48ef 100644 --- a/exporter/opentelemetry-exporter-jaeger-thrift/tests/test_jaeger_exporter_thrift.py +++ b/exporter/opentelemetry-exporter-jaeger-thrift/tests/test_jaeger_exporter_thrift.py @@ -273,20 +273,20 @@ def test_translate_to_jaeger(self): links=(link,), kind=trace_api.SpanKind.CLIENT, resource=Resource( - attributes={"key_resource": "some_resource"} + attributes={"key_resource": "some_resource"}, schema_url="" ), ), trace._Span( name=span_names[1], context=parent_span_context, parent=None, - resource=Resource({}), + resource=Resource({}, ""), ), trace._Span( name=span_names[2], context=other_context, parent=None, - resource=Resource({}), + resource=Resource({}, ""), instrumentation_info=InstrumentationInfo( name="name", version="version" ), @@ -536,7 +536,8 @@ def test_max_tag_value_length(self): resource=Resource( attributes={ "key_resource": "some_resource some_resource some_more_resource" - } + }, + schema_url="", ), context=trace_api.SpanContext( trace_id=0x000000000000000000000000DEADBEEF, diff --git a/exporter/opentelemetry-exporter-zipkin-json/tests/encoder/common_tests.py b/exporter/opentelemetry-exporter-zipkin-json/tests/encoder/common_tests.py index a04148b6ea4..ea7de796287 100644 --- a/exporter/opentelemetry-exporter-zipkin-json/tests/encoder/common_tests.py +++ b/exporter/opentelemetry-exporter-zipkin-json/tests/encoder/common_tests.py @@ -180,7 +180,7 @@ def get_data_for_max_tag_length_test( is_remote=False, trace_flags=TraceFlags(TraceFlags.SAMPLED), ), - resource=trace.Resource({}), + resource=trace.Resource({}, ""), ) span.start(start_time=start_time) span.set_attribute("string1", "v" * 500) @@ -379,7 +379,7 @@ def get_exhaustive_otel_span_list() -> List[trace._Span]: context=other_context, attributes={"key_bool": True} ), ), - resource=trace.Resource({}), + resource=trace.Resource({}, ""), ) span1.start(start_time=start_times[0]) span1.set_attribute("key_bool", False) @@ -393,7 +393,7 @@ def get_exhaustive_otel_span_list() -> List[trace._Span]: context=parent_span_context, parent=None, resource=trace.Resource( - attributes={"key_resource": "some_resource"} + attributes={"key_resource": "some_resource"}, schema_url="" ), ) span2.start(start_time=start_times[1]) @@ -405,7 +405,7 @@ def get_exhaustive_otel_span_list() -> List[trace._Span]: context=other_context, parent=None, resource=trace.Resource( - attributes={"key_resource": "some_resource"} + attributes={"key_resource": "some_resource"}, schema_url="" ), ) span3.start(start_time=start_times[2]) @@ -416,7 +416,7 @@ def get_exhaustive_otel_span_list() -> List[trace._Span]: name="test-span-3", context=other_context, parent=None, - resource=trace.Resource({}), + resource=trace.Resource({}, ""), instrumentation_info=InstrumentationInfo( name="name", version="version" ), diff --git a/exporter/opentelemetry-exporter-zipkin-json/tests/encoder/test_v1_json.py b/exporter/opentelemetry-exporter-zipkin-json/tests/encoder/test_v1_json.py index c1956500bcf..e6e41fa024e 100644 --- a/exporter/opentelemetry-exporter-zipkin-json/tests/encoder/test_v1_json.py +++ b/exporter/opentelemetry-exporter-zipkin-json/tests/encoder/test_v1_json.py @@ -187,7 +187,7 @@ def test_encode_id_zero_padding(self): trace_flags=TraceFlags(TraceFlags.SAMPLED), ), parent=trace_api.SpanContext(trace_id, parent_id, is_remote=False), - resource=trace.Resource({}), + resource=trace.Resource({}, ""), ) otel_span.start(start_time=start_time) otel_span.end(end_time=end_time) diff --git a/exporter/opentelemetry-exporter-zipkin-json/tests/encoder/test_v2_json.py b/exporter/opentelemetry-exporter-zipkin-json/tests/encoder/test_v2_json.py index eb0ad6000aa..e9717cda861 100644 --- a/exporter/opentelemetry-exporter-zipkin-json/tests/encoder/test_v2_json.py +++ b/exporter/opentelemetry-exporter-zipkin-json/tests/encoder/test_v2_json.py @@ -147,7 +147,7 @@ def test_encode_id_zero_padding(self): trace_flags=TraceFlags(TraceFlags.SAMPLED), ), parent=trace_api.SpanContext(trace_id, parent_id, is_remote=False), - resource=trace.Resource({}), + resource=trace.Resource({}, ""), ) otel_span.start(start_time=start_time) otel_span.end(end_time=end_time) diff --git a/exporter/opentelemetry-exporter-zipkin-json/tests/test_zipkin_exporter.py b/exporter/opentelemetry-exporter-zipkin-json/tests/test_zipkin_exporter.py index 5c2aa0cbe69..9641597c0e4 100644 --- a/exporter/opentelemetry-exporter-zipkin-json/tests/test_zipkin_exporter.py +++ b/exporter/opentelemetry-exporter-zipkin-json/tests/test_zipkin_exporter.py @@ -44,7 +44,9 @@ class TestZipkinExporter(unittest.TestCase): def setUpClass(cls): trace.set_tracer_provider( TracerProvider( - resource=Resource({SERVICE_NAME: TEST_SERVICE_NAME}) + resource=Resource( + {SERVICE_NAME: TEST_SERVICE_NAME}, schema_url="" + ) ) ) diff --git a/exporter/opentelemetry-exporter-zipkin-proto-http/tests/encoder/common_tests.py b/exporter/opentelemetry-exporter-zipkin-proto-http/tests/encoder/common_tests.py index a04148b6ea4..ea7de796287 100644 --- a/exporter/opentelemetry-exporter-zipkin-proto-http/tests/encoder/common_tests.py +++ b/exporter/opentelemetry-exporter-zipkin-proto-http/tests/encoder/common_tests.py @@ -180,7 +180,7 @@ def get_data_for_max_tag_length_test( is_remote=False, trace_flags=TraceFlags(TraceFlags.SAMPLED), ), - resource=trace.Resource({}), + resource=trace.Resource({}, ""), ) span.start(start_time=start_time) span.set_attribute("string1", "v" * 500) @@ -379,7 +379,7 @@ def get_exhaustive_otel_span_list() -> List[trace._Span]: context=other_context, attributes={"key_bool": True} ), ), - resource=trace.Resource({}), + resource=trace.Resource({}, ""), ) span1.start(start_time=start_times[0]) span1.set_attribute("key_bool", False) @@ -393,7 +393,7 @@ def get_exhaustive_otel_span_list() -> List[trace._Span]: context=parent_span_context, parent=None, resource=trace.Resource( - attributes={"key_resource": "some_resource"} + attributes={"key_resource": "some_resource"}, schema_url="" ), ) span2.start(start_time=start_times[1]) @@ -405,7 +405,7 @@ def get_exhaustive_otel_span_list() -> List[trace._Span]: context=other_context, parent=None, resource=trace.Resource( - attributes={"key_resource": "some_resource"} + attributes={"key_resource": "some_resource"}, schema_url="" ), ) span3.start(start_time=start_times[2]) @@ -416,7 +416,7 @@ def get_exhaustive_otel_span_list() -> List[trace._Span]: name="test-span-3", context=other_context, parent=None, - resource=trace.Resource({}), + resource=trace.Resource({}, ""), instrumentation_info=InstrumentationInfo( name="name", version="version" ), diff --git a/exporter/opentelemetry-exporter-zipkin-proto-http/tests/test_zipkin_exporter.py b/exporter/opentelemetry-exporter-zipkin-proto-http/tests/test_zipkin_exporter.py index 8b8b01438e2..24c57b2d414 100644 --- a/exporter/opentelemetry-exporter-zipkin-proto-http/tests/test_zipkin_exporter.py +++ b/exporter/opentelemetry-exporter-zipkin-proto-http/tests/test_zipkin_exporter.py @@ -46,7 +46,7 @@ class TestZipkinExporter(unittest.TestCase): def setUpClass(cls): trace.set_tracer_provider( TracerProvider( - resource=Resource({SERVICE_NAME: TEST_SERVICE_NAME}) + resource=Resource({SERVICE_NAME: TEST_SERVICE_NAME}, "") ) )