]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
teuthology-suite: Check the priority of jobs to be run 1550/head
authorVarsha Rao <varao@redhat.com>
Wed, 19 Aug 2020 11:32:58 +0000 (17:02 +0530)
committerVarsha Rao <varao@redhat.com>
Mon, 24 Aug 2020 07:59:20 +0000 (13:29 +0530)
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 <varao@redhat.com>
scripts/suite.py
teuthology/suite/run.py

index 0de7be36e87cb20576640ba16686260f3a47f285..98f74481114d2ae08cfc9029efe2b3ddeb536f65 100644 (file)
@@ -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,
index 73f7b134489bfb859187c4cc2dad88425b08489d..b84a6312b05ea8a41e4aa95ee47f4a3a3abbb981 100644 (file)
@@ -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)