Skip to content
This repository was archived by the owner on Oct 13, 2021. It is now read-only.

Commit c6dd1ed

Browse files
remove opentracing tests
1 parent b5bb2e9 commit c6dd1ed

File tree

34 files changed

+3
-1281
lines changed

34 files changed

+3
-1281
lines changed

.circleci/config.yml

-15
Original file line numberDiff line numberDiff line change
@@ -99,17 +99,6 @@ jobs:
9999
- *persist_to_workspace_step
100100
- *save_cache_step
101101

102-
opentracer:
103-
docker:
104-
- *test_runner
105-
resource_class: *resource_class
106-
steps:
107-
- checkout
108-
- *restore_cache_step
109-
- run: scripts/run-tox-scenario '^py..-opentracer'
110-
- *persist_to_workspace_step
111-
- *save_cache_step
112-
113102
integration:
114103
docker:
115104
- <<: *test_runner
@@ -917,9 +906,6 @@ workflows:
917906
- mysqlpython:
918907
requires:
919908
- flake8
920-
- opentracer:
921-
requires:
922-
- flake8
923909
- psycopg:
924910
requires:
925911
- flake8
@@ -1016,7 +1002,6 @@ workflows:
10161002
- mysqlconnector
10171003
- mysqldb
10181004
- mysqlpython
1019-
- opentracer
10201005
- psycopg
10211006
- pylibmc
10221007
- pylons

setup.py

-5
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,6 @@ def run_tests(self):
9090
)
9191

9292

93-
# The following from here to the end of the file is borrowed from wrapt's and msgpack's `setup.py`:
94-
# https://github.com/GrahamDumpleton/wrapt/blob/4ee35415a4b0d570ee6a9b3a14a6931441aeab4b/setup.py
95-
# https://github.com/msgpack/msgpack-python/blob/381c2eff5f8ee0b8669fd6daf1fd1ecaffe7c931/setup.py
96-
# These helpers are useful for attempting build a C-extension and then retrying without it if it fails
97-
9893
libraries = []
9994
if sys.platform == 'win32':
10095
libraries.append('ws2_32')

tests/contrib/aiobotocore/test.py

