From 0d310105189394c56d8caea16dc335f10725eb6a Mon Sep 17 00:00:00 2001 From: Giulia Naponiello Date: Apr 24 2018 15:42:58 +0000 Subject: Comment required to create a waiver Comment should be a required argument when creating a new waiver. So let's change the functional tests to make the comment required. --- diff --git a/functional-tests/conftest.py b/functional-tests/conftest.py index 3d3f648..0607c08 100644 --- a/functional-tests/conftest.py +++ b/functional-tests/conftest.py @@ -223,12 +223,13 @@ class TestDataBuilder(object): response.raise_for_status() return response.json() - def create_waiver(self, result, product_version, waived=True): + def create_waiver(self, result, product_version, comment, waived=True): data = { 'subject': result['subject'], 'testcase': result['testcase'], 'product_version': product_version, 'waived': waived, + 'comment': comment } # We assume WaiverDB is configured with # AUTH_METHOD = 'dummy' to accept Basic with any credentials. diff --git a/functional-tests/consumers/test_waiverdb.py b/functional-tests/consumers/test_waiverdb.py index 7d0a7f3..b49761a 100644 --- a/functional-tests/consumers/test_waiverdb.py +++ b/functional-tests/consumers/test_waiverdb.py @@ -31,7 +31,7 @@ def test_consume_new_waiver( testcase = str(result['testcase']['name']) waiver = testdatabuilder.create_waiver(result={ "subject": dict([(str(key), str(value[0])) for key, value in result['data'].items()]), - "testcase": testcase}, product_version='fedora-26') + "testcase": testcase}, product_version='fedora-26', comment='Because I said so') message = { 'body': { 'topic': 'waiver.new', diff --git a/functional-tests/test_api_v1.py b/functional-tests/test_api_v1.py index 495917f..b2e2291 100644 --- a/functional-tests/test_api_v1.py +++ b/functional-tests/test_api_v1.py @@ -255,7 +255,8 @@ def test_make_a_decison_on_failed_result_with_waiver( outcome='FAILED') waiver = testdatabuilder.create_waiver(result={ # noqa "subject": dict([(key, value[0]) for key, value in result['data'].items()]), - "testcase": all_rpmdiff_testcase_names[0]}, product_version='rhel-7') + "testcase": all_rpmdiff_testcase_names[0]}, product_version='rhel-7', + comment='This is fine') # The rest passed for testcase_name in all_rpmdiff_testcase_names[1:]: testdatabuilder.create_result(item=nvr, @@ -561,7 +562,8 @@ def test_ignore_waiver(requests_session, greenwave_server, testdatabuilder): outcome='FAILED') waiver = testdatabuilder.create_waiver(result={ "subject": dict([(key, value[0]) for key, value in result['data'].items()]), - "testcase": all_rpmdiff_testcase_names[0]}, product_version='rhel-7') + "testcase": all_rpmdiff_testcase_names[0]}, product_version='rhel-7', + comment='This is fine') # The rest passed for testcase_name in all_rpmdiff_testcase_names[1:]: testdatabuilder.create_result(item=nvr,