]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
teuthology-ls: summarize results from an archive-dir
authorSage Weil <sage@newdream.net>
Wed, 29 Jun 2011 19:54:53 +0000 (12:54 -0700)
committerSage Weil <sage@newdream.net>
Wed, 29 Jun 2011 19:55:25 +0000 (12:55 -0700)
ugly but basically works

setup.py
teuthology/suite.py

index e57c8deab26238b9e7eea2ecc1050bfa4d5db713..64c8ac9f52ed6c54ff9b27142e8b72a92f66c8d1 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -23,8 +23,9 @@ setup(
     entry_points={
         'console_scripts': [
             'teuthology = teuthology.run:main',
-            'teuthology-suite = teuthology.suite:main',
             'teuthology-nuke = teuthology.run:nuke',
+            'teuthology-suite = teuthology.suite:main',
+            'teuthology-ls = teuthology.suite:ls',
             ],
         },
 
index 3f7ded19ae4c242626b2e37a613dcb4fde7b5600..c9fca6632eb4e27882b99ac446bc7cdfe92bbd43 100644 (file)
@@ -117,3 +117,39 @@ useful for specifying actual machines to run on.
         log.info('Failed.')
         sys.exit(1)
 
+
+def ls():
+    parser = argparse.ArgumentParser(description='List teuthology job results')
+    parser.add_argument(
+        '--archive-dir',
+        metavar='DIR',
+        help='path under which to archive results',
+        required=True,
+        )
+    args = parser.parse_args()
+
+    import yaml
+    
+    for j in sorted(os.listdir(args.archive_dir)):
+        if j.startswith('.'):
+            continue
+        
+        try:
+            summary = {}
+            with file('%s/%s/summary.yaml' % (args.archive_dir,j)) as f:
+                g = yaml.safe_load_all(f)
+                for new in g:
+                    summary = dict(summary.items() + new.items())
+        except IOError, e:
+            continue
+
+        for key in ['owner', 'description']:
+            if not key in summary:
+                summary[key] = '-'
+
+        print "{job} {success} {owner} {desc}".format(
+            job=j,
+            owner=summary['owner'],
+            desc=summary['description'],
+            success='pass' if summary['success'] else 'FAIL',
+            )