Skip to content

Commit

Permalink
Tests failure
Browse files Browse the repository at this point in the history
  • Loading branch information
nine5two7 committed Nov 5, 2024
1 parent ebc2349 commit 42ddc38
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions aws/logs_monitoring/tests/test_awslogs_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def test_awslogs_handler_step_functions_tags_added_properly(
{
"id": "37199773595581154154810589279545129148442535997644275712",
"timestamp": 1668095539607,
"message": '{"id": "1","type": "ExecutionStarted","details": {"input": "{}","inputDetails": {"truncated": "false"},"roleArn": "arn:aws:iam::12345678910:role/service-role/StepFunctions-test-role-a0iurr4pt"},"previous_event_id": "0","event_timestamp": "1716992192441","execution_arn": "arn:aws:states:us-east-1:12345678910:execution:StepFunction1:ccccccc-d1da-4c38-b32c-2b6b07d713fa","redrive_count": "0"}',
"message": '{"id": "1","type": "ExecutionStarted","details": {"input": "{}","inputDetails": {"truncated": "false"},"roleArn": "arn:aws:iam::12345678910:role/service-role/StepFunctions-test-role-a0iurr4pt"},"previous_event_id": "0","event_timestamp": "1716992192441","execution_arn": "arn:aws:states:us-east-1:12345678910:execution:StepFunction3:ccccccc-d1da-4c38-b32c-2b6b07d713fa","redrive_count": "0"}',
}
],
}
Expand Down Expand Up @@ -125,13 +125,12 @@ def test_awslogs_handler_step_functions_tags_added_properly(
)
self.assertEqual(
awslogs_handler.metadata[DD_HOST],
"arn:aws:states:us-east-1:12345678910:stateMachine:StepFunction1",
"arn:aws:states:us-east-1:12345678910:stateMachine:StepFunction3",
)

@patch("caching.cloudwatch_log_group_cache.CloudwatchLogGroupTagsCache.__init__")
@patch("caching.cloudwatch_log_group_cache.send_forwarder_internal_metrics")
@patch.dict("os.environ", {"DD_STEP_FUNCTIONS_TRACE_ENABLED": "true"})
def test_awslogs_handler_step_functions_customized_log_group_properly(
def test_awslogs_handler_step_functions_customized_log_group(
self,
mock_forward_metrics,
mock_cache_init,
Expand Down Expand Up @@ -165,7 +164,7 @@ def test_awslogs_handler_step_functions_customized_log_group_properly(
}
}
context = None
metadata = {"ddsource": "postgresql", "ddtags": "env:dev"}
metadata = {"ddtags": "env:dev"}
mock_forward_metrics.side_effect = MagicMock()
mock_cache_init.return_value = None
cache_layer = CacheLayer("")
Expand All @@ -175,7 +174,7 @@ def test_awslogs_handler_step_functions_customized_log_group_properly(
cache_layer._cloudwatch_log_group_cache.get = MagicMock()

awslogs_handler = AwsLogsHandler(context, metadata, cache_layer)
awslogs_handler.handle(eventFromCustomizedLogGroup)
verify_as_json(list(awslogs_handler.handle(eventFromCustomizedLogGroup)))
self.assertEqual(
awslogs_handler.metadata[DD_SOURCE], AwsEventSource.STEPFUNCTION.value
)
Expand Down

0 comments on commit 42ddc38

Please sign in to comment.