]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Support ceph tarball "favors", that is different gitbuilders.
authorTommi Virtanen <tommi.virtanen@dreamhost.com>
Thu, 9 Jun 2011 22:43:43 +0000 (15:43 -0700)
committerTommi Virtanen <tommi.virtanen@dreamhost.com>
Fri, 10 Jun 2011 00:16:06 +0000 (17:16 -0700)
Use that for picking the gcov gitbuilder, when told to record code
coverage. Actual coverage support comes in the next commit.

Assuming all the world is a VA.. I mean amd64, for now.

teuthology/misc.py
teuthology/task/ceph.py

index 6d45fc3ec028bdc794428c5b55f8b36d690736db..bc98477f5ef302e8f49314e61e3c233c63379602 100644 (file)
@@ -9,7 +9,7 @@ import urlparse
 
 log = logging.getLogger(__name__)
 
-def get_ceph_binary_url(branch=None, tag=None):
+def get_ceph_binary_url(branch=None, tag=None, flavor=None):
     # gitbuilder uses remote-style ref names for branches, mangled to
     # have underscores instead of slashes; e.g. origin_master
     if tag is not None:
@@ -19,11 +19,24 @@ def get_ceph_binary_url(branch=None, tag=None):
         if branch is None:
             branch = 'master'
         ref = 'origin_{branch}'.format(branch=branch)
-    BASE = 'http://ceph.newdream.net/gitbuilder/output/'
+
+    if flavor is None:
+        flavor = ''
+    else:
+        # TODO hardcoding amd64 here for simplicity; clients will try
+        # to fetch the tarball matching their arch, non-x86_64 just
+        # won't find anything and the test will fail. trying to
+        # support cross-arch clusters is messy because nothing
+        # guarantees the same sha1 of "master" has been built for all
+        # of them. hoping for yagni.
+        flavor = '-{flavor}-amd64'.format(flavor=flavor)
+    BASE = 'http://ceph.newdream.net/gitbuilder{flavor}/output/'.format(flavor=flavor)
     sha1_url = urlparse.urljoin(BASE, 'ref/{ref}/sha1'.format(ref=ref))
+    log.debug('Translating ref to sha1 using url %s', sha1_url)
     sha1_fp = urllib2.urlopen(sha1_url)
     sha1 = sha1_fp.read().rstrip('\n')
     sha1_fp.close()
+    log.debug('Using ceph sha1 %s', sha1)
     bindir_url = urlparse.urljoin(BASE, 'sha1/{sha1}/'.format(sha1=sha1))
     return bindir_url
 
index 296e5b34d016a16e51fb0e7e8e3e8b8c90179055..16908c7b0b674be88e02409215bae2207ebd7e90 100644 (file)
@@ -35,10 +35,21 @@ def task(ctx, config):
         - ceph:
             tag: v0.42.13
 
+    To capture code coverage data, use::
+
+        tasks:
+        - ceph:
+            coverage: true
+
     """
     if config is None:
         config = {}
 
+    flavor = None
+    if config.get('coverage'):
+        log.info('Recording coverage for this run.')
+        flavor = 'gcov'
+
     log.info('Checking for old test directory...')
     processes = ctx.cluster.run(
         args=[
@@ -97,6 +108,7 @@ def task(ctx, config):
     ceph_bindir_url = teuthology.get_ceph_binary_url(
         branch=config.get('branch'),
         tag=config.get('tag'),
+        flavor=flavor,
         )
     ctx.cluster.run(
         args=[