Exemple #1
0
                buckets = [bucket.name for bucket in rest.get_buckets()]
                break
            except Exception, e:
                print e

    release_number = options.release_number
    platform = options.platform

    test_name = options.test_name
    if test_name == None:
        test_name = store_report.get_run_info('name')
    test_build = options.version
    if test_build == None:
        test_build = store_report.get_run_info('build')

    storage_folder = plotter.plot_all_phases(cluster_name, buckets)

    if None in [options.release_to_compare, options.version_to_compare]:
        if options.release_to_compare is None:
            print "release_to_compare was not set"
        if options.version_to_compare is None:
            print "version_to_compare was not set"
        print 'Comparison of versions to be skipped'
    else:
        release_to_compare = options.release_to_compare
        version_to_compare = options.version_to_compare
        folders = os.walk(storage_folder).next()[1]
        for folder in folders:
            sub_folder = os.path.join(storage_folder, folder)
            url_folder = "system-test-results/%s/%s/%s/%s/%s" % (release_to_compare, platform, test_name, version_to_compare, folder)
            if not os.path.exists(url_folder):
Exemple #2
0
                buckets = [bucket.name for bucket in rest.get_buckets()]
                break
            except Exception, e:
                print e

    release_number = options.release_number
    platform = options.platform

    test_name = options.test_name
    if test_name == None:
        test_name = store_report.get_run_info('name')
    test_build = options.version
    if test_build == None:
        test_build = store_report.get_run_info('build')

    storage_folder = plotter.plot_all_phases(cluster_name, buckets)

    if None in [options.release_to_compare, options.version_to_compare]:
        if options.release_to_compare is None:
            print "release_to_compare was not set"
        if options.version_to_compare is None:
            print "version_to_compare was not set"
        print 'Comparison of versions to be skipped'
    else:
        release_to_compare = options.release_to_compare
        version_to_compare = options.version_to_compare
        folders = os.walk(storage_folder).next()[1]
        for folder in folders:
            sub_folder = os.path.join(storage_folder, folder)
            url_folder = "system-test-results/%s/%s/%s/%s/%s" % (
                release_to_compare, platform, test_name, version_to_compare,
    if len(args) < 3 :
        parser.print_help()
        sys.exit()

    return options, args

options, args = parse_args()

db_name = args[0]
host_ips = args[1].split(",")
bucket_names = args[2].split(",")

for host_ip in host_ips:
    for bucket_name in bucket_names:
        path, run_id = plotter.plot_all_phases(db_name, host_ip, bucket_name)

        if not options.graph:
            filenames = []
            for infile in glob.glob(os.path.join(path, '*.png')):
	        filenames.append(infile)
            w = 400
            parts = []
            doc = SimpleDocTemplate("report_{0}_{1}_{2}_{3}.pdf".format(db_name, host_ip, bucket_name, run_id), pagesize=letter)
            filenames.sort()
            for i in filenames:
	        img = utils.ImageReader(i)
	        iw, ih = img.getSize()
	        aspect = ih / float(iw)
	        if i.find("zz") >= 0:
	    	    w = 700
def main():
    options, args = parse_args()

    cluster_name = options.cluster_name
    if options.cluster_name is None:
        cluster_name = cfg.CB_CLUSTER_TAG

    buckets = options.buckets
    if buckets is None:
        for ip in cfg.CLUSTER_IPS:
            if ":" in ip:
                port = ip[ip.find(":") + 1:]
                ip = ip[0:ip.find(":")]
            else:
                port = '8091'
            try:
                serverInfo = {
                    'ip': ip,
                    'username': cfg.COUCHBASE_USER,
                    'password': cfg.COUCHBASE_PWD,
                    'port': port
                }
                rest = RestConnection(serverInfo)
                buckets = [bucket.name for bucket in rest.get_buckets()]
                break
            except Exception as e:
                print(e)

    release_number = options.release_number
    platform = options.platform

    test_name = options.test_name
    if test_name == None:
        test_name = store_report.get_run_info('name')
    test_build = options.version
    if test_build == None:
        test_build = store_report.get_run_info('build')

    storage_folder = plotter.plot_all_phases(cluster_name, buckets)

    if None in [options.release_to_compare, options.version_to_compare]:
        if options.release_to_compare is None:
            print("release_to_compare was not set")
        if options.version_to_compare is None:
            print("version_to_compare was not set")
        print('Comparison of versions to be skipped')
    else:
        release_to_compare = options.release_to_compare
        version_to_compare = options.version_to_compare
        folders = os.walk(storage_folder).next()[1]
        for folder in folders:
            sub_folder = os.path.join(storage_folder, folder)
            url_folder = "system-test-results/%s/%s/%s/%s/%s" % (
                release_to_compare, platform, test_name, version_to_compare,
                folder)
            if not os.path.exists(url_folder):
                os.makedirs(url_folder)
            files = [
                f for f in os.listdir(sub_folder)
                if os.path.isfile(os.path.join(sub_folder, f))
            ]
            for f in files:
                os.system("wget %s/%s/%s -O %s/%s" %
                          (CBFS_HOST, url_folder, f, url_folder, f))

        compare_stats.compare_by_folders(
            storage_folder, "system-test-results/%s/%s/%s/%s" %
            (release_to_compare, platform, test_name, version_to_compare))
        generate_index_file(storage_folder, options.json_test_file)
    store_report.store_report_cbfs(release_number, platform)