Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 27 additions & 36 deletions tests/integrations/crossed_integrations/test_kinesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
import json

from utils.buddies import python_buddy
from utils import interfaces, scenarios, weblog, missing_feature, features, context, irrelevant
from utils import interfaces, scenarios, weblog, missing_feature, features, context
from utils.tools import logger

from tests.integrations.utils import delete_kinesis_stream


class _Test_Kinesis:
"""Test Kinesis compatibility with inputted datadog tracer"""
Expand Down Expand Up @@ -76,22 +74,19 @@ def setup_produce(self):
send request A to weblog : this request will produce a Kinesis message
send request B to library buddy, this request will consume Kinesis message
"""
try:
message = (
"[crossed_integrations/test_kinesis.py][Kinesis] Hello from Kinesis "
f"[{context.library.library} weblog->{self.buddy_interface.name}] test produce at {self.unique_id}"
)

self.production_response = weblog.get(
"/kinesis/produce", params={"stream": self.WEBLOG_TO_BUDDY_STREAM, "message": message}, timeout=120
)
self.consume_response = self.buddy.get(
"/kinesis/consume",
params={"stream": self.WEBLOG_TO_BUDDY_STREAM, "message": message, "timeout": 60},
timeout=61,
)
finally:
delete_kinesis_stream(self.WEBLOG_TO_BUDDY_STREAM)
message = (
"[crossed_integrations/test_kinesis.py][Kinesis] Hello from Kinesis "
f"[{context.library.library} weblog->{self.buddy_interface.name}] test produce at {self.unique_id}"
)

self.production_response = weblog.get(
"/kinesis/produce", params={"stream": self.WEBLOG_TO_BUDDY_STREAM, "message": message}, timeout=120
)
self.consume_response = self.buddy.get(
"/kinesis/consume",
params={"stream": self.WEBLOG_TO_BUDDY_STREAM, "message": message, "timeout": 60},
timeout=61,
)

def test_produce(self):
"""Check that a message produced to Kinesis is correctly ingested by a Datadog tracer"""
Expand Down Expand Up @@ -139,22 +134,19 @@ def setup_consume(self):
request A: GET /library_buddy/produce_kinesis_message
request B: GET /weblog/consume_kinesis_message
"""
try:
message = (
"[crossed_integrations/test_kinesis.py][Kinesis] Hello from Kinesis "
f"[{self.buddy_interface.name}->{context.library.library} weblog] test consume at {self.unique_id}"
)

self.production_response = self.buddy.get(
"/kinesis/produce", params={"stream": self.BUDDY_TO_WEBLOG_STREAM, "message": message}, timeout=500
)
self.consume_response = weblog.get(
"/kinesis/consume",
params={"stream": self.BUDDY_TO_WEBLOG_STREAM, "message": message, "timeout": 60},
timeout=61,
)
finally:
delete_kinesis_stream(self.BUDDY_TO_WEBLOG_STREAM)
message = (
"[crossed_integrations/test_kinesis.py][Kinesis] Hello from Kinesis "
f"[{self.buddy_interface.name}->{context.library.library} weblog] test consume at {self.unique_id}"
)

self.production_response = self.buddy.get(
"/kinesis/produce", params={"stream": self.BUDDY_TO_WEBLOG_STREAM, "message": message}, timeout=500
)
self.consume_response = weblog.get(
"/kinesis/consume",
params={"stream": self.BUDDY_TO_WEBLOG_STREAM, "message": message, "timeout": 60},
timeout=61,
)

def test_consume(self):
"""Check that a message by an app instrumented by a Datadog tracer is correctly ingested"""
Expand Down Expand Up @@ -215,7 +207,6 @@ def validate_kinesis_spans(self, producer_interface, consumer_interface, stream)


@scenarios.crossed_tracing_libraries
@irrelevant(True, reason="AWS Tests are not currently stable.")
@features.aws_kinesis_span_creationcontext_propagation_via_message_attributes_with_dd_trace
class Test_Kinesis_PROPAGATION_VIA_MESSAGE_ATTRIBUTES(_Test_Kinesis):
buddy_interface = interfaces.python_buddy
Expand Down
73 changes: 31 additions & 42 deletions tests/integrations/crossed_integrations/test_sns_to_sqs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
import json

from utils.buddies import python_buddy
from utils import interfaces, scenarios, weblog, missing_feature, features, context, irrelevant
from utils import interfaces, scenarios, weblog, missing_feature, features, context
from utils.tools import logger

