@@ -1548,6 +1548,15 @@ def set_avg_time(platform, process_type: str, time_taken: int) -> None:
1548
1548
1549
1549
def get_info_for_pr_comment (test_id : int ) -> PrCommentInfo :
1550
1550
"""Return info about the given test id for use in a PR comment."""
1551
+ regression_testid_passed = g .db .query (TestResult .regression_test_id ).outerjoin (
1552
+ TestResultFile , TestResult .test_id == TestResultFile .test_id ).filter (
1553
+ TestResult .test_id == test_id ,
1554
+ TestResult .expected_rc == TestResult .exit_code ,
1555
+ and_ (
1556
+ RegressionTestOutput .regression_id == TestResult .regression_test_id ,
1557
+ RegressionTestOutput .ignore .is_ (True )
1558
+ )).distinct ().subquery ()
1559
+
1551
1560
regression_testid_passed = g .db .query (TestResult .regression_test_id ).outerjoin (
1552
1561
TestResultFile , TestResult .test_id == TestResultFile .test_id ).filter (
1553
1562
TestResult .test_id == test_id ,
@@ -1560,11 +1569,9 @@ def get_info_for_pr_comment(test_id: int) -> PrCommentInfo:
1560
1569
and_ (
1561
1570
RegressionTestOutputFiles .regression_test_output_id == TestResultFile .regression_test_output_id ,
1562
1571
TestResultFile .got == RegressionTestOutputFiles .file_hashes
1563
- ))),
1564
- and_ (
1565
- RegressionTestOutput .regression_id == TestResult .regression_test_id ,
1566
- RegressionTestOutput .ignore .is_ (True ),
1567
- ))).distinct ().subquery ()
1572
+ )))
1573
+ )).distinct ().union (g .db .query (regression_testid_passed .c .regression_test_id ))
1574
+
1568
1575
passed = g .db .query (label ('category_id' , Category .id ), label (
1569
1576
'success' , count (regressionTestLinkTable .c .regression_id ))).filter (
1570
1577
regressionTestLinkTable .c .regression_id .in_ (regression_testid_passed ),
0 commit comments