From 6b95ecdb49e056f069609462ca75270b14b445e7 Mon Sep 17 00:00:00 2001 From: Titouan Rigoudy Date: Mon, 8 Apr 2024 14:54:22 +0200 Subject: [PATCH] Test that check_latest_revisions skips bad builds. --- .../bot/tasks/utasks/regression_task_test.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/clusterfuzz/_internal/tests/core/bot/tasks/utasks/regression_task_test.py b/src/clusterfuzz/_internal/tests/core/bot/tasks/utasks/regression_task_test.py index 9fbe6bfa97..b39f4c49ff 100644 --- a/src/clusterfuzz/_internal/tests/core/bot/tasks/utasks/regression_task_test.py +++ b/src/clusterfuzz/_internal/tests/core/bot/tasks/utasks/regression_task_test.py @@ -180,6 +180,25 @@ def test_latest_revisions_all_crash(self): self.assertIsNone(result) + def test_skip_latest_bad_builds(self): + """Ensures that `check_latest_revisions` skips bad builds.""" + + def repros(revision): + if revision > 19: + return False, uworker_msg_pb2.Output( + error_type=uworker_msg_pb2.REGRESSION_BAD_BUILD_ERROR) + + return True, None + + self.reproduces_in_revision = repros + + regression_task_output = uworker_msg_pb2.RegressionTaskOutput() + result = regression_task.check_latest_revisions( + self.testcase, '/a/b', 'job_name', self.revision_list, None, + regression_task_output) + + self.assertIsNone(result) + def test_regressed_at_min_revision(self): """Ensures that `check_earliest_revisions` returns a result if we reproduce in the earliest revision.