from tests.integrations.utils import delete_sns_topic, delete_sqs_queue


class _Test_SNS:
"""Test sns compatibility with inputted datadog tracer"""
Expand Down Expand Up @@ -103,25 +101,21 @@ def setup_produce(self):
send request A to weblog : this request will produce a sns message
send request B to library buddy, this request will consume sns message
"""
try:
message = (
"[crossed_integrations/test_sns_to_sqs.py][SNS] Hello from SNS "
f"[{context.library.library} weblog->{self.buddy_interface.name}] test produce at {self.unique_id}"
)

self.production_response = weblog.get(
"/sns/produce",
params={"queue": self.WEBLOG_TO_BUDDY_QUEUE, "topic": self.WEBLOG_TO_BUDDY_TOPIC, "message": message},
timeout=60,
)
self.consume_response = self.buddy.get(
"/sns/consume",
params={"queue": self.WEBLOG_TO_BUDDY_QUEUE, "timeout": 60, "message": message},
timeout=61,
)
finally:
delete_sns_topic(self.WEBLOG_TO_BUDDY_TOPIC)
delete_sqs_queue(self.WEBLOG_TO_BUDDY_QUEUE)
message = (
"[crossed_integrations/test_sns_to_sqs.py][SNS] Hello from SNS "
f"[{context.library.library} weblog->{self.buddy_interface.name}] test produce at {self.unique_id}"
)

self.production_response = weblog.get(
"/sns/produce",
params={"queue": self.WEBLOG_TO_BUDDY_QUEUE, "topic": self.WEBLOG_TO_BUDDY_TOPIC, "message": message},
timeout=60,
)
self.consume_response = self.buddy.get(
"/sns/consume",
params={"queue": self.WEBLOG_TO_BUDDY_QUEUE, "timeout": 60, "message": message},
timeout=61,
)

def test_produce(self):
"""Check that a message produced to sns is correctly ingested by a Datadog tracer"""
Expand Down Expand Up @@ -168,25 +162,21 @@ def setup_consume(self):
request A: GET /library_buddy/produce_sns_message
request B: GET /weblog/consume_sns_message
"""
try:
message = (
"[crossed_integrations/test_sns_to_sqs.py][SNS] Hello from SNS "
f"[{self.buddy_interface.name}->{context.library.library} weblog] test consume at {self.unique_id}"
)

self.production_response = self.buddy.get(
"/sns/produce",
params={"queue": self.BUDDY_TO_WEBLOG_QUEUE, "topic": self.BUDDY_TO_WEBLOG_TOPIC, "message": message},
timeout=60,
)
self.consume_response = weblog.get(
"/sns/consume",
params={"queue": self.BUDDY_TO_WEBLOG_QUEUE, "timeout": 60, "message": message},
timeout=61,
)
finally:
delete_sns_topic(self.BUDDY_TO_WEBLOG_TOPIC)
delete_sqs_queue(self.BUDDY_TO_WEBLOG_QUEUE)
message = (
"[crossed_integrations/test_sns_to_sqs.py][SNS] Hello from SNS "
f"[{self.buddy_interface.name}->{context.library.library} weblog] test consume at {self.unique_id}"
)

self.production_response = self.buddy.get(
"/sns/produce",
params={"queue": self.BUDDY_TO_WEBLOG_QUEUE, "topic": self.BUDDY_TO_WEBLOG_TOPIC, "message": message},
timeout=60,
)
self.consume_response = weblog.get(
"/sns/consume",
params={"queue": self.BUDDY_TO_WEBLOG_QUEUE, "timeout": 60, "message": message},
timeout=61,
)

