From 2dc23f63f42fa3fdf35a1add43b2e6799f5569a9 Mon Sep 17 00:00:00 2001 From: Mattia Verga Date: Fri, 22 Nov 2024 08:00:19 +0100 Subject: [PATCH] Add testing requirements to Release json representation Signed-off-by: Mattia Verga --- bodhi-server/bodhi/server/models.py | 3 ++- devel/ci/integration/tests/test_bodhi.py | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/bodhi-server/bodhi/server/models.py b/bodhi-server/bodhi/server/models.py index 54742627e3..2572e04103 100644 --- a/bodhi-server/bodhi/server/models.py +++ b/bodhi-server/bodhi/server/models.py @@ -880,7 +880,8 @@ class Release(Base): __tablename__ = 'releases' __exclude_columns__ = ('id', 'builds', 'composes') - __include_extras__ = ('setting_status', ) + __include_extras__ = ('critpath_mandatory_days_in_testing', 'mandatory_days_in_testing', + 'critpath_min_karma', 'min_karma', 'setting_status', ) __get_by__ = ('name', 'long_name', 'dist_tag') name = Column(Unicode(10), unique=True, nullable=False) diff --git a/devel/ci/integration/tests/test_bodhi.py b/devel/ci/integration/tests/test_bodhi.py index c6e062e935..63b13f13f6 100644 --- a/devel/ci/integration/tests/test_bodhi.py +++ b/devel/ci/integration/tests/test_bodhi.py @@ -1127,8 +1127,15 @@ def test_get_compose_json(bodhi_container, db_container): compose['content_type'] = updates[0]['builds'][0]['content_type'] else: compose['content_type'] = None - # We can't get this from db + # We can't get these from db release['setting_status'] = http_response.json()['compose']['release']['setting_status'] + release['min_karma'] = http_response.json()['compose']['release']['min_karma'] + release['critpath_min_karma'] = \ + http_response.json()['compose']['release']['critpath_min_karma'] + release['mandatory_days_in_testing'] = \ + http_response.json()['compose']['release']['mandatory_days_in_testing'] + release['critpath_mandatory_days_in_testing'] = \ + http_response.json()['compose']['release']['critpath_mandatory_days_in_testing'] compose['release'] = release compose['update_summary'] = []