@@ -263,6 +263,8 @@ def test_get_trace_tree_for_event(self):
263
263
mock_event .platform = event_data ["platform" ]
264
264
mock_event .project_id = event_data ["project_id" ]
265
265
mock_event .trace_id = trace_id
266
+ mock_event .message = event_data .get ("message" , event_data ["title" ])
267
+ mock_event .transaction = event_data .get ("transaction" , None )
266
268
error_events .append (mock_event )
267
269
268
270
# Update to patch both Transactions and Events dataset calls
@@ -404,6 +406,8 @@ def test_get_trace_tree_out_of_order_processing(self, mock_get_events):
404
406
child_event .platform = "python"
405
407
child_event .project_id = self .project .id
406
408
child_event .trace_id = trace_id
409
+ child_event .message = "Child First"
410
+ child_event .transaction = None
407
411
408
412
# Create proper parent event object
409
413
parent_event = Mock ()
@@ -424,6 +428,8 @@ def test_get_trace_tree_out_of_order_processing(self, mock_get_events):
424
428
parent_event .platform = "python"
425
429
parent_event .project_id = self .project .id
426
430
parent_event .trace_id = trace_id
431
+ parent_event .message = "Parent Last"
432
+ parent_event .transaction = None
427
433
428
434
# Set up the mock to return different results for different dataset calls
429
435
def side_effect (filter , dataset = None , ** kwargs ):
@@ -495,6 +501,8 @@ def test_get_trace_tree_with_only_errors(self, mock_get_events):
495
501
error1 .platform = "python"
496
502
error1 .project_id = self .project .id
497
503
error1 .trace_id = trace_id
504
+ error1 .message = "First Error"
505
+ error1 .transaction = None
498
506
499
507
error2_span_id = "error2-span-id"
500
508
error2 = Mock ()
@@ -514,6 +522,8 @@ def test_get_trace_tree_with_only_errors(self, mock_get_events):
514
522
error2 .platform = "python"
515
523
error2 .project_id = self .project .id
516
524
error2 .trace_id = trace_id
525
+ error2 .message = "Second Error"
526
+ error2 .transaction = None
517
527
518
528
# This error is a child of error2
519
529
error3 = Mock ()
@@ -533,6 +543,8 @@ def test_get_trace_tree_with_only_errors(self, mock_get_events):
533
543
error3 .platform = "python"
534
544
error3 .project_id = self .project .id
535
545
error3 .trace_id = trace_id
546
+ error3 .message = "Child Error"
547
+ error3 .transaction = None
536
548
537
549
# Another "orphaned" error with a parent_span_id that doesn't point to anything
538
550
error4 = Mock ()
@@ -552,6 +564,8 @@ def test_get_trace_tree_with_only_errors(self, mock_get_events):
552
564
error4 .platform = "python"
553
565
error4 .project_id = self .project .id
554
566
error4 .trace_id = trace_id
567
+ error4 .message = "Orphaned Error"
568
+ error4 .transaction = None
555
569
556
570
# Return empty transactions list but populate errors list
557
571
def side_effect (filter , dataset = None , ** kwargs ):
@@ -628,6 +642,8 @@ def test_get_trace_tree_all_relationship_rules(self, mock_get_events):
628
642
root_tx .platform = "python"
629
643
root_tx .project_id = self .project .id
630
644
root_tx .trace_id = trace_id
645
+ root_tx .message = "Root Transaction"
646
+ root_tx .transaction = "Root Transaction"
631
647
632
648
# Rule 1: Child whose parent_span_id matches another event's span_id
633
649
rule1_child = Mock ()
@@ -647,6 +663,8 @@ def test_get_trace_tree_all_relationship_rules(self, mock_get_events):
647
663
rule1_child .platform = "python"
648
664
rule1_child .project_id = self .project .id
649
665
rule1_child .trace_id = trace_id
666
+ rule1_child .message = "Rule 1 Child"
667
+ rule1_child .transaction = None
650
668
651
669
# Rule 2: Child whose parent_span_id matches a span in a transaction
652
670
rule2_child = Mock ()
@@ -666,6 +684,8 @@ def test_get_trace_tree_all_relationship_rules(self, mock_get_events):
666
684
rule2_child .platform = "python"
667
685
rule2_child .project_id = self .project .id
668
686
rule2_child .trace_id = trace_id
687
+ rule2_child .message = "Rule 2 Child"
688
+ rule2_child .transaction = None
669
689
670
690
# Rule 3: Child whose span_id matches a span in a transaction
671
691
rule3_child = Mock ()
@@ -684,6 +704,8 @@ def test_get_trace_tree_all_relationship_rules(self, mock_get_events):
684
704
rule3_child .platform = "python"
685
705
rule3_child .project_id = self .project .id
686
706
rule3_child .trace_id = trace_id
707
+ rule3_child .message = "Rule 3 Child"
708
+ rule3_child .transaction = None
687
709
688
710
# Set up the mock to return our test events
689
711
def side_effect (filter , dataset = None , ** kwargs ):
0 commit comments