scripts/logscrapedaily.py
def main(argv):
    """
    Main program.

    @return: none
    """
    global g_script_name
    global g_test_root_dir
    global g_temp_filename
    global g_output_filename_failed_tests
    global g_output_filename_passed_tests
    global g_output_pickle_filename
    global g_failure_occurred
    global g_failed_test_info_dict
    global g_java_message_pickle_filename
    global g_summary_text_filename

    if len(argv) < 3:
        print "Must resource url like http://mr-0xa1:8080/view/wendy_jenkins/job/h2o_regression_pyunit_medium_large/lastBuild/consoleFull, filename of summary text, filename (optional ending in .pickle) to retrieve Java error messages to exclude.\n"
        sys.exit(1)
    else:   # we may be in business
        g_script_name = os.path.basename(argv[0])   # get name of script being run.
        resource_url = argv[1]

        g_temp_filename = os.path.join(g_test_root_dir,'tempText')
        g_summary_text_filename = os.path.join(g_test_root_dir,argv[2])

        if len(argv) == 4:
            g_java_message_pickle_filename  = argv[3]

        get_console_out(resource_url)       # save remote console output in local directory
        extract_job_build_url(resource_url) # extract the job name of build id for identification purposes

        log_filename = g_failed_test_info_dict["1.jobName"]
        log_pickle_filename = g_failed_test_info_dict["1.jobName"]

        # pickle file that store bad Java messages that we can ignore.
        g_java_message_pickle_filename = os.path.join(g_test_root_dir,g_java_message_pickle_filename)
        g_output_filename_failed_tests = os.path.join(g_test_root_dir,log_filename)
        g_output_filename_passed_tests = os.path.join(g_test_root_dir,log_filename)
        g_output_pickle_filename = os.path.join(g_test_root_dir,log_pickle_filename)

        load_java_messages_to_ignore()          # load in bad java messages to ignore and store in g_ok_java_messages
        extract_test_results()      # grab the console text and stored the failed tests.
        extract_java_messages()     # grab dangerous java messages that we found for the various unit tests
        if ((len(g_failed_jobs) > 0) or (g_failed_test_info_dict["7.build_failure"]=='Yes')):
            g_failure_occurred = True

        if g_failure_occurred:
            save_dict() # save the dict structure in a pickle file and a text file when failure is detected
            update_summary_file()   # join together all log files into one giant summary text.

            # output this info to console to form the list of failed jenkins jobs.
            print g_failed_test_info_dict["1.jobName"]+' build '+g_failed_test_info_dict["2.build_id"]+','
        else:
            print ""
def main(argv):
    """
    Main program.

    @return: none
    """
    global g_script_name
    global g_test_root_dir
    global g_temp_filename
    global g_output_filename_failed_tests
    global g_output_filename_passed_tests
    global g_output_pickle_filename
    global g_failure_occurred
    global g_failed_test_info_dict
    global g_java_message_pickle_filename
    global g_summary_text_filename

    if len(argv) < 3:
        print "Must resource url like http://mr-0xa1:8080/view/wendy_jenkins/job/h2o_regression_pyunit_medium_large/lastBuild/consoleFull, filename of summary text, filename (optional ending in .pickle) to retrieve Java error messages to exclude.\n"
        sys.exit(1)
    else:   # we may be in business
        g_script_name = os.path.basename(argv[0])   # get name of script being run.
        resource_url = argv[1]

        g_temp_filename = os.path.join(g_test_root_dir,'tempText')
        g_summary_text_filename = os.path.join(g_test_root_dir,argv[2])

        if len(argv) == 4:
            g_java_message_pickle_filename  = argv[3]

        get_console_out(resource_url)       # save remote console output in local directory
        extract_job_build_url(resource_url) # extract the job name of build id for identification purposes

        log_filename = g_failed_test_info_dict["1.jobName"]
        log_pickle_filename = g_failed_test_info_dict["1.jobName"]

        # pickle file that store bad Java messages that we can ignore.
        g_java_message_pickle_filename = os.path.join(g_test_root_dir,g_java_message_pickle_filename)
        g_output_filename_failed_tests = os.path.join(g_test_root_dir,log_filename)
        g_output_filename_passed_tests = os.path.join(g_test_root_dir,log_filename)
        g_output_pickle_filename = os.path.join(g_test_root_dir,log_pickle_filename)

        load_java_messages_to_ignore()          # load in bad java messages to ignore and store in g_ok_java_messages
        extract_test_results()      # grab the console text and stored the failed tests.
        extract_java_messages()     # grab dangerous java messages that we found for the various unit tests
        if ((len(g_failed_jobs) > 0) or (g_failed_test_info_dict["7.build_failure"]=='Yes')):
            g_failure_occurred = True

        if g_failure_occurred:
            save_dict() # save the dict structure in a pickle file and a text file when failure is detected
            update_summary_file()   # join together all log files into one giant summary text.

            # output this info to console to form the list of failed jenkins jobs.
            print g_failed_test_info_dict["1.jobName"]+' build '+g_failed_test_info_dict["2.build_id"]+','
        else:
            print ""
def main ( argv ) : global g_script_name global g_test_root_dir global g_temp_filename global g_output_filename_failed_tests global g_output_filename_passed_tests global g_output_pickle_filename global g_failure_occurred global g_failed_test_info_dict global g_java_message_pickle_filename global g_summary_text_filename if len ( argv ) < 3 : print "Must resource url like http://mr-0xa1:8080/view/wendy_jenkins/job/h2o_regression_pyunit_medium_large/lastBuild/consoleFull, filename of summary text, filename (optional ending in .pickle) to retrieve Java error messages to exclude.\n" sys . exit ( 1 ) else : # we may be in business g_script_name = os . path . basename ( argv [ 0 ] ) # get name of script being run. resource_url = argv [ 1 ] g_temp_filename = os . path . join ( g_test_root_dir , 'tempText' ) g_summary_text_filename = os . path . join ( g_test_root_dir , argv [ 2 ] ) if len ( argv ) == 4 : g_java_message_pickle_filename = argv [ 3 ] get_console_out ( resource_url ) # save remote console output in local directory extract_job_build_url ( resource_url ) # extract the job name of build id for identification purposes log_filename = g_failed_test_info_dict [ "1.jobName" ] log_pickle_filename = g_failed_test_info_dict [ "1.jobName" ] # pickle file that store bad Java messages that we can ignore. g_java_message_pickle_filename = os . path . join ( g_test_root_dir , g_java_message_pickle_filename ) g_output_filename_failed_tests = os . path . join ( g_test_root_dir , log_filename ) g_output_filename_passed_tests = os . path . join ( g_test_root_dir , log_filename ) g_output_pickle_filename = os . path . join ( g_test_root_dir , log_pickle_filename ) load_java_messages_to_ignore ( ) # load in bad java messages to ignore and store in g_ok_java_messages extract_test_results ( ) # grab the console text and stored the failed tests. extract_java_messages ( ) # grab dangerous java messages that we found for the various unit tests if ( ( len ( g_failed_jobs ) > 0 ) or ( g_failed_test_info_dict [ "7.build_failure" ] == 'Yes' ) ) : g_failure_occurred = True if g_failure_occurred : save_dict ( ) # save the dict structure in a pickle file and a text file when failure is detected update_summary_file ( ) # join together all log files into one giant summary text. # output this info to console to form the list of failed jenkins jobs. print g_failed_test_info_dict [ "1.jobName" ] + ' build ' + g_failed_test_info_dict [ "2.build_id" ] + ',' else : print ""
Main program.

    @return: none
Main program .