-79
Original file line numberDiff line numberDiff line change
@@ -236,82 +236,3 @@ def test_double_patch(self):
236236
traces = self.tracer.writer.pop_traces()
237237
self.assertEqual(len(traces), 1)
238238
self.assertEqual(len(traces[0]), 1)
239-
240-
@mark_asyncio
241-
def test_opentraced_client(self):
242-
from tests.opentracer.utils import init_tracer
243-
244-
ot_tracer = init_tracer('my_svc', self.tracer)
245-
246-
with ot_tracer.start_active_span('ot_outer_span'):
247-
with aiobotocore_client('ec2', self.tracer) as ec2:
248-
yield from ec2.describe_instances()
249-
250-
traces = self.tracer.writer.pop_traces()
251-
print(traces)
252-
self.assertEqual(len(traces), 1)
253-
self.assertEqual(len(traces[0]), 2)
254-
ot_span = traces[0][0]
255-
dd_span = traces[0][1]
256-
257-
self.assertEqual(ot_span.resource, 'ot_outer_span')
258-
self.assertEqual(ot_span.service, 'my_svc')
259-
260-
# confirm the parenting
261-
self.assertEqual(ot_span.parent_id, None)
262-
self.assertEqual(dd_span.parent_id, ot_span.span_id)
263-
264-
self.assertEqual(dd_span.get_tag('aws.agent'), 'aiobotocore')
265-
self.assertEqual(dd_span.get_tag('aws.region'), 'us-west-2')
266-
self.assertEqual(dd_span.get_tag('aws.operation'), 'DescribeInstances')
267-
self.assertEqual(dd_span.get_tag('http.status_code'), '200')
268-
self.assertEqual(dd_span.get_tag('retry_attempts'), '0')
269-
self.assertEqual(dd_span.service, 'aws.ec2')
270-
self.assertEqual(dd_span.resource, 'ec2.describeinstances')
271-
self.assertEqual(dd_span.name, 'ec2.command')
272-
273-
@mark_asyncio
274-
def test_opentraced_s3_client(self):
275-
from tests.opentracer.utils import init_tracer
276-
277-
ot_tracer = init_tracer('my_svc', self.tracer)
278-
279-
with ot_tracer.start_active_span('ot_outer_span'):
280-
with aiobotocore_client('s3', self.tracer) as s3:
281-
yield from s3.list_buckets()
282-
with ot_tracer.start_active_span('ot_inner_span1'):
283-
yield from s3.list_buckets()
284-
with ot_tracer.start_active_span('ot_inner_span2'):
285-
pass
286-
287-
traces = self.tracer.writer.pop_traces()
288-
self.assertEqual(len(traces), 1)
289-
self.assertEqual(len(traces[0]), 5)
290-
ot_outer_span = traces[0][0]
291-
dd_span = traces[0][1]
292-
ot_inner_span = traces[0][2]
293-
dd_span2 = traces[0][3]
294-
ot_inner_span2 = traces[0][4]
295-
296-
self.assertEqual(ot_outer_span.resource, 'ot_outer_span')
297-
self.assertEqual(ot_inner_span.resource, 'ot_inner_span1')
298-
self.assertEqual(ot_inner_span2.resource, 'ot_inner_span2')
299-
300-
# confirm the parenting
301-
self.assertEqual(ot_outer_span.parent_id, None)
302-
self.assertEqual(dd_span.parent_id, ot_outer_span.span_id)
303-
self.assertEqual(ot_inner_span.parent_id, ot_outer_span.span_id)
304-
self.assertEqual(dd_span2.parent_id, ot_inner_span.span_id)
305-
self.assertEqual(ot_inner_span2.parent_id, ot_outer_span.span_id)
306-
307-
self.assertEqual(dd_span.get_tag('aws.operation'), 'ListBuckets')
308-
self.assertEqual(dd_span.get_tag('http.status_code'), '200')
309-
self.assertEqual(dd_span.service, 'aws.s3')
310-
self.assertEqual(dd_span.resource, 's3.listbuckets')
311-
self.assertEqual(dd_span.name, 's3.command')
312-
313-
self.assertEqual(dd_span2.get_tag('aws.operation'), 'ListBuckets')
314-
self.assertEqual(dd_span2.get_tag('http.status_code'), '200')
315-
self.assertEqual(dd_span2.service, 'aws.s3')
316-
self.assertEqual(dd_span2.resource, 's3.listbuckets')
317-
self.assertEqual(dd_span2.name, 's3.command')

tests/contrib/aiohttp/test_middleware.py

-17
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
from ddtrace.sampler import RateSampler
88
from ddtrace.constants import SAMPLING_PRIORITY_KEY, ANALYTICS_SAMPLE_RATE_KEY
99

10-
from opentracing.scope_managers.asyncio import AsyncioScopeManager
11-
from tests.opentracer.utils import init_tracer
1210
from .utils import TraceTestCase
1311
from .app.web import setup_app, noop_middleware
1412

@@ -436,21 +434,6 @@ def test_parenting_200_dd(self):
436434
traces = self.tracer.writer.pop_traces()
437435
self._assert_200_parenting(traces)
438436

439-
@unittest_run_loop
440-
@asyncio.coroutine
441-
def test_parenting_200_ot(self):
442-
"""OpenTracing version of test_handler."""
443-
ot_tracer = init_tracer('aiohttp_svc', self.tracer, scope_manager=AsyncioScopeManager())
444-
445-
with ot_tracer.start_active_span('aiohttp_op'):
446-
request = yield from self.client.request('GET', '/')
447-
assert 200 == request.status
448-
text = yield from request.text()
449-
450-
assert "What's tracing?" == text
451-
traces = self.tracer.writer.pop_traces()
452-
self._assert_200_parenting(traces)
453-
454437
@unittest_run_loop
455438
@asyncio.coroutine
456439
def test_analytics_integration_enabled(self):

tests/contrib/aiopg/test.py

-23
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
from ddtrace import Pin
1313

1414
# testing
15-
from tests.opentracer.utils import init_tracer
1615
from tests.contrib.config import POSTGRES_CONFIG
1716
from tests.test_tracer import get_dummy_tracer
1817
from tests.contrib.asyncio.utils import AsyncioTestCase, mark_asyncio
@@ -77,28 +76,6 @@ def assert_conn_is_traced(self, tracer, db, service):
7776
assert start <= span.start <= end
7877
assert span.duration <= end - start
7978

