Skip to content

Commit 0dc6c94

Browse files
authored
re-enable aws integrations tests (#3733)
1 parent 1faea80 commit 0dc6c94

File tree

21 files changed

+431
-235
lines changed

21 files changed

+431
-235
lines changed

tests/integrations/crossed_integrations/test_kinesis.py

Lines changed: 27 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22
import json
33

44
from utils.buddies import python_buddy
5-
from utils import interfaces, scenarios, weblog, missing_feature, features, context, irrelevant
5+
from utils import interfaces, scenarios, weblog, missing_feature, features, context
66
from utils.tools import logger
77

8-
from tests.integrations.utils import delete_kinesis_stream
9-
108

119
class _Test_Kinesis:
1210
"""Test Kinesis compatibility with inputted datadog tracer"""
@@ -75,22 +73,19 @@ def setup_produce(self):
7573
"""Send request A to weblog : this request will produce a Kinesis message
7674
send request B to library buddy, this request will consume Kinesis message
7775
"""
78-
try:
79-
message = (
80-
"[crossed_integrations/test_kinesis.py][Kinesis] Hello from Kinesis "
81-
f"[{context.library.library} weblog->{self.buddy_interface.name}] test produce at {self.unique_id}"
82-
)
83-
84-
self.production_response = weblog.get(
85-
"/kinesis/produce", params={"stream": self.WEBLOG_TO_BUDDY_STREAM, "message": message}, timeout=120
86-
)
87-
self.consume_response = self.buddy.get(
88-
"/kinesis/consume",
89-
params={"stream": self.WEBLOG_TO_BUDDY_STREAM, "message": message, "timeout": 60},
90-
timeout=61,
91-
)
92-
finally:
93-
delete_kinesis_stream(self.WEBLOG_TO_BUDDY_STREAM)
76+
message = (
77+
"[crossed_integrations/test_kinesis.py][Kinesis] Hello from Kinesis "
78+
f"[{context.library.library} weblog->{self.buddy_interface.name}] test produce at {self.unique_id}"
79+
)
80+
81+
self.production_response = weblog.get(
82+
"/kinesis/produce", params={"stream": self.WEBLOG_TO_BUDDY_STREAM, "message": message}, timeout=120
83+
)
84+
self.consume_response = self.buddy.get(
85+
"/kinesis/consume",
86+
params={"stream": self.WEBLOG_TO_BUDDY_STREAM, "message": message, "timeout": 60},
87+
timeout=61,
88+
)
9489

9590
def test_produce(self):
9691
"""Check that a message produced to Kinesis is correctly ingested by a Datadog tracer"""
@@ -137,22 +132,19 @@ def setup_consume(self):
137132
request A: GET /library_buddy/produce_kinesis_message
138133
request B: GET /weblog/consume_kinesis_message
139134
"""
140-
try:
141-
message = (
142-
"[crossed_integrations/test_kinesis.py][Kinesis] Hello from Kinesis "
143-
f"[{self.buddy_interface.name}->{context.library.library} weblog] test consume at {self.unique_id}"
144-
)
145-
146-
self.production_response = self.buddy.get(
147-
"/kinesis/produce", params={"stream": self.BUDDY_TO_WEBLOG_STREAM, "message": message}, timeout=500
148-
)
149-
self.consume_response = weblog.get(
150-
"/kinesis/consume",
151-
params={"stream": self.BUDDY_TO_WEBLOG_STREAM, "message": message, "timeout": 60},
152-
timeout=61,
153-
)
154-
finally:
155-
delete_kinesis_stream(self.BUDDY_TO_WEBLOG_STREAM)
135+
message = (
136+
"[crossed_integrations/test_kinesis.py][Kinesis] Hello from Kinesis "
137+
f"[{self.buddy_interface.name}->{context.library.library} weblog] test consume at {self.unique_id}"
138+
)
139+
140+
self.production_response = self.buddy.get(
141+
"/kinesis/produce", params={"stream": self.BUDDY_TO_WEBLOG_STREAM, "message": message}, timeout=500
142+
)
143+
self.consume_response = weblog.get(
144+
"/kinesis/consume",
145+
params={"stream": self.BUDDY_TO_WEBLOG_STREAM, "message": message, "timeout": 60},
146+
timeout=61,
147+
)
156148

157149
def test_consume(self):
158150
"""Check that a message by an app instrumented by a Datadog tracer is correctly ingested"""
@@ -212,7 +204,6 @@ def validate_kinesis_spans(self, producer_interface, consumer_interface, stream)
212204

213205

214206
@scenarios.crossed_tracing_libraries
215-
@irrelevant(True, reason="AWS Tests are not currently stable.")
216207
@features.aws_kinesis_span_creationcontext_propagation_via_message_attributes_with_dd_trace
217208
class Test_Kinesis_PROPAGATION_VIA_MESSAGE_ATTRIBUTES(_Test_Kinesis):
218209
buddy_interface = interfaces.python_buddy

tests/integrations/crossed_integrations/test_sns_to_sqs.py

Lines changed: 31 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22
import json
33

44
from utils.buddies import python_buddy
5-
from utils import interfaces, scenarios, weblog, missing_feature, features, context, irrelevant
5+
from utils import interfaces, scenarios, weblog, missing_feature, features, context
66
from utils.tools import logger
77

8-
from tests.integrations.utils import delete_sns_topic, delete_sqs_queue
9-
108

119
class _Test_SNS:
1210
"""Test sns compatibility with inputted datadog tracer"""
@@ -102,25 +100,21 @@ def setup_produce(self):
102100
"""Send request A to weblog : this request will produce a sns message
103101
send request B to library buddy, this request will consume sns message
104102
"""
105-
try:
106-
message = (
107-
"[crossed_integrations/test_sns_to_sqs.py][SNS] Hello from SNS "
108-
f"[{context.library.library} weblog->{self.buddy_interface.name}] test produce at {self.unique_id}"
109-
)
110-
111-
self.production_response = weblog.get(
112-
"/sns/produce",
113-
params={"queue": self.WEBLOG_TO_BUDDY_QUEUE, "topic": self.WEBLOG_TO_BUDDY_TOPIC, "message": message},
114-
timeout=60,
115-
)
116-
self.consume_response = self.buddy.get(
117-
"/sns/consume",
118-
params={"queue": self.WEBLOG_TO_BUDDY_QUEUE, "timeout": 60, "message": message},
119-
timeout=61,
120-
)
121-
finally:
122-
delete_sns_topic(self.WEBLOG_TO_BUDDY_TOPIC)
123-
delete_sqs_queue(self.WEBLOG_TO_BUDDY_QUEUE)
103+
message = (
104+
"[crossed_integrations/test_sns_to_sqs.py][SNS] Hello from SNS "
105+
f"[{context.library.library} weblog->{self.buddy_interface.name}] test produce at {self.unique_id}"
106+
)
107+
108+
self.production_response = weblog.get(
109+
"/sns/produce",
110+
params={"queue": self.WEBLOG_TO_BUDDY_QUEUE, "topic": self.WEBLOG_TO_BUDDY_TOPIC, "message": message},
111+
timeout=60,
112+
)
113+
self.consume_response = self.buddy.get(
114+
"/sns/consume",
115+
params={"queue": self.WEBLOG_TO_BUDDY_QUEUE, "timeout": 60, "message": message},
116+
timeout=61,
117+
)
124118

125119
def test_produce(self):
126120
"""Check that a message produced to sns is correctly ingested by a Datadog tracer"""
@@ -166,25 +160,21 @@ def setup_consume(self):
166160
request A: GET /library_buddy/produce_sns_message
167161
request B: GET /weblog/consume_sns_message
168162
"""
169-
try:
170-
message = (
171-
"[crossed_integrations/test_sns_to_sqs.py][SNS] Hello from SNS "
172-
f"[{self.buddy_interface.name}->{context.library.library} weblog] test consume at {self.unique_id}"
173-
)
174-
175-
self.production_response = self.buddy.get(
176-
"/sns/produce",
177-
params={"queue": self.BUDDY_TO_WEBLOG_QUEUE, "topic": self.BUDDY_TO_WEBLOG_TOPIC, "message": message},
178-
timeout=60,
179-
)
180-
self.consume_response = weblog.get(
181-
"/sns/consume",
182-
params={"queue": self.BUDDY_TO_WEBLOG_QUEUE, "timeout": 60, "message": message},
183-
timeout=61,
184-
)
185-
finally:
186-
delete_sns_topic(self.BUDDY_TO_WEBLOG_TOPIC)
187-
delete_sqs_queue(self.BUDDY_TO_WEBLOG_QUEUE)
163+
message = (
164+
"[crossed_integrations/test_sns_to_sqs.py][SNS] Hello from SNS "
165+
f"[{self.buddy_interface.name}->{context.library.library} weblog] test consume at {self.unique_id}"
166+
)
167+
168+
self.production_response = self.buddy.get(
169+
"/sns/produce",
170+
params={"queue": self.BUDDY_TO_WEBLOG_QUEUE, "topic": self.BUDDY_TO_WEBLOG_TOPIC, "message": message},
171+
timeout=60,
172+
)
173+
self.consume_response = weblog.get(
174+
"/sns/consume",
175+
params={"queue": self.BUDDY_TO_WEBLOG_QUEUE, "timeout": 60, "message": message},
176+
timeout=61,
177+
)
188178

189179
def test_consume(self):
190180
"""Check that a message by an app instrumented by a Datadog tracer is correctly ingested"""
@@ -252,7 +242,6 @@ def validate_sns_spans(self, producer_interface, consumer_interface, queue, topi
252242

253243
@scenarios.crossed_tracing_libraries
254244
@features.aws_sns_span_creationcontext_propagation_via_message_attributes_with_dd_trace
255-
@irrelevant(True, reason="AWS Tests are not currently stable.")
256245
class Test_SNS_Propagation(_Test_SNS):
257246
buddy_interface = interfaces.python_buddy
258247
buddy = python_buddy

tests/integrations/crossed_integrations/test_sqs.py

Lines changed: 27 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
from utils import interfaces, scenarios, weblog, missing_feature, features, context, irrelevant
66
from utils.tools import logger
77

8-
from tests.integrations.utils import delete_sqs_queue
9-
108

119
class _Test_SQS:
1210
"""Test sqs compatibility with inputted datadog tracer"""
@@ -87,22 +85,19 @@ def setup_produce(self):
8785
"""Send request A to weblog : this request will produce a sqs message
8886
send request B to library buddy, this request will consume sqs message
8987
"""
90-
try:
91-
message = (
92-
"[crossed_integrations/sqs.py][SQS] Hello from SQS "
93-
f"[{context.library.library} weblog->{self.buddy_interface.name}] test produce: {self.unique_id}"
94-
)
95-
96-
self.production_response = weblog.get(
97-
"/sqs/produce", params={"queue": self.WEBLOG_TO_BUDDY_QUEUE, "message": message}, timeout=60
98-
)
99-
self.consume_response = self.buddy.get(
100-
"/sqs/consume",
101-
params={"queue": self.WEBLOG_TO_BUDDY_QUEUE, "timeout": 60, "message": message},
102-
timeout=61,
103-
)
104-
finally:
105-
delete_sqs_queue(self.WEBLOG_TO_BUDDY_QUEUE)
88+
message = (
89+
"[crossed_integrations/sqs.py][SQS] Hello from SQS "
90+
f"[{context.library.library} weblog->{self.buddy_interface.name}] test produce: {self.unique_id}"
91+
)
92+
93+
self.production_response = weblog.get(
94+
"/sqs/produce", params={"queue": self.WEBLOG_TO_BUDDY_QUEUE, "message": message}, timeout=60
95+
)
96+
self.consume_response = self.buddy.get(
97+
"/sqs/consume",
98+
params={"queue": self.WEBLOG_TO_BUDDY_QUEUE, "timeout": 60, "message": message},
99+
timeout=61,
100+
)
106101

107102
def test_produce(self):
108103
"""Check that a message produced to sqs is correctly ingested by a Datadog tracer"""
@@ -153,22 +148,19 @@ def setup_consume(self):
153148
request A: GET /library_buddy/produce_sqs_message
154149
request B: GET /weblog/consume_sqs_message
155150
"""
156-
try:
157-
message = (
158-
"[crossed_integrations/test_sqs.py][SQS] Hello from SQS "
159-
f"[{self.buddy_interface.name}->{context.library.library} weblog] test consume: {self.unique_id}"
160-
)
161-
162-
self.production_response = self.buddy.get(
163-
"/sqs/produce", params={"queue": self.BUDDY_TO_WEBLOG_QUEUE, "message": message}, timeout=60
164-
)
165-
self.consume_response = weblog.get(
166-
"/sqs/consume",
167-
params={"queue": self.BUDDY_TO_WEBLOG_QUEUE, "timeout": 60, "message": message},
168-
timeout=61,
169-
)
170-
finally:
171-
delete_sqs_queue(self.BUDDY_TO_WEBLOG_QUEUE)
151+
message = (
152+
"[crossed_integrations/test_sqs.py][SQS] Hello from SQS "
153+
f"[{self.buddy_interface.name}->{context.library.library} weblog] test consume: {self.unique_id}"
154+
)
155+
156+
self.production_response = self.buddy.get(
157+
"/sqs/produce", params={"queue": self.BUDDY_TO_WEBLOG_QUEUE, "message": message}, timeout=60
158+
)
159+
self.consume_response = weblog.get(
160+
"/sqs/consume",
161+
params={"queue": self.BUDDY_TO_WEBLOG_QUEUE, "timeout": 60, "message": message},
162+
timeout=61,
163+
)
172164

173165
def test_consume(self):
174166
"""Check that a message by an app instrumented by a Datadog tracer is correctly ingested"""
@@ -229,7 +221,6 @@ def validate_sqs_spans(self, producer_interface, consumer_interface, queue):
229221

230222

231223
@scenarios.crossed_tracing_libraries
232-
@irrelevant(True, reason="AWS Tests are not currently stable.")
233224
@features.aws_sqs_span_creationcontext_propagation_via_message_attributes_with_dd_trace
234225
class Test_SQS_PROPAGATION_VIA_MESSAGE_ATTRIBUTES(_Test_SQS):
235226
buddy_interface = interfaces.python_buddy
@@ -242,8 +233,8 @@ class Test_SQS_PROPAGATION_VIA_MESSAGE_ATTRIBUTES(_Test_SQS):
242233

243234

244235
@scenarios.crossed_tracing_libraries
245-
@irrelevant(True, reason="AWS Tests are not currently stable.")
246236
@features.aws_sqs_span_creationcontext_propagation_via_xray_header_with_dd_trace
237+
@irrelevant("Localstack SQS does not support AWS Xray Header parsing")
247238
class Test_SQS_PROPAGATION_VIA_AWS_XRAY_HEADERS(_Test_SQS):
248239
buddy_interface = interfaces.java_buddy
249240
buddy = java_buddy

0 commit comments

Comments
 (0)