Exemplo n.º 1
0
def get_test_run_info(date):

    total_error_count = 0
    total_test_count = 0

    for run in Utils.get_dirs(os.path.join(logs_dir, date)):
        for ip_in_runs in Utils.get_dirs(os.path.join(logs_dir, date, run)):
            for xml in os.listdir(os.path.join(logs_dir, date, run,
                                               ip_in_runs)):
                if xml.startswith('testresult'):
                    fname = os.path.join(logs_dir, date, run, ip_in_runs, xml)
                    tree = ET.parse(fname)

                    test_count = tree.find('totalTestCount').get(
                        'totalTestCount')
                    error_count = tree.find('errorCount').get('errorCount')

                    total_test_count += int(test_count)
                    total_error_count += int(error_count)

    return {
        'date': date,
        'total_test_count': total_test_count,
        'total_error_count': total_error_count
    }
Exemplo n.º 2
0
def get_test_run_info(date):

    total_error_count = 0
    total_test_count = 0

    for run in Utils.get_dirs(os.path.join(logs_dir, date)):
        for ip_in_runs in Utils.get_dirs(os.path.join(logs_dir, date, run)):
            for xml in os.listdir(os.path.join(logs_dir, date, run, ip_in_runs)):
                if xml.startswith('testresult'):
                    fname = os.path.join(logs_dir, date, run, ip_in_runs, xml)
                    tree = ET.parse(fname)

                    test_count = tree.find('totalTestCount').get('totalTestCount')
                    error_count = tree.find('errorCount').get('errorCount')

                    total_test_count += int(test_count)
                    total_error_count += int(error_count)

    return {'date': date, 'total_test_count': total_test_count, 'total_error_count': total_error_count}
Exemplo n.º 3
0
    for i in range(start, end):
        time.sleep(2)
        opens.append(
            subprocess.Popen([
                path_to_python, "./runAll.py", sys.argv[i], browser,
                path_to_dir
            ]))

    [p.wait() for p in opens]


if not os.path.exists(run_dates_path):

    run_dates_file = open(run_dates_path, "a+")

    for date in Utils.get_dirs(logs_dir):
        for run in Utils.get_dirs(os.path.join(Utils.log_dir(), 'logs', date)):
            print('date', date, 'list',
                  os.listdir(os.path.join(Utils.log_dir(), 'logs', date)))
            run_dates_file.write(date + '/' + run + '\n')

else:
    run_dates_file = open(run_dates_path, "a+")
    run_dates_file.write(sub_path + '\n')

run_dates_file.close()

for i in range(3, len(sys.argv)):
    # path = os.path.join(path_to_dir, Utils.format_ip_address(sys.argv[i]))
    path = os.path.normcase(
        os.path.join("logs", sub_path, Utils.format_ip_address(sys.argv[i])))
Exemplo n.º 4
0

def run_some(start, end):
    for i in range(start, end):
        time.sleep(2)

        opens.append(subprocess.Popen(["c:\\Python27\\python.exe", "./runAll.py", sys.argv[i], "chrome", path_to_dir]))

    [p.wait() for p in opens]


if not os.path.exists(run_dates_path):

    run_dates_file = open(run_dates_path, "a+")

    for date in Utils.get_dirs(logs_dir):
        for run in Utils.get_dirs(os.path.join(Utils.log_dir(), 'logs', date)):
            print 'date', date, 'list', os.listdir(os.path.join(Utils.log_dir(), 'logs', date))
            run_dates_file.write(date + '/' + run + '\n')

else:
    run_dates_file = open(run_dates_path, "a+")
    run_dates_file.write(sub_path + '\n')

run_dates_file.close()

for i in range(1, len(sys.argv)):
    field = ET.SubElement(root, "ipAddress").text = sys.argv[i]

tree = ET.ElementTree(root)
tree.write(os.path.join(path_to_dir, 'ip-addresses.xml'))