]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
scripts: add wait script for watching run 1589/head
authorKyr Shatskyy <kyrylo.shatskyy@suse.com>
Fri, 11 Dec 2020 17:48:16 +0000 (18:48 +0100)
committerKyr Shatskyy <kyrylo.shatskyy@suse.com>
Fri, 11 Dec 2020 19:24:48 +0000 (20:24 +0100)
While using teuthology-suite with --wait option it is
usefull sometimes to split the suite scheduling and
the run waiting. For example, when using tools like
Jenkins we might want to schedule a suite, report
about successful schedule and start waiting only in
the next steps.

Signed-off-by: Kyr Shatskyy <kyrylo.shatskyy@suse.com>
scripts/wait.py [new file with mode: 0644]
setup.py

diff --git a/scripts/wait.py b/scripts/wait.py
new file mode 100644 (file)
index 0000000..6b2ff34
--- /dev/null
@@ -0,0 +1,31 @@
+import docopt
+import sys
+
+import logging
+
+import teuthology
+import teuthology.suite
+from teuthology.config import config
+
+doc = """
+usage: teuthology-wait --help
+       teuthology-wait [-v] --run <name>
+
+Wait until run is finished. Returns exit code 0 on success, otherwise 1.
+
+Miscellaneous arguments:
+  -h, --help                  Show this help message and exit
+  -v, --verbose               Be more verbose
+
+Standard arguments:
+  -r, --run <name>          Run name to watch.
+"""
+
+
+def main(argv=sys.argv[1:]):
+    args = docopt.docopt(doc, argv=argv)
+    if args.get('--verbose'):
+        teuthology.log.setLevel(logging.DEBUG)
+    name = args.get('--run')
+    return teuthology.suite.wait(name, config.max_job_time, None)
+
index e595da4a646751bf285d20eb0f00f7cbd6fd29b8..cdbe81392ecb748828f868c25d82ad9d33175da0 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -129,7 +129,8 @@ setup(
             'teuthology-queue = scripts.queue:main',
             'teuthology-prune-logs = scripts.prune_logs:main',
             'teuthology-describe = scripts.describe:main',
-            'teuthology-reimage = scripts.reimage:main'
+            'teuthology-reimage = scripts.reimage:main',
+            'teuthology-wait = scripts.wait:main',
             ],
         },