From 8d93de5708eb5b2100cd97ab078d56c29ee256e8 Mon Sep 17 00:00:00 2001 From: Varsha Rao Date: Wed, 19 Aug 2020 17:02:58 +0530 Subject: [PATCH] teuthology-suite: Check the priority of jobs to be run Check if the passed testing priority is according to the range mentioned in developer guide[1]. This patch also adds '--force-priority' flag which allows to skip the priority check. [1] https://docs.ceph.com/docs/master/dev/developer_guide/tests-integration-tests/#testing-priority Signed-off-by: Varsha Rao --- scripts/suite.py | 1 + teuthology/suite/run.py | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/scripts/suite.py b/scripts/suite.py index 0de7be36e8..98f7448111 100644 --- a/scripts/suite.py +++ b/scripts/suite.py @@ -168,6 +168,7 @@ Scheduler arguments: with --rerun argument. This number can be found in the output of teuthology-suite command. -1 for a random seed [default: -1]. + --force-priority Skip the priority check. """.format( default_machine_type=config.default_machine_type, diff --git a/teuthology/suite/run.py b/teuthology/suite/run.py index 73f7b13448..b84a6312b0 100644 --- a/teuthology/suite/run.py +++ b/teuthology/suite/run.py @@ -501,6 +501,22 @@ class Run(object): log.info("pause between jobs : --throttle " + str(throttle)) time.sleep(int(throttle)) + def check_priority(self, jobs_to_schedule): + priority = self.args.priority + msg='''Use the following testing priority +10 to 49: Tests which are urgent and blocking other important development. +50 to 74: Testing a particular feature/fix with less than 25 jobs and can also be used for urgent release testing. +75 to 99: Tech Leads usually schedule integration tests with this priority to verify pull requests against master. +100 to 149: QE validation of point releases. +150 to 199: Testing a particular feature/fix with less than 100 jobs and results will be available in a day or so. +200 to 1000: Large test runs that can be done over the course of a week. +Note: To force run, use --force-priority''' + if priority < 50: + util.schedule_fail(msg) + elif priority < 75 and jobs_to_schedule > 25: + util.schedule_fail(msg) + elif priority < 150 and jobs_to_schedule > 100: + util.schedule_fail(msg) def schedule_suite(self): """ @@ -614,6 +630,10 @@ class Run(object): if jobs_to_schedule: self.write_rerun_memo() + # Before scheduling jobs, check the priority + if self.args.priority and jobs_to_schedule and not self.args.force_priority: + self.check_priority(len(jobs_to_schedule)) + self.schedule_jobs(jobs_missing_packages, jobs_to_schedule, name) os.remove(base_yaml_path) -- 2.39.5