@@ -154,13 +154,15 @@ def test_process_workflow_activity__no_workflows(self, mock_logger) -> None:
154154 mock_logger .info .assert_called_once_with (
155155 "workflow_engine.process_workflows.evaluation.workflows.not_triggered" ,
156156 extra = {
157- "debug_msg" : "No workflows are associated with the detector in the event" ,
158- "group_event" : self .activity ,
159- "action_groups" : None ,
157+ "workflow_ids" : None ,
158+ "associated_detector" : self .detector .get_snapshot (),
159+ "event" : self .activity ,
160+ "group" : self .activity .group ,
161+ "event_data" : self .activity .data ,
162+ "action_filter_conditions" : None ,
160163 "triggered_actions" : None ,
161- "workflows" : set (),
162164 "triggered_workflows" : None ,
163- "associated_detector " : self . detector ,
165+ "debug_msg " : "No workflows are associated with the detector in the event" ,
164166 },
165167 )
166168
@@ -199,13 +201,15 @@ def test_process_workflow_activity__workflows__no_actions(
199201 mock_logger .info .assert_called_once_with (
200202 "workflow_engine.process_workflows.evaluation.workflows.triggered" ,
201203 extra = {
202- "debug_msg" : "No items were triggered or queued for slow evaluation" ,
203- "group_event" : self .activity ,
204- "action_groups" : None ,
204+ "workflow_ids" : [self .workflow .id ],
205+ "associated_detector" : self .detector .get_snapshot (),
206+ "event" : self .activity ,
207+ "group" : self .activity .group ,
208+ "event_data" : self .activity .data ,
209+ "action_filter_conditions" : None ,
205210 "triggered_actions" : None ,
206- "workflows" : {self .workflow },
207- "triggered_workflows" : set (), # from the mock
208- "associated_detector" : self .detector ,
211+ "triggered_workflows" : None ,
212+ "debug_msg" : "No items were triggered or queued for slow evaluation" ,
209213 },
210214 )
211215
@@ -241,25 +245,15 @@ def test_process_workflow_activity(
241245 )
242246
243247 mock_filter_actions .assert_called_once_with ({self .action_group }, expected_event_data )
244- mock_logger .info .assert_called_once_with (
245- "workflow_engine.process_workflows.evaluation.actions.triggered" ,
246- extra = {
247- "debug_msg" : None ,
248- "group_event" : self .activity ,
249- "action_groups" : {self .action_group },
250- "triggered_actions" : set (),
251- "workflows" : {self .workflow },
252- "triggered_workflows" : {self .workflow },
253- "associated_detector" : self .detector ,
254- },
255- )
256248
257249 @mock .patch ("sentry.workflow_engine.processors.workflow.evaluate_workflow_triggers" )
258250 @mock .patch ("sentry.workflow_engine.tasks.workflows.logger" )
259251 def test_process_workflow_activity__success_logs (
260252 self , mock_logger , mock_evaluate_workflow_triggers
261253 ) -> None :
262254 self .workflow = self .create_workflow (organization = self .organization )
255+
256+ # Add additional data to ensure logs work as expected
263257 self .workflow .when_condition_group = self .create_data_condition_group ()
264258 self .create_data_condition (condition_group = self .workflow .when_condition_group )
265259 self .workflow .save ()
0 commit comments