]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
Add filter and filter-off suite options. 309/head
authorWarren Usui <warren.usui@inktank.com>
Tue, 19 Aug 2014 03:47:07 +0000 (20:47 -0700)
committerWarren Usui <warren.usui@inktank.com>
Tue, 19 Aug 2014 03:55:01 +0000 (20:55 -0700)
Filter only runs suite jobs that contain the text passed as part of
their description or in the names of the composite set of yaml files.
Filter-off only runs suite jobs that do not contain the text passed
as either their description or in the names of the composite set of
yaml files.
Fixes: 8954
Signed-off-by: Warren Usui <warren.usui@inktank.com>
scripts/suite.py
teuthology/suite.py

index fc5db4fa603939046f0677e5561f724b26d4564e..ec743751f25be5cf7476726dcf629c4033d2de70 100644 (file)
@@ -65,6 +65,8 @@ Scheduler arguments:
   --timeout <timeout>         How long, in seconds, to wait for jobs to finish
                               before sending email. This does not kill jobs.
                               [default: 32400]
+  --filter <string>           Only run jobs containing the string specified.
+  --filter-out <string>       Do not run jobs containing the string specified.
 
 """
 
index 5b531f240e82fcbd97e3f2dd7154a73641512238..31ed4fbb70fb19eee70ddb54b297d54032ba4a32 100644 (file)
@@ -50,6 +50,8 @@ def main(args):
     if email:
         config.results_email = email
     timeout = args['--timeout']
+    filter_in = args['--filter']
+    filter_out = args['--filter-out']
 
     name = make_run_name(suite, ceph_branch, kernel_branch, kernel_flavor,
                          machine_type)
@@ -83,6 +85,8 @@ def main(args):
                          timeout=timeout,
                          dry_run=dry_run,
                          verbose=verbose,
+                         filter_in=filter_in,
+                         filter_out=filter_out,
                          )
     os.remove(base_yaml_path)
 
@@ -224,7 +228,8 @@ def create_initial_config(suite, suite_branch, ceph_branch, teuthology_branch,
 
 
 def prepare_and_schedule(job_config, suite_repo_path, base_yaml_paths, limit,
-                         num, timeout, dry_run, verbose):
+                         num, timeout, dry_run, verbose,
+                         filter_in, filter_out):
     """
     Puts together some "base arguments" with which to execute
     teuthology-schedule for each job, then passes them and other parameters to
@@ -263,6 +268,8 @@ def prepare_and_schedule(job_config, suite_repo_path, base_yaml_paths, limit,
         arch=arch,
         limit=limit,
         dry_run=dry_run,
+        filter_in=filter_in,
+        filter_out=filter_out,
         )
 
     if job_config.email and num_jobs:
@@ -434,6 +441,8 @@ def schedule_suite(job_config,
                    arch,
                    limit=0,
                    dry_run=True,
+                   filter_in=None,
+                   filter_out=None,
                    ):
     """
     schedule one suite.
@@ -455,6 +464,15 @@ def schedule_suite(job_config,
                 'Stopped after {limit} jobs due to --limit={limit}'.format(
                     limit=limit))
             break
+        if filter_in:
+            if not filter_in in description:
+                if all([x.find(filter_in) < 0 for x in fragment_paths]):
+                    continue
+        if filter_out:
+            if filter_out in description or any([filter_out in z
+                    for z in fragment_paths]):
+                continue
+
         raw_yaml = '\n'.join([file(a, 'r').read() for a in fragment_paths])
 
         parsed_yaml = yaml.load(raw_yaml)