diff --git a/bodhi/server/models.py b/bodhi/server/models.py index 2775b23e59..b3e7850498 100644 --- a/bodhi/server/models.py +++ b/bodhi/server/models.py @@ -19,7 +19,7 @@ from collections import defaultdict from copy import copy -from datetime import datetime +from datetime import datetime, timedelta from textwrap import wrap import hashlib import json @@ -2211,42 +2211,83 @@ def get_test_gating_info(self): } return util.greenwave_api_post(self._greenwave_api_url, data) - def _get_test_gating_status(self): + @property + def _greenwave_requirements_generator(self): """ - Query Greenwave about this update and return the information retrieved. + Query Greenwave about this update and return satisfied and unsatisfied requirements. Returns: - TestGatingStatus: - - TestGatingStatus.ignored if no tests are required - - TestGatingStatus.failed if policies are not satisfied - - TestGatingStatus.passed if policies are satisfied, and there - are required tests + generator: An iterable of 2-tuples of lists of requirement dicts from each request + batch: first tuple item satisfied requirements, second item unsatisfied requirements. + Either list or both may be empty. Raises: BodhiException: When the ``greenwave_api_url`` is undefined in configuration. - RuntimeError: If Greenwave did not give us a 200 code. + RuntimeError: If Greenwave did not give us a 200 code, including if no applicable + policies were found. """ - # If an unrestricted policy is applied and no tests are required - # on this update, let's set the test gating as ignored in Bodhi. - status = TestGatingStatus.ignored for data in self.greenwave_request_batches(verbose=False): response = util.greenwave_api_post(self._greenwave_api_url, data) - if not response['policies_satisfied']: - return TestGatingStatus.failed - - if status != TestGatingStatus.ignored or response['summary'] != 'no tests are required': - status = TestGatingStatus.passed - - return status + satisfied = response.get('satisfied_requirements', []) + unsatisfied = response.get('unsatisfied_requirements', []) + yield (satisfied, unsatisfied) @property def _unsatisfied_requirements(self): - unsatisfied_requirements = [] - for data in self.greenwave_request_batches(verbose=False): - response = util.greenwave_api_post(self._greenwave_api_url, data) - unsatisfied_requirements.extend(response['unsatisfied_requirements']) + """Query Greenwave about this update and return all unsatisfied requirements. + + Returns: + list: A list of unsatisfied requirement dicts. + + Raises: + BodhiException: When the ``greenwave_api_url`` is undefined in configuration. + RuntimeError: If Greenwave did not give us a 200 code, including if no applicable + policies were found. + """ + ret = [] + for (_, unsatisfied) in self._greenwave_requirements_generator: + ret.extend(unsatisfied) + return ret + + def _get_test_gating_status(self): + """ + Query Greenwave about this update and return the information retrieved. - return unsatisfied_requirements + Returns: + TestGatingStatus: + - TestGatingStatus.ignored if no tests are required + - TestGatingStatus.passed if there are required tests and policies are satisfied + - TestGatingStatus.waiting if there are required tests that have not yet completed, + no required test has failed, and update was last modified less than 2 hours ago + - TestGatingStatus.failed otherwise (failed required tests, missing required + test results and last modified more than 2 hours ago) + + Raises: + BodhiException: When the ``greenwave_api_url`` is undefined in configuration. + RuntimeError: If Greenwave did not give us a 200 code, including if no applicable + policies were found. + """ + gotsat = False + gotunsat = False + recent = datetime.utcnow() - self.last_modified < timedelta(hours=2) + for (satisfied, unsatisfied) in self._greenwave_requirements_generator: + if satisfied: + gotsat = True + if unsatisfied: + gotunsat = True + if not recent or not all(req.get('type', '') == 'test-result-missing' + for req in unsatisfied): + return TestGatingStatus.failed + + if not gotsat and not gotunsat: + return TestGatingStatus.ignored + + if gotsat and not gotunsat: + return TestGatingStatus.passed + + # here, we have unsatisfied requirements but we never bailed early + # in the for loop, so they are all 'missing' and update was recently modified + return TestGatingStatus.waiting @property def install_command(self) -> str: diff --git a/bodhi/tests/server/consumers/test_signed.py b/bodhi/tests/server/consumers/test_signed.py index 32d3a8bb17..d5f1140bb6 100644 --- a/bodhi/tests/server/consumers/test_signed.py +++ b/bodhi/tests/server/consumers/test_signed.py @@ -239,7 +239,22 @@ def test_consume_from_tag(self): with mock.patch('bodhi.server.models.util.greenwave_api_post') as mock_greenwave: greenwave_response = { 'policies_satisfied': True, - 'summary': "all tests have passed" + 'summary': "All required tests passed", + 'applicable_policies': [ + 'kojibuild_bodhipush_no_requirements', + 'kojibuild_bodhipush_remoterule', + 'bodhiupdate_bodhipush_no_requirements', + 'bodhiupdate_bodhipush_openqa' + ], + 'satisfied_requirements': [ + { + 'result_id': 39603316, + 'subject_type': 'bodhi_update', + 'testcase': 'update.install_default_update_netinst', + 'type': 'test-result-passed' + }, + ], + 'unsatisfied_requirements': [] } mock_greenwave.return_value = greenwave_response with fml_testing.mock_sends(update_schemas.UpdateReadyForTestingV1): @@ -276,7 +291,22 @@ def test_consume_from_tag_composed_by_bodhi(self, add_tag): with mock.patch('bodhi.server.models.util.greenwave_api_post') as mock_greenwave: greenwave_response = { 'policies_satisfied': True, - 'summary': "all tests have passed" + 'summary': "All required tests passed", + 'applicable_policies': [ + 'kojibuild_bodhipush_no_requirements', + 'kojibuild_bodhipush_remoterule', + 'bodhiupdate_bodhipush_no_requirements', + 'bodhiupdate_bodhipush_openqa' + ], + 'satisfied_requirements': [ + { + 'result_id': 39603316, + 'subject_type': 'bodhi_update', + 'testcase': 'update.install_default_update_netinst', + 'type': 'test-result-passed' + }, + ], + 'unsatisfied_requirements': [] } mock_greenwave.return_value = greenwave_response with fml_testing.mock_sends(update_schemas.UpdateRequestTestingV1): diff --git a/bodhi/tests/server/services/test_updates.py b/bodhi/tests/server/services/test_updates.py index 9d10165d53..cba032cabb 100644 --- a/bodhi/tests/server/services/test_updates.py +++ b/bodhi/tests/server/services/test_updates.py @@ -5843,7 +5843,7 @@ def test_waive_test_results_1_unsatisfied_requirement( }, 'scenario': None, 'testcase': 'dist.rpmdeplint', - 'type': 'test-result-missing' + 'type': 'test-result-failed' } ], } @@ -5912,7 +5912,7 @@ def test_waive_test_results_2_unsatisfied_requirements( }, 'scenario': None, 'testcase': 'dist.rpmdeplint', - 'type': 'test-result-missing' + 'type': 'test-result-failed' }, { 'item': { @@ -5921,7 +5921,7 @@ def test_waive_test_results_2_unsatisfied_requirements( }, 'scenario': None, 'testcase': 'atomic_ci_pipeline_results', - 'type': 'test-result-missing' + 'type': 'test-result-failed' } ], } @@ -6006,7 +6006,7 @@ def test_waive_test_results_1_of_2_unsatisfied_requirements( }, 'scenario': None, 'testcase': 'dist.rpmdeplint', - 'type': 'test-result-missing' + 'type': 'test-result-failed' }, { 'item': { @@ -6015,7 +6015,7 @@ def test_waive_test_results_1_of_2_unsatisfied_requirements( }, 'scenario': None, 'testcase': 'atomic_ci_pipeline_results', - 'type': 'test-result-missing' + 'type': 'test-result-failed' } ], } @@ -6088,7 +6088,7 @@ def test_waive_test_results_2_of_2_unsatisfied_requirements( }, 'scenario': None, 'testcase': 'dist.rpmdeplint', - 'type': 'test-result-missing' + 'type': 'test-result-failed' }, { 'item': { @@ -6097,7 +6097,7 @@ def test_waive_test_results_2_of_2_unsatisfied_requirements( }, 'scenario': None, 'testcase': 'atomic_ci_pipeline_results', - 'type': 'test-result-missing' + 'type': 'test-result-failed' } ], } @@ -6186,7 +6186,7 @@ def test_waive_test_results_unfailing_tests( }, 'scenario': None, 'testcase': 'dist.rpmdeplint', - 'type': 'test-result-missing' + 'type': 'test-result-failed' }, { 'item': { @@ -6195,7 +6195,7 @@ def test_waive_test_results_unfailing_tests( }, 'scenario': None, 'testcase': 'atomic_ci_pipeline_results', - 'type': 'test-result-missing' + 'type': 'test-result-failed' } ], } diff --git a/bodhi/tests/server/tasks/test_check_policies.py b/bodhi/tests/server/tasks/test_check_policies.py index 6f42e9b093..3abb7d00b0 100644 --- a/bodhi/tests/server/tasks/test_check_policies.py +++ b/bodhi/tests/server/tasks/test_check_policies.py @@ -53,14 +53,28 @@ def test_policies_satisfied(self): """Assert correct behavior when the policies enforced by Greenwave are satisfied""" update = self.db.query(models.Update).all()[0] update.status = models.UpdateStatus.testing + update.critpath = True # Clear pending messages self.db.info['messages'] = [] self.db.commit() with patch('bodhi.server.models.util.greenwave_api_post') as mock_greenwave: greenwave_response = { 'policies_satisfied': True, - 'summary': 'All tests passed', - 'applicable_policies': ['taskotron_release_critical_tasks'], + 'summary': 'All required tests passed', + 'applicable_policies': [ + 'kojibuild_bodhipush_no_requirements', + 'kojibuild_bodhipush_remoterule', + 'bodhiupdate_bodhipush_no_requirements', + 'bodhiupdate_bodhipush_openqa' + ], + 'satisfied_requirements': [ + { + 'result_id': 39603316, + 'subject_type': 'bodhi_update', + 'testcase': 'update.install_default_update_netinst', + 'type': 'test-result-passed' + }, + ], 'unsatisfied_requirements': [] } mock_greenwave.return_value = greenwave_response @@ -69,7 +83,7 @@ def test_policies_satisfied(self): assert update.test_gating_status == models.TestGatingStatus.passed expected_query = { - 'product_version': 'fedora-17', 'decision_context': 'bodhi_update_push_stable', + 'product_version': 'fedora-17', 'decision_context': 'bodhi_update_push_stable_critpath', 'subject': [ {'item': 'bodhi-2.0-1.fc17', 'type': 'koji_build'}, {'item': 'FEDORA-{}-a3bbe1a8f2'.format(datetime.datetime.utcnow().year), @@ -85,12 +99,26 @@ def test_policies_pending_satisfied(self): greenwave with the ``bodhi_update_push_testing`` decision context. """ update = self.db.query(models.Update).all()[0] update.status = models.UpdateStatus.pending + update.critpath = True self.db.commit() with patch('bodhi.server.models.util.greenwave_api_post') as mock_greenwave: greenwave_response = { 'policies_satisfied': True, - 'summary': 'All tests passed', - 'applicable_policies': ['taskotron_release_critical_tasks'], + 'summary': 'All required tests passed', + 'applicable_policies': [ + 'kojibuild_bodhipush_no_requirements', + 'kojibuild_bodhipush_remoterule', + 'bodhiupdate_bodhipush_no_requirements', + 'bodhiupdate_bodhipush_openqa' + ], + 'satisfied_requirements': [ + { + 'result_id': 39603316, + 'subject_type': 'bodhi_update', + 'testcase': 'update.install_default_update_netinst', + 'type': 'test-result-passed' + }, + ], 'unsatisfied_requirements': [] } mock_greenwave.return_value = greenwave_response @@ -99,7 +127,8 @@ def test_policies_pending_satisfied(self): assert update.test_gating_status == models.TestGatingStatus.passed expected_query = { - 'product_version': 'fedora-17', 'decision_context': 'bodhi_update_push_testing', + 'product_version': 'fedora-17', + 'decision_context': 'bodhi_update_push_testing_critpath', 'subject': [ {'item': 'bodhi-2.0-1.fc17', 'type': 'koji_build'}, {'item': 'FEDORA-{}-a3bbe1a8f2'.format(datetime.datetime.utcnow().year), @@ -110,25 +139,118 @@ def test_policies_pending_satisfied(self): expected_query) @patch.dict(config, [('greenwave_api_url', 'http://domain.local')]) - def test_policies_unsatisfied(self): - """Assert correct behavior when the policies enforced by Greenwave are unsatisfied""" + def test_policies_unsatisfied_waiting(self): + """Assert correct behavior when the policies enforced by Greenwave are unsatisfied: + results missing, no failures, less than two hours since update creation results + in 'waiting' status. + """ + update = self.db.query(models.Update).all()[0] + update.status = models.UpdateStatus.testing + update.critpath = True + # Clear pending messages + self.db.info['messages'] = [] + update.date_submitted = datetime.datetime.utcnow() + self.db.commit() + with patch('bodhi.server.models.util.greenwave_api_post') as mock_greenwave: + greenwave_response = { + 'policies_satisfied': False, + 'summary': '2 of 2 required test results missing', + 'applicable_policies': [ + 'kojibuild_bodhipush_no_requirements', + 'kojibuild_bodhipush_remoterule', + 'bodhiupdate_bodhipush_no_requirements', + 'bodhiupdate_bodhipush_openqa' + ], + 'satisfied_requirements': [], + 'unsatisfied_requirements': [ + { + 'item': { + 'item': 'FEDORA-{}-a3bbe1a8f2'.format(datetime.datetime.utcnow().year), + 'type': 'bodhi_update' + }, + 'scenario': 'fedora.updates-everything-boot-iso.x86_64.64bit', + 'subject_type': 'bodhi_update', + 'testcase': 'update.install_default_update_netinst', + 'type': 'test-result-missing' + }, + { + 'item': { + 'item': 'FEDORA-{}-a3bbe1a8f2'.format(datetime.datetime.utcnow().year), + 'type': 'bodhi_update' + }, + 'scenario': 'fedora.updates-everything-boot-iso.x86_64.uefi', + 'subject_type': 'bodhi_update', + 'testcase': 'update.install_default_update_netinst', + 'type': 'test-result-missing' + }, + ] + } + mock_greenwave.return_value = greenwave_response + check_policies_main() + update = self.db.query(models.Update).filter(models.Update.id == update.id).one() + assert update.test_gating_status == models.TestGatingStatus.waiting + # Check for the comment + expected_comment = "This update's test gating status has been changed to 'waiting'." + assert update.comments[-1].text == expected_comment + + expected_query = { + 'product_version': 'fedora-17', 'decision_context': 'bodhi_update_push_stable_critpath', + 'subject': [ + {'item': 'bodhi-2.0-1.fc17', 'type': 'koji_build'}, + {'item': 'FEDORA-{}-a3bbe1a8f2'.format(datetime.datetime.utcnow().year), + 'type': 'bodhi_update'}], + 'verbose': False + } + mock_greenwave.assert_called_once_with(config['greenwave_api_url'] + '/decision', + expected_query) + + @patch.dict(config, [('greenwave_api_url', 'http://domain.local')]) + def test_policies_unsatisfied_waiting_too_long(self): + """Assert correct behavior when the policies enforced by Greenwave are unsatisfied: + results missing, no failures, more than two hours since update modification results + in 'failed' status. + """ update = self.db.query(models.Update).all()[0] update.status = models.UpdateStatus.testing + update.critpath = True # Clear pending messages self.db.info['messages'] = [] + update.date_submitted = datetime.datetime.utcnow() - datetime.timedelta(days=1) self.db.commit() with patch('bodhi.server.models.util.greenwave_api_post') as mock_greenwave: greenwave_response = { 'policies_satisfied': False, - 'summary': '1 of 2 tests are failed', - 'applicable_policies': ['taskotron_release_critical_tasks'], + 'summary': '2 of 2 required test results missing', + 'applicable_policies': [ + 'kojibuild_bodhipush_no_requirements', + 'kojibuild_bodhipush_remoterule', + 'bodhiupdate_bodhipush_no_requirements', + 'bodhiupdate_bodhipush_openqa' + ], + 'satisfied_requirements': [], 'unsatisfied_requirements': [ - {'testcase': 'dist.rpmdeplint', - 'item': {'item': 'glibc-1.0-1.f26', 'type': 'koji_build'}, - 'type': 'test-result-missing', 'scenario': None}, - {'testcase': 'dist.rpmdeplint', - 'item': {'item': update.alias, 'type': 'bodhi_update'}, - 'type': 'test-result-missing', 'scenario': None}]} + { + 'item': { + 'item': 'FEDORA-{}-a3bbe1a8f2'.format(datetime.datetime.utcnow().year), + 'type': 'bodhi_update' + }, + 'scenario': 'fedora.updates-everything-boot-iso.x86_64.64bit', + 'subject_type': 'bodhi_update', + 'testcase': 'update.install_default_update_netinst', + 'type': 'test-result-missing' + }, + { + 'item': { + 'item': 'FEDORA-{}-a3bbe1a8f2'.format(datetime.datetime.utcnow().year), + 'type': 'bodhi_update' + }, + 'scenario': 'fedora.updates-everything-boot-iso.x86_64.uefi', + 'subject_type': 'bodhi_update', + 'testcase': 'update.install_default_update_netinst', + 'type': 'test-result-missing' + }, + ] + } mock_greenwave.return_value = greenwave_response check_policies_main() update = self.db.query(models.Update).filter(models.Update.id == update.id).one() @@ -138,7 +260,72 @@ def test_policies_unsatisfied(self): assert update.comments[-1].text == expected_comment expected_query = { - 'product_version': 'fedora-17', 'decision_context': 'bodhi_update_push_stable', + 'product_version': 'fedora-17', 'decision_context': 'bodhi_update_push_stable_critpath', + 'subject': [ + {'item': 'bodhi-2.0-1.fc17', 'type': 'koji_build'}, + {'item': 'FEDORA-{}-a3bbe1a8f2'.format(datetime.datetime.utcnow().year), + 'type': 'bodhi_update'}], + 'verbose': False + } + mock_greenwave.assert_called_once_with(config['greenwave_api_url'] + '/decision', + expected_query) + + @patch.dict(config, [('greenwave_api_url', 'http://domain.local')]) + def test_policies_unsatisfied_failed(self): + """Assert correct behavior when the policies enforced by Greenwave are unsatisfied: + failed tests always means failed status. + """ + update = self.db.query(models.Update).all()[0] + update.status = models.UpdateStatus.testing + update.critpath = True + update.date_submitted = datetime.datetime.utcnow() + # Clear pending messages + self.db.info['messages'] = [] + self.db.commit() + with patch('bodhi.server.models.util.greenwave_api_post') as mock_greenwave: + greenwave_response = { + 'policies_satisfied': False, + 'summary': '1 of 2 required tests failed, 1 result missing', + 'applicable_policies': [ + 'kojibuild_bodhipush_no_requirements', + 'kojibuild_bodhipush_remoterule', + 'bodhiupdate_bodhipush_no_requirements', + 'bodhiupdate_bodhipush_openqa' + ], + 'satisfied_requirements': [], + 'unsatisfied_requirements': [ + { + 'item': { + 'item': 'FEDORA-{}-a3bbe1a8f2'.format(datetime.datetime.utcnow().year), + 'type': 'bodhi_update' + }, + 'scenario': 'fedora.updates-everything-boot-iso.x86_64.64bit', + 'subject_type': 'bodhi_update', + 'testcase': 'update.install_default_update_netinst', + 'type': 'test-result-failed' + }, + { + 'item': { + 'item': 'FEDORA-{}-a3bbe1a8f2'.format(datetime.datetime.utcnow().year), + 'type': 'bodhi_update' + }, + 'scenario': 'fedora.updates-everything-boot-iso.x86_64.uefi', + 'subject_type': 'bodhi_update', + 'testcase': 'update.install_default_update_netinst', + 'type': 'test-result-missing' + }, + ] + } + mock_greenwave.return_value = greenwave_response + check_policies_main() + update = self.db.query(models.Update).filter(models.Update.id == update.id).one() + assert update.test_gating_status == models.TestGatingStatus.failed + # Check for the comment + expected_comment = "This update's test gating status has been changed to 'failed'." + assert update.comments[-1].text == expected_comment + + expected_query = { + 'product_version': 'fedora-17', 'decision_context': 'bodhi_update_push_stable_critpath', 'subject': [ {'item': 'bodhi-2.0-1.fc17', 'type': 'koji_build'}, {'item': 'FEDORA-{}-a3bbe1a8f2'.format(datetime.datetime.utcnow().year), @@ -187,13 +374,42 @@ def test_pushed_update(self): update.status = models.UpdateStatus.testing # Clear pending messages self.db.info['messages'] = [] + update.critpath = True update.pushed = True self.db.commit() with patch('bodhi.server.models.util.greenwave_api_post') as mock_greenwave: greenwave_response = { 'policies_satisfied': False, - 'summary': 'it broke', - 'applicable_policies': ['bodhi-unrestricted'], + 'summary': '1 of 2 required tests failed, 1 result missing', + 'applicable_policies': [ + 'kojibuild_bodhipush_no_requirements', + 'kojibuild_bodhipush_remoterule', + 'bodhiupdate_bodhipush_no_requirements', + 'bodhiupdate_bodhipush_openqa' + ], + 'satisfied_requirements': [], + 'unsatisfied_requirements': [ + { + 'item': { + 'item': 'FEDORA-{}-a3bbe1a8f2'.format(datetime.datetime.utcnow().year), + 'type': 'bodhi_update' + }, + 'scenario': 'fedora.updates-everything-boot-iso.x86_64.64bit', + 'subject_type': 'bodhi_update', + 'testcase': 'update.install_default_update_netinst', + 'type': 'test-result-failed' + }, + { + 'item': { + 'item': 'FEDORA-{}-a3bbe1a8f2'.format(datetime.datetime.utcnow().year), + 'type': 'bodhi_update' + }, + 'scenario': 'fedora.updates-everything-boot-iso.x86_64.uefi', + 'subject_type': 'bodhi_update', + 'testcase': 'update.install_default_update_netinst', + 'type': 'test-result-missing' + }, + ] } mock_greenwave.return_value = greenwave_response @@ -202,7 +418,7 @@ def test_pushed_update(self): update = self.db.query(models.Update).filter(models.Update.id == update.id).one() assert update.test_gating_status == models.TestGatingStatus.failed expected_query = { - 'product_version': 'fedora-17', 'decision_context': 'bodhi_update_push_stable', + 'product_version': 'fedora-17', 'decision_context': 'bodhi_update_push_stable_critpath', 'subject': [{'item': 'bodhi-2.0-1.fc17', 'type': 'koji_build'}, {'item': 'FEDORA-{}-a3bbe1a8f2'.format(datetime.datetime.utcnow().year), 'type': 'bodhi_update'}], @@ -226,7 +442,13 @@ def test_unrestricted_policy(self): greenwave_response = { 'policies_satisfied': True, 'summary': 'no tests are required', - 'applicable_policies': ['bodhi-unrestricted'], + 'applicable_policies': [ + 'kojibuild_bodhipush_no_requirements', + 'kojibuild_bodhipush_remoterule', + 'bodhiupdate_bodhipush_no_requirements' + ], + 'satisfied_requirements': [], + 'unsatisfied_requirements': [], } mock_greenwave.return_value = greenwave_response check_policies_main() diff --git a/bodhi/tests/server/test_models.py b/bodhi/tests/server/test_models.py index b612b1f29c..1cf5b9ca10 100644 --- a/bodhi/tests/server/test_models.py +++ b/bodhi/tests/server/test_models.py @@ -1989,10 +1989,10 @@ def test_gating_required_false(self): 'unsatisfied_requirements': [ {'testcase': 'dist.rpmdeplint', 'item': {'item': 'bodhi-2.0-1.fc17', 'type': 'koji_build'}, - 'type': 'test-result-missing', 'scenario': None}, + 'type': 'test-result-failed', 'scenario': None}, {'testcase': 'dist.rpmdeplint', 'item': {'item': update.alias, 'type': 'bodhi_update'}, - 'type': 'test-result-missing', 'scenario': None}]} + 'type': 'test-result-failed', 'scenario': None}]} mock_greenwave.return_value = greenwave_response model.Update.edit(request, data) @@ -2019,10 +2019,10 @@ def test_gating_required_true(self): 'unsatisfied_requirements': [ {'testcase': 'dist.rpmdeplint', 'item': {'item': 'bodhi-2.0-1.fc17', 'type': 'koji_build'}, - 'type': 'test-result-missing', 'scenario': None}, + 'type': 'test-result-failed', 'scenario': None}, {'testcase': 'dist.rpmdeplint', 'item': {'item': update.alias, 'type': 'bodhi_update'}, - 'type': 'test-result-missing', 'scenario': None}]} + 'type': 'test-result-failed', 'scenario': None}]} mock_greenwave.return_value = greenwave_response model.Update.edit(request, data) @@ -2055,10 +2055,10 @@ def test_rawhide_update_edit_move_to_testing(self): 'unsatisfied_requirements': [ {'testcase': 'dist.rpmdeplint', 'item': {'item': 'bodhi-2.0-1.fc17', 'type': 'koji_build'}, - 'type': 'test-result-missing', 'scenario': None}, + 'type': 'test-result-failed', 'scenario': None}, {'testcase': 'dist.rpmdeplint', 'item': {'item': update.alias, 'type': 'bodhi_update'}, - 'type': 'test-result-missing', 'scenario': None}]} + 'type': 'test-result-failed', 'scenario': None}]} mock_greenwave.return_value = greenwave_response model.Update.edit(request, data) @@ -2091,10 +2091,10 @@ def test_rawhide_update_edit_stays_pending(self): 'unsatisfied_requirements': [ {'testcase': 'dist.rpmdeplint', 'item': {'item': 'bodhi-2.0-1.fc17', 'type': 'koji_build'}, - 'type': 'test-result-missing', 'scenario': None}, + 'type': 'test-result-failed', 'scenario': None}, {'testcase': 'dist.rpmdeplint', 'item': {'item': update.alias, 'type': 'bodhi_update'}, - 'type': 'test-result-missing', 'scenario': None}]} + 'type': 'test-result-failed', 'scenario': None}]} mock_greenwave.return_value = greenwave_response model.Update.edit(request, data) @@ -2127,10 +2127,10 @@ def test_not_rawhide_update_signed_stays_pending(self): 'unsatisfied_requirements': [ {'testcase': 'dist.rpmdeplint', 'item': {'item': 'bodhi-2.0-1.fc17', 'type': 'koji_build'}, - 'type': 'test-result-missing', 'scenario': None}, + 'type': 'test-result-failed', 'scenario': None}, {'testcase': 'dist.rpmdeplint', 'item': {'item': update.alias, 'type': 'bodhi_update'}, - 'type': 'test-result-missing', 'scenario': None}]} + 'type': 'test-result-failed', 'scenario': None}]} mock_greenwave.return_value = greenwave_response model.Update.edit(request, data) @@ -3801,10 +3801,10 @@ def test_set_request_pending_testing_gating_false(self): 'unsatisfied_requirements': [ {'testcase': 'dist.rpmdeplint', 'item': {'item': 'bodhi-2.0-1.fc17', 'type': 'koji_build'}, - 'type': 'test-result-missing', 'scenario': None}, + 'type': 'test-result-failed', 'scenario': None}, {'testcase': 'dist.rpmdeplint', 'item': {'item': self.obj.alias, 'type': 'bodhi_update'}, - 'type': 'test-result-missing', 'scenario': None}]} + 'type': 'test-result-failed', 'scenario': None}]} mock_greenwave.return_value = greenwave_response with mock_sends(Message): self.obj.set_request(self.db, UpdateRequest.testing, req.user.name) @@ -3830,10 +3830,10 @@ def test_set_request_pending_testing_gating_true(self): 'unsatisfied_requirements': [ {'testcase': 'dist.rpmdeplint', 'item': {'item': 'bodhi-2.0-1.fc17', 'type': 'koji_build'}, - 'type': 'test-result-missing', 'scenario': None}, + 'type': 'test-result-failed', 'scenario': None}, {'testcase': 'dist.rpmdeplint', 'item': {'item': self.obj.alias, 'type': 'bodhi_update'}, - 'type': 'test-result-missing', 'scenario': None}]} + 'type': 'test-result-failed', 'scenario': None}]} mock_greenwave.return_value = greenwave_response with mock_sends(Message): self.obj.set_request(self.db, UpdateRequest.testing, req.user.name)