Example #1
0
    parser.add_argument("--bnum", help="jenkins build number", default="15483")
    parser.add_argument("--log",
                        help="just print out the log",
                        action="store_true")
    args = parser.parse_args()

    test_builds = []
    builds = args.bnum.split(':')
    if len(builds) == 1:
        test_builds.append((args.job, args.bnum))
    else:
        for bnum in range(int(builds[0]), int(builds[1]) + 1):
            test_builds.append((args.job, bnum))

    japi = JenkinsApi(host='jenkins.int.xcalar.com')

    for job_name, build_number in test_builds:
        parser = XDUnitTestLogParser(job_name=job_name)
        jbi = JenkinsBuildInfo(job_name=job_name,
                               build_number=build_number,
                               japi=japi)
        log = jbi.console()
        result = jbi.result()
        if args.log:
            print(log)
        else:
            print("checking job: {} build: {} result: {}".format(
                job_name, build_number, result))
            data = parser.update_build(jbi=jbi, log=jbi.console())
            pprint(data)
Example #2
0
        "'%(asctime)s - %(threadName)s - %(funcName)s - %(levelname)s - %(message)s",
        handlers=[logging.StreamHandler(sys.stdout)])

    parser = argparse.ArgumentParser()
    parser.add_argument("--job",
                        help="jenkins job name",
                        default="FuncTestTrigger")
    parser.add_argument("--bnum", help="jenkins build number", default="15352")
    args = parser.parse_args()

    test_builds = []
    builds = args.bnum.split(':')
    if len(builds) == 1:
        test_builds.append((args.job, args.bnum))
    else:
        for bnum in range(int(builds[0]), int(builds[1]) + 1):
            test_builds.append((args.job, bnum))

    japi = JenkinsApi(
        host='jenkins.int.xcalar.com')  # <- should take environment config
    for job_name, build_number in test_builds:
        plotter = SystemStatsPlotter(job_name=job_name)
        jbi = JenkinsBuildInfo(job_name=job_name,
                               build_number=build_number,
                               japi=japi)
        result = jbi.result()
        print("checking job: {} build: {} result: {}".format(
            job_name, build_number, result))
        data = plotter.update_build(jbi=jbi)
        pprint(data)