]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
coverage: use locally stored build instead of downloading from a gitbuilder
authorJosh Durgin <josh.durgin@dreamhost.com>
Wed, 14 Dec 2011 00:16:09 +0000 (16:16 -0800)
committerJosh Durgin <josh.durgin@dreamhost.com>
Wed, 14 Dec 2011 00:16:09 +0000 (16:16 -0800)
coverage/cov-init.sh
teuthology/coverage.py

index cf5cebf9c09741d34cbbe4e5aa89900e2c356c02..e3afb9961555b4567f6e7b5cb599f4725eeba93d 100755 (executable)
@@ -2,14 +2,15 @@
 set -e
 
 usage () {
-       printf '%s: usage: %s TEST_DIR OUTPUT_DIR\n' "$(basename "$0")" "$(basename "$0")" 1>&2
+       printf '%s: usage: %s TEST_DIR OUTPUT_DIR CEPH_BUILD_TARBALL\n' "$(basename "$0")" "$(basename "$0")" 1>&2
        exit 1
 }
 
 TEST_DIR=$1
 OUTPUT_DIR=$2
+CEPH_TARBALL=$3
 
-if [ -z "$TEST_DIR" ] || [ -z "$OUTPUT_DIR" ]; then
+if [ -z "$TEST_DIR" ] || [ -z "$OUTPUT_DIR" ] || [ -z "$CEPH_TARBALL" ]; then
        usage
 fi
 
@@ -19,8 +20,7 @@ mkdir -p $OUTPUT_DIR/ceph
 
 echo "Retrieving source and .gcno files..."
 wget -q -O- "https://github.com/NewDreamNetwork/ceph/tarball/$SHA1" | tar xzf - --strip-components=1 -C $OUTPUT_DIR/ceph
-wget "http://gitbuilder-gcov-amd64.ceph.newdream.net/output/sha1/$SHA1/ceph.x86_64.tgz" -P $OUTPUT_DIR
-tar zxf $OUTPUT_DIR/ceph.x86_64.tgz -C $OUTPUT_DIR
+tar zxf $CEPH_TARBALL -C $OUTPUT_DIR
 cp $OUTPUT_DIR/usr/local/lib/ceph/coverage/*.gcno $OUTPUT_DIR/ceph/src
 mkdir $OUTPUT_DIR/ceph/src/.libs
 cp $OUTPUT_DIR/usr/local/lib/ceph/coverage/.libs/*.gcno $OUTPUT_DIR/ceph/src/.libs
index eb9df9d0ceddfabef1c5141782e379f0532c04c5..b68b7961f8dfeb0edf6f0d6e28a9e774ab1e7c5b 100644 (file)
@@ -12,7 +12,6 @@ from teuthology import misc as teuthology
 log = logging.getLogger(__name__)
 
 def connect_to_db(ctx):
-    teuthology.read_config(ctx)
     db = MySQLdb.connect(
         host=ctx.teuthology_config['coverage_db_host'],
         user=ctx.teuthology_config['coverage_db_user'],
@@ -109,6 +108,8 @@ Analyze the coverage of a suite of test runs, generating html output with lcov.
         level=loglevel,
         )
 
+    teuthology.read_config(args)
+
     tests = [
         f for f in sorted(os.listdir(args.test_dir))
         if not f.startswith('.')
@@ -130,6 +131,8 @@ Analyze the coverage of a suite of test runs, generating html output with lcov.
 
     assert len(test_summaries) > 0
 
+    suite = os.path.basename(args.test_dir)
+
     # only run cov-init once.
     # this only works if all tests were run against the same version.
     if not args.skip_init:
@@ -139,6 +142,10 @@ Analyze the coverage of a suite of test runs, generating html output with lcov.
                 os.path.join(args.cov_tools_dir, 'cov-init.sh'),
                 os.path.join(args.test_dir, tests[0]),
                 args.lcov_output,
+                os.path.join(
+                    args.teuthology_config['ceph_build_output_dir'],
+                    '{suite}.tgz'.format(suite=suite),
+                    ),
                 ])
         shutil.copy(
             os.path.join(args.lcov_output, 'base.lcov'),
@@ -180,7 +187,6 @@ Analyze the coverage of a suite of test runs, generating html output with lcov.
             os.path.join(args.lcov_output, 'total.lcov')
             )
 
-    suite = os.path.basename(args.test_dir)
     coverage = read_coverage(output)
     test_coverage['total for {suite}'.format(suite=suite)] = coverage
     log.debug('total coverage is %s', str(coverage))