From 74f5f48f61a5ee5b4ee4dcc8df0a4ace788a6dfc Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: May 03 2023 19:10:27 +0000 Subject: Drop special handling for updates and updates-testing composes These have not had images in them for years, so we don't need to do any special handling for them any more. Signed-off-by: Adam Williamson --- diff --git a/src/fedora_openqa/report.py b/src/fedora_openqa/report.py index e1e3f29..5c19d6f 100644 --- a/src/fedora_openqa/report.py +++ b/src/fedora_openqa/report.py @@ -478,10 +478,6 @@ def resultsdb_report(resultsdb_url=None, jobs=None, build=None, do_report=True, # special case for images decompressed for testing if job['settings']['IMAGETYPE'] == 'raw-xz' and imagename.endswith('.raw'): imagename += '.xz' - # reverse the hack we use in schedule.py to stuff 'testing-' on - # the front of image names in updates-testing composes - if imagename.startswith('testing-'): - imagename = imagename[8:] if job["settings"].get("SUBVARIANT", "").lower() == "coreos": rdbpartial = partial( FedoraCoreOSImageResult, diff --git a/src/fedora_openqa/schedule.py b/src/fedora_openqa/schedule.py index cb8618f..f75a6f3 100644 --- a/src/fedora_openqa/schedule.py +++ b/src/fedora_openqa/schedule.py @@ -136,14 +136,6 @@ def _get_images(rel, wanted=None): param_urls = { FORMAT_TO_PARAM[foundimg['format']]: url } - if 'updates-testing' in rel.cid: - # image names in 'updates-testing' and 'updates' composes - # are the same. we need to set a custom filename for the - # image for updates-testing composes to avoid a clash - fileparam = FORMAT_TO_PARAM[foundimg['format']].split('_URL')[0] - filename = os.path.basename(foundimg['path']) - param_urls[fileparam] = 'testing-' + filename - images.append((flavor, arch, score, param_urls, subvariant, imagetype)) return images @@ -415,20 +407,18 @@ def jobs_from_compose(location, wanted=None, force=False, extraparams=None, open extraparams=extraparams, openqa_hostname=openqa_hostname, label=rel.label)) - # if we scheduled any jobs, and this is a candidate compose, tag - # this build as 'important' + # if we scheduled any jobs, and this is a Fedora candidate compose, + # tag this build as 'important' # this prevents its jobs being obsoleted if a nightly compose shows # up while they're running, and prevents it being garbage-collected # don't do this for post-release nightlies that are *always* # candidates, though # using getattr as the 'respin' composes don't have these attrs - if getattr(rel, 'type', '') == 'production' and getattr(rel, 'product', '') == 'Fedora': - # we don't want to tag all updates / updates-testing composes - if 'updates' not in getattr(rel, 'milestone', '').lower() and jobs: - client = OpenQA_Client(openqa_hostname) - # we expect group 1 to be 'fedora'. I think this is reliable. - params = {'text': "tag:{0}:important:candidate".format(rel.cid)} - client.openqa_request('POST', 'groups/1/comments', params=params) + if getattr(rel, 'type', '') == 'production' and getattr(rel, 'product', '') == 'Fedora' and jobs: + client = OpenQA_Client(openqa_hostname) + # we expect group 1 to be 'fedora'. I think this is reliable. + params = {'text': "tag:{0}:important:candidate".format(rel.cid)} + client.openqa_request('POST', 'groups/1/comments', params=params) return (rel.cid, jobs) diff --git a/tests/test_report.py b/tests/test_report.py index a9afae2..6c00786 100644 --- a/tests/test_report.py +++ b/tests/test_report.py @@ -633,15 +633,6 @@ class TestResultsDBReport: fosreport.resultsdb_report(jobs=[1]) assert fakeres.call_count == 0 - def test_updates_testing(self, fakeres, oqaclientmock): - """Check we strip the 'testing-' that we add to the asset file - name for updates-testing images before reporting results. - """ - jobdict = oqaclientmock[2] - with mock.patch.dict(jobdict['settings'], {'ISO': 'testing-Fedora-Server-dvd-x86_64-Rawhide-20170207.n.0.iso'}): - fosreport.resultsdb_report(jobs=[1]) - assert fakeres.call_args[1]['item'] == 'Fedora-Server-dvd-x86_64-Rawhide-20170207.n.0.iso' - def test_note(self, fakeres, oqaclientmock): """Check resultsdb_report adds a note for failed modules.""" jobdict = oqaclientmock[2] diff --git a/tests/test_schedule.py b/tests/test_schedule.py index 95fdb44..ceefca6 100644 --- a/tests/test_schedule.py +++ b/tests/test_schedule.py @@ -325,28 +325,6 @@ class TestGetImages: ), ] - @mock.patch.object(fedfind.release.RawhideNightly, 'cid', 'Fedora-Rawhide-updates-testing-20230502.n.0') - def test_update_testing(self): - """Test that the image file name munging for updates-testing - composes works. Image file names for updates-testing and - updates composes with the same date, version and respin are - identical; we need to rename the images from one of the - composes so they don't overwrite each other in the openQA - asset directories. - """ - # we don't use cid here to avoid the sanity check failing - rel = fedfind.release.get_release('Rawhide', '', '20230502.n.0') - # let's just check the mocking is working as expected... - assert rel.cid == 'Fedora-Rawhide-updates-testing-20230502.n.0' - # this is to ensure we actually check *something* - count = 0 - ret = schedule._get_images(rel) - for (_, _, _, param_urls, _, _) in ret: - if 'ISO_URL' in param_urls: - assert param_urls.get('ISO', '').startswith('testing-') - count += 1 - assert count > 0 - def test_find_duplicate_jobs(): """Tests for _find_duplicate_jobs."""