From 3768cd4bad370adeb4b5ff6dd02f52c663a98960 Mon Sep 17 00:00:00 2001 From: Michel Normand Date: May 25 2021 10:08:57 +0000 Subject: New 'not_scheduled_events' list in [consumer_config] To be able to not schedule openQA tests for some fedmsg events. default is an empty list. Note the specific flow to ignore update restriction for compose message Required to be able to handle AtomicHosts related messages now reported as "Fedora-29-updates-" or "Fedora-29-updates-testing-" compose msg. Signed-off-by: Michel Normand --- diff --git a/sample-configs/fedora_openqa_scheduler.stg.toml b/sample-configs/fedora_openqa_scheduler.stg.toml index 521e299..02a5a50 100644 --- a/sample-configs/fedora_openqa_scheduler.stg.toml +++ b/sample-configs/fedora_openqa_scheduler.stg.toml @@ -61,6 +61,9 @@ routing_keys = ["org.fedoraproject.prod.pungi.compose.status.change", openqa_hostname = "openqa.stg.fedoraproject.org" # arches to schedule update tests for update_arches = ["x86_64", "ppc64le"] +# list of fedmsg events to not schedule openQA tests. +#not_scheduled_events = "update, Fedora-Cloud, Fedora-Modular, Fedora-Atomic, Fedora-Docker, Fedora-Rawhide" +not_scheduled_events = "" [qos] prefetch_size = 0 diff --git a/sample-configs/fedora_openqa_scheduler.toml b/sample-configs/fedora_openqa_scheduler.toml index 093e622..0437a88 100644 --- a/sample-configs/fedora_openqa_scheduler.toml +++ b/sample-configs/fedora_openqa_scheduler.toml @@ -55,6 +55,9 @@ routing_keys = ["org.fedoraproject.prod.pungi.compose.status.change", openqa_hostname = "openqa.fedoraproject.org" # arches to schedule update tests for update_arches = ["x86_64"] +# list of fedmsg events to not schedule openQA tests. +#not_scheduled_events = "update, Fedora-Cloud, Fedora-Modular, Fedora-Atomic, Fedora-Docker, Fedora-Rawhide" +not_scheduled_events = "" [qos] prefetch_size = 0 diff --git a/src/fedora_openqa/consumer.py b/src/fedora_openqa/consumer.py index 3f18b30..41dfef5 100755 --- a/src/fedora_openqa/consumer.py +++ b/src/fedora_openqa/consumer.py @@ -59,6 +59,11 @@ class OpenQAScheduler(object): self.update_arches = fedora_messaging.config.conf["consumer_config"]["update_arches"] self.logger = logging.getLogger(self.__class__.__name__) + strcomp = fedora_messaging.config.conf["consumer_config"]["not_scheduled_events"] + if strcomp: + strcomp = strcomp.replace(' ','').split(',') + self.openqa_not_scheduled_events = strcomp + def __call__(self, message): """Consume incoming message.""" if 'pungi' in message.topic: @@ -78,6 +83,15 @@ class OpenQAScheduler(object): self.logger.info("Not scheduling jobs for modular compose %s", compstr) return + for compname in self.openqa_not_scheduled_events: + if compname in compstr: + if compname == 'update': + # ignore update restriction specific for update type message. + continue + self.logger.warning("Not scheduling jobs for {0} compose " + "{1}".format(compname, compstr)) + return + if 'FINISHED' in status and location: # We have a complete pungi4 compose self.logger.info("Scheduling openQA jobs for compose %s", compstr) @@ -112,6 +126,11 @@ class OpenQAScheduler(object): # to None, means 'run all tests'. flavors = [] + if 'update' in self.openqa_not_scheduled_events: + self.logger.warning("Not scheduling jobs for update event " + "{0}".format(advisory)) + return + # if update is critpath, always run all update tests if critpath and advisory and version and idpref == 'FEDORA': self.logger.info("Scheduling openQA jobs for critical path update %s", advisory)