From 01a8b2a78f84d20de2d48c30ef353916135f21ef Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Jun 15 2020 19:00:00 +0000 Subject: Inclusive language: remove all references to a 'whitelist' Refer to it instead as a 'test list' or just the 'list' (which list is obvious from context in these cases). Also drop the 'modified' list we use in the tests as we don't need it any more, the real default list has all the necessary cases for testing. Signed-off-by: Adam Williamson --- diff --git a/src/fedora_openqa/config.py b/src/fedora_openqa/config.py index 8dc3c7e..e527398 100644 --- a/src/fedora_openqa/config.py +++ b/src/fedora_openqa/config.py @@ -122,11 +122,11 @@ WANTED = [ }, ] -# Whitelist of non-critpath package names to run update tests on. +# List of non-critpath package names to run update tests on. # Dict keys are the package names, value is either an iterable of the # flavor(s) of update tests to run for that package or can just be # None (or anything else false-y) which means "run all the flavors". -UPDATEWL = { +UPDATETL = { # FreeIPA-related bits '389-ds': ('server', 'server-upgrade'), '389-ds-base': ('server', 'server-upgrade'), @@ -179,10 +179,10 @@ for path in ('/etc/fedora-openqa', pass try: - # load UPDATEWL override config file - fname = '{0}/updatewl.json'.format(path) + # load UPDATETL override config file + fname = '{0}/updatetl.json'.format(path) with open(fname, 'r') as fout: - UPDATEWL = json.load(fout) + UPDATETL = json.load(fout) except IOError: # file not found pass diff --git a/src/fedora_openqa/consumer.py b/src/fedora_openqa/consumer.py index 11d6ed1..3f18b30 100755 --- a/src/fedora_openqa/consumer.py +++ b/src/fedora_openqa/consumer.py @@ -28,7 +28,7 @@ import logging import fedora_messaging.config # internal imports -from .config import UPDATEWL +from .config import UPDATETL from . import schedule from . import report @@ -117,32 +117,34 @@ class OpenQAScheduler(object): self.logger.info("Scheduling openQA jobs for critical path update %s", advisory) flavors = None - # otherwise check the whitelist + # otherwise check the list of non-critpath packages we test elif advisory and version and idpref == 'FEDORA': - self.logger.debug("Checking whitelist for update %s", advisory) + self.logger.debug("Checking non-critpath test list for update %s", advisory) for build in update.get('builds', []): # get just the package name by splitting the NVR. This # assumes all NVRs actually contain a V and an R. # Happily, RPM rejects dashes in version or release. pkgname = build['nvr'].rsplit('-', 2)[0] - # now check the whitelist and adjust flavors - if pkgname in UPDATEWL: - if not UPDATEWL[pkgname]: + # now check the list and adjust flavors + if pkgname in UPDATETL: + if not UPDATETL[pkgname]: # this means *all* flavors, and we can short - self.logger.info("Running ALL openQA tests for whitelisted update %s", advisory) + self.logger.info("Running ALL openQA tests for update %s", advisory) flavors = None break else: - flavors.extend(UPDATEWL[pkgname]) + flavors.extend(UPDATETL[pkgname]) if flavors: + # let's remove dupes + flavors = set(flavors) # this means we have a list of flavors, not None indicating # *all* flavors, let's log that - tmpl = "Running update tests for flavors %s for whitelisted update %s" + tmpl = "Running update tests for flavors %s for update %s" self.logger.info(tmpl, ', '.join(flavors), advisory) elif flavors == []: # This means we ain't running nothin' - self.logger.debug("Update is not critical path and no packages in whitelist, no jobs scheduled") + self.logger.debug("Update is not critical path and no packages in test list, no jobs scheduled") return # Finally, now we've decided on flavors, run the jobs. flavors diff --git a/src/fedora_openqa/schedule.py b/src/fedora_openqa/schedule.py index e0d68cc..9cb2a80 100644 --- a/src/fedora_openqa/schedule.py +++ b/src/fedora_openqa/schedule.py @@ -379,7 +379,7 @@ def jobs_from_update(update, version, flavors=None, force=False, extraparams=Non """Schedule jobs for a specific Fedora update (or scratch build). update is the advisory ID or task ID, version is the release number, flavors defines which update tests should be run (valid - values arethe 'flavdict' keys). force, extraparams and + values are the 'flavdict' keys). force, extraparams and openqa_hostname are as for jobs_from_compose. To explain the HDD_1 and START_AFTER_TEST settings: most tests in the 'update' scenario are shared with the 'compose' scenario. Many of them specify diff --git a/tests/test_consumers.py b/tests/test_consumers.py index 6a6c27f..be1e1db 100644 --- a/tests/test_consumers.py +++ b/tests/test_consumers.py @@ -35,15 +35,6 @@ import pytest # 'internal' imports import fedora_openqa.consumer -from fedora_openqa.config import UPDATEWL - -# Modified version of the default UPDATEWL for testing purposes -# we have to do this because we don't have any real-world cases -# for whitelisting anything but the 'server' tests yet, so we can't -# fully test the feature with the real default whitelist -MODIFIEDWL = copy.deepcopy(UPDATEWL) -MODIFIEDWL['gnome-terminal'] = ('workstation',) -MODIFIEDWL['kernel'] = None # Passed test message (ZMQ->AMQP bridge style with whole fedmsg as # 'body') @@ -138,14 +129,14 @@ CRITPATHCREATE = Message( } ) -# Non-critpath, non-whitelisted update creation message +# Non-critpath, non-listed update creation message NONCRITCREATE = copy.deepcopy(CRITPATHCREATE) NONCRITCREATE.body['update']['critpath'] = False -# Non-critpath, one-flavor-whitelisted update creation message -WLCREATE = copy.deepcopy(CRITPATHCREATE) -WLCREATE.body['update']['critpath'] = False -WLCREATE.body['update']['builds'] = [{"epoch": 0, "nvr": "freeipa-4.4.4-1.fc24", "signed": False}] +# Non-critpath, one-flavor-listed update creation message +TLCREATE = copy.deepcopy(CRITPATHCREATE) +TLCREATE.body['update']['critpath'] = False +TLCREATE.body['update']['builds'] = [{"epoch": 0, "nvr": "freeipa-4.4.4-1.fc24", "signed": False}] # Critpath EPEL update creation message EPELCREATE = copy.deepcopy(CRITPATHCREATE) @@ -171,22 +162,22 @@ CRITPATHEDIT = Message( } ) -# Non-critpath, non-whitelisted update edit message +# Non-critpath, non-listed update edit message NONCRITEDIT = copy.deepcopy(CRITPATHEDIT) NONCRITEDIT.body['update']['critpath'] = False -# Non-critpath, two-flavors-whitelisted update edit message -WLEDIT = copy.deepcopy(CRITPATHEDIT) -WLEDIT.body['update']['critpath'] = False -WLEDIT.body['update']['builds'] = [ +# Non-critpath, two-flavors-listed update edit message +TLEDIT = copy.deepcopy(CRITPATHEDIT) +TLEDIT.body['update']['critpath'] = False +TLEDIT.body['update']['builds'] = [ {"epoch": 0, "nvr": "freeipa-4.4.4-1.fc26", "signed": False}, - {"epoch": 0, "nvr": "gnome-terminal-3.24.1-1.fc24", "signed": False}, + {"epoch": 0, "nvr": "gnome-initial-setup-3.24.1-1.fc24", "signed": False}, ] -# Non-critpath, all-flavors-whitelisted update edit message -WLALLEDIT = copy.deepcopy(CRITPATHEDIT) -WLALLEDIT.body['update']['critpath'] = False -WLALLEDIT.body['update']['builds'] = [{"epoch": 0, "nvr": "kernel-4.10.12-100.fc24", "signed": False}] +# Non-critpath, all-flavors-listed update edit message +TLALLEDIT = copy.deepcopy(CRITPATHEDIT) +TLALLEDIT.body['update']['critpath'] = False +TLALLEDIT.body['update']['builds'] = [{"epoch": 0, "nvr": "authselect-4.10.12-100.fc24", "signed": False}] # Critpath EPEL update edit message EPELEDIT = copy.deepcopy(CRITPATHEDIT) @@ -247,7 +238,6 @@ TESTS = (TESTWIKI, TESTRDB) class TestConsumers: """Tests for the consumers.""" - @mock.patch('fedora_openqa.consumer.UPDATEWL', MODIFIEDWL) @mock.patch('fedora_openqa.schedule.jobs_from_compose', return_value=('somecompose', [1]), autospec=True) @mock.patch('fedora_openqa.schedule.jobs_from_update', return_value=[1], autospec=True) @pytest.mark.parametrize( @@ -278,13 +268,13 @@ class TestConsumers: (NONCRITEDIT, False), (EPELCREATE, False), (EPELEDIT, False), - # WLCREATE contains only a 'server'-whitelisted package - (WLCREATE, ['server', 'server-upgrade']), - # WLEDIT contains both 'server' and 'workstation'-whitelisted + # TLCREATE contains only a 'server'-listed package + (TLCREATE, {'server', 'server-upgrade'}), + # TLEDIT contains both 'server' and 'workstation-live-iso'-listed # packages - (WLEDIT, ['server', 'server-upgrade', 'workstation']), - # WLALLEDIT contains an 'all flavors'-whitelisted package - (WLALLEDIT, None), + (TLEDIT, {'server', 'server-upgrade', 'workstation-live-iso'}), + # TLALLEDIT contains an 'all flavors'-listed package + (TLALLEDIT, None), ] ) def test_scheduler(self, fake_update, fake_schedule, consumer, oqah, message, flavors):