80-
# Ensure OpenTracing compatibility
81-
ot_tracer = init_tracer('aiopg_svc', tracer)
82-
with ot_tracer.start_active_span('aiopg_op'):
83-
cursor = yield from db.cursor()
84-
yield from cursor.execute(q)
85-
rows = yield from cursor.fetchall()
86-
assert rows == [('foobarblah',)]
87-
spans = writer.pop()
88-
assert len(spans) == 2
89-
ot_span, dd_span = spans
90-
# confirm the parenting
91-
assert ot_span.parent_id is None
92-
assert dd_span.parent_id == ot_span.span_id
93-
assert ot_span.name == 'aiopg_op'
94-
assert ot_span.service == 'aiopg_svc'
95-
assert dd_span.name == 'postgres.query'
96-
assert dd_span.resource == q
97-
assert dd_span.service == service
98-
assert dd_span.meta['sql.query'] == q
99-
assert dd_span.error == 0
100-
assert dd_span.span_type == 'sql'
101-
10279
# run a query with an error and ensure all is well
10380
q = 'select * from some_non_existant_table'
10481
cur = yield from db.cursor()

tests/contrib/asyncio/test_tracer.py

-55
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
from ddtrace.contrib.asyncio.patch import patch, unpatch
1010
from ddtrace.contrib.asyncio.helpers import set_call_context
1111

12-
from tests.opentracer.utils import init_tracer
1312
from .utils import AsyncioTestCase, mark_asyncio
1413

1514

@@ -336,57 +335,3 @@ def test_event_loop_double_patch(self):
336335
# the event loop
337336
patch()
338337
self.test_tasks_chaining()
339-
340-
@mark_asyncio
341-
def test_trace_multiple_coroutines_ot_outer(self):
342-
"""OpenTracing version of test_trace_multiple_coroutines."""
343-
# if multiple coroutines have nested tracing, they must belong
344-
# to the same trace
345-
@asyncio.coroutine
346-
def coro():
347-
# another traced coroutine
348-
with self.tracer.trace('coroutine_2'):
349-
return 42
350-
351-
ot_tracer = init_tracer('asyncio_svc', self.tracer)
352-
with ot_tracer.start_active_span('coroutine_1'):
353-
value = yield from coro()
354-
355-
# the coroutine has been called correctly
356-
assert 42 == value
357-
# a single trace has been properly reported
358-
traces = self.tracer.writer.pop_traces()
359-
assert 1 == len(traces)
360-
assert 2 == len(traces[0])
361-
assert 'coroutine_1' == traces[0][0].name
362-
assert 'coroutine_2' == traces[0][1].name
363-
# the parenting is correct
364-
assert traces[0][0] == traces[0][1]._parent
365-
assert traces[0][0].trace_id == traces[0][1].trace_id
366-
367-
@mark_asyncio
368-
def test_trace_multiple_coroutines_ot_inner(self):
369-
"""OpenTracing version of test_trace_multiple_coroutines."""
370-
# if multiple coroutines have nested tracing, they must belong
371-
# to the same trace
372-
ot_tracer = init_tracer('asyncio_svc', self.tracer)
373-
@asyncio.coroutine
374-
def coro():
375-
# another traced coroutine
376-
with ot_tracer.start_active_span('coroutine_2'):
377-
return 42
378-
379-
with self.tracer.trace('coroutine_1'):
380-
value = yield from coro()
381-
382-
# the coroutine has been called correctly
383-
assert 42 == value
384-
# a single trace has been properly reported
385-
traces = self.tracer.writer.pop_traces()
386-
assert 1 == len(traces)
387-
assert 2 == len(traces[0])
388-
assert 'coroutine_1' == traces[0][0].name
389-
assert 'coroutine_2' == traces[0][1].name
390-
# the parenting is correct
391-
assert traces[0][0] == traces[0][1]._parent
392-
assert traces[0][0].trace_id == traces[0][1].trace_id

tests/contrib/boto/test.py

-47
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
# testing
1818
from unittest import skipUnless
19-
from tests.opentracer.utils import init_tracer
2019
from ...base import BaseTracerTestCase
2120

2221

