@@ -930,49 +930,11 @@ def test_without_feature_flag(self, mock_budget, mock_state, mock_rate, mock_tri
930930 assert mock_trigger .call_args [1 ]["stopping_point" ] is None
931931
932932 @patch ("sentry.seer.autofix.issue_summary._trigger_autofix_task.delay" )
933- @patch ("sentry.seer.autofix.issue_summary._generate_fixability_score" )
934- def test_missing_fixability_score_generates_and_fails (
935- self , mock_generate_fixability , mock_trigger
936- ):
937- """Test that _run_automation tries to generate fixability score when None and fails if generation fails."""
938- assert self .group .seer_fixability_score is None
939- mock_generate_fixability .side_effect = Exception ("Fixability generation failed" )
940-
941- with pytest .raises (Exception , match = "Fixability generation failed" ):
942- _run_automation (self .group , self .user , self .event , SeerAutomationSource .ALERT )
943-
944- mock_generate_fixability .assert_called_once_with (self .group )
945- mock_trigger .assert_not_called ()
946-
947- @patch ("sentry.seer.autofix.issue_summary._trigger_autofix_task.delay" )
948- @patch (
949- "sentry.seer.autofix.issue_summary.is_seer_autotriggered_autofix_rate_limited" ,
950- return_value = False ,
951- )
952- @patch ("sentry.seer.autofix.issue_summary._generate_fixability_score" )
953- @patch ("sentry.seer.autofix.issue_summary.get_autofix_state" , return_value = None )
954- @patch ("sentry.quotas.backend.has_available_reserved_budget" , return_value = True )
955- def test_missing_fixability_score_generates_and_succeeds (
956- self , mock_budget , mock_state , mock_generate_fixability , mock_rate_limit , mock_trigger
957- ):
958- """Test that _run_automation generates fixability score when None and continues if generation succeeds."""
933+ def test_missing_fixability_score_returns_early (self , mock_trigger ):
934+ """Test that _run_automation returns early when fixability score is None."""
959935 assert self .group .seer_fixability_score is None
960- self .project .update_option ("sentry:autofix_automation_tuning" , "always" )
961- mock_generate_fixability .return_value = SummarizeIssueResponse (
962- group_id = str (self .group .id ),
963- headline = "h" ,
964- whats_wrong = "w" ,
965- trace = "t" ,
966- possible_cause = "c" ,
967- scores = SummarizeIssueScores (fixability_score = 0.80 ),
968- )
969-
970936 _run_automation (self .group , self .user , self .event , SeerAutomationSource .ALERT )
971-
972- mock_generate_fixability .assert_called_once_with (self .group )
973- mock_trigger .assert_called_once ()
974- self .group .refresh_from_db ()
975- assert self .group .seer_fixability_score == 0.80
937+ mock_trigger .assert_not_called ()
976938
977939
978940class TestFetchUserPreference :
0 commit comments