From 49112f42625bb93e96e87d3297f4742199b90f7b Mon Sep 17 00:00:00 2001 From: "chenguang.xu@datadoghq.com" Date: Tue, 5 Nov 2024 12:38:24 -0500 Subject: [PATCH] Test issue --- ..._handler_step_functions_customized_log_group.approved.json} | 2 +- aws/logs_monitoring/tests/test_awslogs_handler.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) rename aws/logs_monitoring/tests/approved_files/{TestAWSLogsHandler.test_awslogs_handler_step_functions_customized_log_group.json => TestAWSLogsHandler.test_awslogs_handler_step_functions_customized_log_group.approved.json} (90%) diff --git a/aws/logs_monitoring/tests/approved_files/TestAWSLogsHandler.test_awslogs_handler_step_functions_customized_log_group.json b/aws/logs_monitoring/tests/approved_files/TestAWSLogsHandler.test_awslogs_handler_step_functions_customized_log_group.approved.json similarity index 90% rename from aws/logs_monitoring/tests/approved_files/TestAWSLogsHandler.test_awslogs_handler_step_functions_customized_log_group.json rename to aws/logs_monitoring/tests/approved_files/TestAWSLogsHandler.test_awslogs_handler_step_functions_customized_log_group.approved.json index 3e49300f..f99ff145 100644 --- a/aws/logs_monitoring/tests/approved_files/TestAWSLogsHandler.test_awslogs_handler_step_functions_customized_log_group.json +++ b/aws/logs_monitoring/tests/approved_files/TestAWSLogsHandler.test_awslogs_handler_step_functions_customized_log_group.approved.json @@ -2,7 +2,7 @@ { "aws": { "awslogs": { - "logGroup": "/aws/vendedlogs/states/logs-to-traces-sequential-Logs", + "logGroup": "test/logs", "logStream": "states/logs-to-traces-sequential/2022-11-10-15-50/7851b2d9", "owner": "425362996713" } diff --git a/aws/logs_monitoring/tests/test_awslogs_handler.py b/aws/logs_monitoring/tests/test_awslogs_handler.py index 8f7c2de3..88b9bf7d 100644 --- a/aws/logs_monitoring/tests/test_awslogs_handler.py +++ b/aws/logs_monitoring/tests/test_awslogs_handler.py @@ -131,6 +131,7 @@ def test_awslogs_handler_step_functions_tags_added_properly( @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( self, mock_forward_metrics, @@ -165,7 +166,7 @@ def test_awslogs_handler_step_functions_customized_log_group( } } context = None - metadata = {"ddtags": "env:dev"} + metadata = {"ddsource": "postgresql", "ddtags": "env:dev"} mock_forward_metrics.side_effect = MagicMock() mock_cache_init.return_value = None cache_layer = CacheLayer("")