@@ -261,49 +260,3 @@ def test_elasticache_client(self):
261260
self.assertEqual(span.get_tag('aws.region'), 'us-west-2')
262261
self.assertEqual(span.service, 'test-boto-tracing.elasticache')
263262
self.assertEqual(span.resource, 'elasticache')
264-
265-
@mock_ec2
266-
def test_ec2_client_ot(self):
267-
"""OpenTracing compatibility check of the test_ec2_client test."""
268-
269-
ec2 = boto.ec2.connect_to_region('us-west-2')
270-
271-
ot_tracer = init_tracer('my_svc', self.tracer)
272-
writer = self.tracer.writer
273-
Pin(service=self.TEST_SERVICE, tracer=self.tracer).onto(ec2)
274-
275-
with ot_tracer.start_active_span('ot_span'):
276-
ec2.get_all_instances()
277-
spans = writer.pop()
278-
assert spans
279-
self.assertEqual(len(spans), 2)
280-
ot_span, dd_span = spans
281-
282-
# confirm the parenting
283-
self.assertIsNone(ot_span.parent_id)
284-
self.assertEqual(dd_span.parent_id, ot_span.span_id)
285-
286-
self.assertEqual(ot_span.resource, 'ot_span')
287-
self.assertEqual(dd_span.get_tag('aws.operation'), 'DescribeInstances')
288-
self.assertEqual(dd_span.get_tag(http.STATUS_CODE), '200')
289-
self.assertEqual(dd_span.get_tag(http.METHOD), 'POST')
290-
self.assertEqual(dd_span.get_tag('aws.region'), 'us-west-2')
291-
292-
with ot_tracer.start_active_span('ot_span'):
293-
ec2.run_instances(21)
294-
spans = writer.pop()
295-
assert spans
296-
self.assertEqual(len(spans), 2)
297-
ot_span, dd_span = spans
298-
299-
# confirm the parenting
300-
self.assertIsNone(ot_span.parent_id)
301-
self.assertEqual(dd_span.parent_id, ot_span.span_id)
302-
303-
self.assertEqual(dd_span.get_tag('aws.operation'), 'RunInstances')
304-
self.assertEqual(dd_span.get_tag(http.STATUS_CODE), '200')
305-
self.assertEqual(dd_span.get_tag(http.METHOD), 'POST')
306-
self.assertEqual(dd_span.get_tag('aws.region'), 'us-west-2')
307-
self.assertEqual(dd_span.service, 'test-boto-tracing.ec2')
308-
self.assertEqual(dd_span.resource, 'ec2.runinstances')
309-
self.assertEqual(dd_span.name, 'ec2.command')

tests/contrib/botocore/test.py

-33
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from ddtrace.compat import stringify
1111

1212
# testing
13-
from tests.opentracer.utils import init_tracer
1413
from ...base import BaseTracerTestCase
1514

1615

@@ -215,35 +214,3 @@ def test_kms_client(self):
215214

216215
# checking for protection on sts against security leak
217216
self.assertIsNone(span.get_tag('params'))
218-
219-
@mock_ec2
220-
def test_traced_client_ot(self):
221-
"""OpenTracing version of test_traced_client."""
222-
ot_tracer = init_tracer('ec2_svc', self.tracer)
223-
224-
with ot_tracer.start_active_span('ec2_op'):
225-
ec2 = self.session.create_client('ec2', region_name='us-west-2')
226-
Pin(service=self.TEST_SERVICE, tracer=self.tracer).onto(ec2)
227-
ec2.describe_instances()
228-
229-
spans = self.get_spans()
230-
assert spans
231-
self.assertEqual(len(spans), 2)
232-
233-
ot_span, dd_span = spans
234-
235-
# confirm the parenting
236-
self.assertIsNone(ot_span.parent_id)
237-
self.assertEqual(dd_span.parent_id, ot_span.span_id)
238-
239-
self.assertEqual(ot_span.name, 'ec2_op')
240-
self.assertEqual(ot_span.service, 'ec2_svc')
241-
242-
self.assertEqual(dd_span.get_tag('aws.agent'), 'botocore')
243-
self.assertEqual(dd_span.get_tag('aws.region'), 'us-west-2')
244-
self.assertEqual(dd_span.get_tag('aws.operation'), 'DescribeInstances')
245-
self.assertEqual(dd_span.get_tag(http.STATUS_CODE), '200')
246-
self.assertEqual(dd_span.get_tag('retry_attempts'), '0')
247-
self.assertEqual(dd_span.service, 'test-botocore-tracing.ec2')
248-
self.assertEqual(dd_span.resource, 'ec2.describeinstances')
249-
self.assertEqual(dd_span.name, 'ec2.command')

0 commit comments

Comments
 (0)