From f162f07edbc6a22b5804eab220e6235766ad42cd Mon Sep 17 00:00:00 2001 From: Tommi Virtanen Date: Thu, 9 Jun 2011 15:43:43 -0700 Subject: [PATCH] Support ceph tarball "favors", that is different gitbuilders. 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 | 17 +++++++++++++++-- teuthology/task/ceph.py | 12 ++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/teuthology/misc.py b/teuthology/misc.py index 6d45fc3ec028b..bc98477f5ef30 100644 --- a/teuthology/misc.py +++ b/teuthology/misc.py @@ -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 diff --git a/teuthology/task/ceph.py b/teuthology/task/ceph.py index 296e5b34d016a..16908c7b0b674 100644 --- a/teuthology/task/ceph.py +++ b/teuthology/task/ceph.py @@ -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=[ -- 2.39.5