def test_consume(self):
"""Check that a message by an app instrumented by a Datadog tracer is correctly ingested"""
Expand Down Expand Up @@ -255,7 +245,6 @@ def validate_sns_spans(self, producer_interface, consumer_interface, queue, topi

@scenarios.crossed_tracing_libraries
@features.aws_sns_span_creationcontext_propagation_via_message_attributes_with_dd_trace
@irrelevant(True, reason="AWS Tests are not currently stable.")
class Test_SNS_Propagation(_Test_SNS):
buddy_interface = interfaces.python_buddy
buddy = python_buddy
Expand Down
63 changes: 27 additions & 36 deletions tests/integrations/crossed_integrations/test_sqs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
from utils import interfaces, scenarios, weblog, missing_feature, features, context, irrelevant
from utils.tools import logger

from tests.integrations.utils import delete_sqs_queue


class _Test_SQS:
"""Test sqs compatibility with inputted datadog tracer"""
Expand Down Expand Up @@ -88,22 +86,19 @@ def setup_produce(self):
send request A to weblog : this request will produce a sqs message
send request B to library buddy, this request will consume sqs message
"""
try:
message = (
"[crossed_integrations/sqs.py][SQS] Hello from SQS "
f"[{context.library.library} weblog->{self.buddy_interface.name}] test produce: {self.unique_id}"
)

self.production_response = weblog.get(
"/sqs/produce", params={"queue": self.WEBLOG_TO_BUDDY_QUEUE, "message": message}, timeout=60
)
self.consume_response = self.buddy.get(
"/sqs/consume",
params={"queue": self.WEBLOG_TO_BUDDY_QUEUE, "timeout": 60, "message": message},
timeout=61,
)
finally:
delete_sqs_queue(self.WEBLOG_TO_BUDDY_QUEUE)
message = (
"[crossed_integrations/sqs.py][SQS] Hello from SQS "
f"[{context.library.library} weblog->{self.buddy_interface.name}] test produce: {self.unique_id}"
)

self.production_response = weblog.get(
"/sqs/produce", params={"queue": self.WEBLOG_TO_BUDDY_QUEUE, "message": message}, timeout=60
)
self.consume_response = self.buddy.get(
"/sqs/consume",
params={"queue": self.WEBLOG_TO_BUDDY_QUEUE, "timeout": 60, "message": message},
timeout=61,
)

def test_produce(self):
"""Check that a message produced to sqs is correctly ingested by a Datadog tracer"""
Expand Down Expand Up @@ -155,22 +150,19 @@ def setup_consume(self):
request A: GET /library_buddy/produce_sqs_message
request B: GET /weblog/consume_sqs_message
"""
try:
message = (
"[crossed_integrations/test_sqs.py][SQS] Hello from SQS "
f"[{self.buddy_interface.name}->{context.library.library} weblog] test consume: {self.unique_id}"
)

self.production_response = self.buddy.get(
"/sqs/produce", params={"queue": self.BUDDY_TO_WEBLOG_QUEUE, "message": message}, timeout=60
)
self.consume_response = weblog.get(
"/sqs/consume",
params={"queue": self.BUDDY_TO_WEBLOG_QUEUE, "timeout": 60, "message": message},
timeout=61,
)
finally:
delete_sqs_queue(self.BUDDY_TO_WEBLOG_QUEUE)
message = (
"[crossed_integrations/test_sqs.py][SQS] Hello from SQS "
f"[{self.buddy_interface.name}->{context.library.library} weblog] test consume: {self.unique_id}"
)

self.production_response = self.buddy.get(
"/sqs/produce", params={"queue": self.BUDDY_TO_WEBLOG_QUEUE, "message": message}, timeout=60
)
self.consume_response = weblog.get(
"/sqs/consume",
params={"queue": self.BUDDY_TO_WEBLOG_QUEUE, "timeout": 60, "message": message},
timeout=61,
)

def test_consume(self):
"""Check that a message by an app instrumented by a Datadog tracer is correctly ingested"""
Expand Down Expand Up @@ -232,7 +224,6 @@ def validate_sqs_spans(self, producer_interface, consumer_interface, queue):


@scenarios.crossed_tracing_libraries
@irrelevant(True, reason="AWS Tests are not currently stable.")
@features.aws_sqs_span_creationcontext_propagation_via_message_attributes_with_dd_trace
class Test_SQS_PROPAGATION_VIA_MESSAGE_ATTRIBUTES(_Test_SQS):
buddy_interface = interfaces.python_buddy
Expand All @@ -245,8 +236,8 @@ class Test_SQS_PROPAGATION_VIA_MESSAGE_ATTRIBUTES(_Test_SQS):


@scenarios.crossed_tracing_libraries
@irrelevant(True, reason="AWS Tests are not currently stable.")
@features.aws_sqs_span_creationcontext_propagation_via_xray_header_with_dd_trace
@irrelevant("Localstack SQS does not support AWS Xray Header parsing")
class Test_SQS_PROPAGATION_VIA_AWS_XRAY_HEADERS(_Test_SQS):
buddy_interface = interfaces.java_buddy
buddy = java_buddy
Expand Down
Loading
Loading