4545from mod_sample .models import Issue
4646from mod_test .controllers import get_test_results
4747from mod_test .models import (Fork , Test , TestPlatform , TestProgress ,
48- TestResult , TestResultFile , TestStatus , TestType )
48+ TestResult , TestResultFile , TestResultStatus ,
49+ TestStatus , TestType )
4950from utility import is_valid_signature , request_from_github
5051
5152# Timeout constants (in seconds)
@@ -2760,6 +2761,7 @@ def get_info_for_pr_comment(test: Test) -> PrCommentInfo:
27602761 extra_failed_tests = []
27612762 common_failed_tests = []
27622763 fixed_tests = []
2764+ never_worked_tests = []
27632765 category_stats = []
27642766
27652767 test_results = get_test_results (test )
@@ -2768,20 +2770,26 @@ def get_info_for_pr_comment(test: Test) -> PrCommentInfo:
27682770 category_name = category_results ['category' ].name
27692771
27702772 category_test_pass_count = 0
2771- for test in category_results ['tests' ]:
2772- if not test ['error' ]:
2773+ for t in category_results ['tests' ]:
2774+ if not t ['error' ]:
27732775 category_test_pass_count += 1
2774- if last_test_master and getattr (test ['test' ], platform_column ) != last_test_master .id :
2775- fixed_tests .append (test ['test' ])
2776+ if last_test_master and getattr (t ['test' ], platform_column ) != last_test_master .id :
2777+ fixed_tests .append (t ['test' ])
27762778 else :
2777- if last_test_master and getattr (test ['test' ], platform_column ) != last_test_master .id :
2778- common_failed_tests .append (test ['test' ])
2779+ # Separate out tests that have NEVER passed on any CCExtractor version
2780+ if t ['status' ] == TestResultStatus .never_worked :
2781+ never_worked_tests .append (t ['test' ])
2782+ elif last_test_master and getattr (t ['test' ], platform_column ) != last_test_master .id :
2783+ common_failed_tests .append (t ['test' ])
27792784 else :
2780- extra_failed_tests .append (test ['test' ])
2785+ extra_failed_tests .append (t ['test' ])
27812786
27822787 category_stats .append (CategoryTestInfo (category_name , len (category_results ['tests' ]), category_test_pass_count ))
27832788
2784- return PrCommentInfo (category_stats , extra_failed_tests , fixed_tests , common_failed_tests , last_test_master )
2789+ return PrCommentInfo (
2790+ category_stats , extra_failed_tests , fixed_tests , common_failed_tests ,
2791+ last_test_master , never_worked_tests
2792+ )
27852793
27862794
27872795def comment_pr (test : Test ) -> str :
@@ -2817,6 +2825,9 @@ def comment_pr(test: Test) -> str:
28172825 log .debug (f"GitHub PR Comment ID { comment .id } Uploaded for Test_id: { test_id } " )
28182826 except Exception as e :
28192827 log .error (f"GitHub PR Comment Failed for Test_id: { test_id } with Exception { e } " )
2828+
2829+ # Determine PR status:
2830+ # SUCCESS if no regressions caused by PR (never_worked tests don't count)
28202831 return Status .SUCCESS if len (comment_info .extra_failed_tests ) == 0 else Status .FAILURE
28212832
28222833
0 commit comments