diff --git a/mod_ci/controllers.py b/mod_ci/controllers.py index 0d268f32..7ce8a0c2 100755 --- a/mod_ci/controllers.py +++ b/mod_ci/controllers.py @@ -1140,8 +1140,9 @@ def update_build_badge(status, test) -> None: for category_results in test_results: test_ids_to_update.extend([test['test'].id for test in category_results['tests'] if not test['error']]) - g.db.query(RegressionTest).filter(RegressionTest.id.in_(test_ids_to_update) - ).update({"last_passed_on": test.id}, synchronize_session=False) + g.db.query(RegressionTest).filter(RegressionTest.id.in_(test_ids_to_update)).update( + {f"last_passed_on_{test.platform.value}": test.id}, synchronize_session=False + ) g.db.commit() @@ -1576,6 +1577,7 @@ def get_info_for_pr_comment(test: Test) -> PrCommentInfo: category_stats = [] test_results = get_test_results(test) + platform_column = f"last_passed_on_{test.platform.value}" for category_results in test_results: category_name = category_results['category'].name @@ -1583,10 +1585,10 @@ def get_info_for_pr_comment(test: Test) -> PrCommentInfo: for test in category_results['tests']: if not test['error']: category_test_pass_count += 1 - if test['test'].last_passed_on != last_test_master.id: + if last_test_master and getattr(test['test'], platform_column) != last_test_master.id: fixed_tests.append(test['test']) else: - if test['test'].last_passed_on != last_test_master.id: + if last_test_master and getattr(test['test'], platform_column) != last_test_master.id: common_failed_tests.append(test['test']) else: extra_failed_tests.append(test['test']) diff --git a/mod_regression/models.py b/mod_regression/models.py index a790b53f..9ade0a61 100644 --- a/mod_regression/models.py +++ b/mod_regression/models.py @@ -94,7 +94,8 @@ class RegressionTest(Base): output_files = relationship('RegressionTestOutput', back_populates='regression_test') expected_rc = Column(Integer) active = Column(Boolean(), default=True) - last_passed_on = Column(Integer, ForeignKey('test.id', onupdate="CASCADE", ondelete="SET NULL")) + last_passed_on_windows = Column(Integer, ForeignKey('test.id', onupdate="CASCADE", ondelete="SET NULL")) + last_passed_on_linux = Column(Integer, ForeignKey('test.id', onupdate="CASCADE", ondelete="SET NULL")) description = Column(String(length=1024)) def __init__(self, sample_id, command, input_type, output_type, category_id, expected_rc, diff --git a/templates/ci/pr_comment.txt b/templates/ci/pr_comment.txt index ae6b5346..57d815f6 100644 --- a/templates/ci/pr_comment.txt +++ b/templates/ci/pr_comment.txt @@ -30,7 +30,14 @@ Your PR breaks these cases: NOTE: The following tests have been failing on the master branch as well as the PR: