コード例 #1
0
ファイル: regression.py プロジェクト: poions/SourceFlyFF
def collect_logs(tag, runner, platform, user, comment, incremental, args,
                 **unused):
    import_utils()

    if comment is None:
        comment = 'comment.html'

    comment_path = os.path.join(regression_root, comment)
    if not os.path.exists(comment_path):
        log('Comment file "%s" not found; creating default comment.' %
            comment_path)
        f = open(comment_path, 'w')
        f.write('<p>Tests are run on %s platform.</p>' % platform_name())
        f.close()

    run_type = ''
    if incremental: run_type = 'incremental'
    else: run_type = 'full'

    source = 'tarball'
    cvs_root_file = os.path.join(boost_root, 'CVS', 'root')
    if os.path.exists(cvs_root_file):
        if string.split(open(cvs_root_file).readline(),
                        '@')[0] == ':pserver:anonymous':
            source = 'anonymous CVS'
        else:
            source = 'CVS'

    from runner import collect_logs
    collect_logs(regression_results, runner, tag, platform, comment_path,
                 timestamp_path, user, source, run_type)
コード例 #2
0
ファイル: regression.py プロジェクト: efwff/SourceFlyFF
def collect_logs(tag, runner, platform, user, comment, incremental, args, **unused):
    import_utils()

    if comment is None:
        comment = "comment.html"

    comment_path = os.path.join(regression_root, comment)
    if not os.path.exists(comment_path):
        log('Comment file "%s" not found; creating default comment.' % comment_path)
        f = open(comment_path, "w")
        f.write("<p>Tests are run on %s platform.</p>" % platform_name())
        f.close()

    run_type = ""
    if incremental:
        run_type = "incremental"
    else:
        run_type = "full"

    source = "tarball"
    cvs_root_file = os.path.join(boost_root, "CVS", "root")
    if os.path.exists(cvs_root_file):
        if string.split(open(cvs_root_file).readline(), "@")[0] == ":pserver:anonymous":
            source = "anonymous CVS"
        else:
            source = "CVS"

    from runner import collect_logs

    collect_logs(regression_results, runner, tag, platform, comment_path, timestamp_path, user, source, run_type)
コード例 #3
0
def collect_logs( 
          tag
        , runner
        , platform
        , user
        , comment
        , incremental
        , args
        , **unused
        ):
    import_utils()
    
    if comment is None:
        comment = 'comment.html'

    comment_path = os.path.join( regression_root, comment )
    if not os.path.exists( comment_path ):
        log( 'Comment file "%s" not found; creating default comment.' % comment_path )
        f = open( comment_path, 'w' )
        f.write( '<p>Tests are run on %s platform.</p>' % platform_name() )
        f.close()
    
    run_type = ''
    if incremental: run_type = 'incremental'
    else:           run_type = 'full'

    source = 'tarball'
    cvs_root_file = os.path.join( boost_root, 'CVS', 'root' )
    if os.path.exists( cvs_root_file ):
        if string.split( open( cvs_root_file ).readline(), '@' )[0] == ':pserver:anonymous':
            source = 'anonymous CVS'
        else:
            source = 'CVS'
   
    from runner import collect_logs
    collect_logs( 
          regression_results
        , runner
        , tag
        , platform
        , comment_path
        , timestamp_path
        , user
        , source
        , run_type
        )
コード例 #4
0
ファイル: regression.py プロジェクト: poions/SourceFlyFF
def regression(tag,
               local,
               runner,
               platform,
               user,
               comment,
               toolsets,
               book,
               bjam_options,
               bjam_toolset,
               pjl_toolset,
               incremental,
               send_bjam_log,
               force_update,
               monitored,
               timeout,
               mail=None,
               smtp_login=None,
               proxy=None,
               ftp_proxy=None,
               debug_level=0,
               v2=1,
               args=[]):

    try:
        mail_subject = 'Boost regression for %s on %s' % (
            tag, string.split(socket.gethostname(), '.')[0])
        start_time = time.localtime()
        if mail:
            log('Sending start notification to "%s"' % mail)
            send_mail(smtp_login,
                      mail,
                      '%s started at %s.' %
                      (mail_subject, format_time(start_time)),
                      debug_level=debug_level)

        if local is not None:
            log('Using local file "%s"' % local)

            b = os.path.basename(local)
            tag = b[0:b.find('.')]
            log('Tag: "%s"' % tag)

            unpack_tarball(local, regression_root)
        else:
            if incremental or force_update:
                if not incremental: cleanup(['bin'])
                update_source(user, tag, proxy, [])
            else:
                cleanup([])
                get_source(user, tag, proxy, [])

        setup(comment, toolsets, book, bjam_toolset, pjl_toolset, monitored,
              proxy, v2, [])
        # Not specifying --toolset in command line is not enough
        # that would mean to use Boost.Build default ones
        # We can skip test only we were explictly
        # told to have no toolsets in command line "--toolset="
        if toolsets != '':  # --toolset=,
            test(toolsets, bjam_options, monitored, timeout, v2, [])
            collect_logs(tag, runner, platform, user, comment, incremental, [])
            upload_logs(tag, runner, user, ftp_proxy, debug_level,
                        send_bjam_log)
        if book:
            build_book()
            collect_book()
            upload_book(tag, runner, ftp_proxy, debug_level)

        update_itself(tag)

        if mail:
            log('Sending report to "%s"' % mail)
            end_time = time.localtime()
            send_mail(smtp_login,
                      mail,
                      '%s completed successfully at %s.' %
                      (mail_subject, format_time(end_time)),
                      debug_level=debug_level)
    except:
        if mail:
            log('Sending report to "%s"' % mail)
            traceback_ = '\n'.join(
                apply(traceback.format_exception, sys.exc_info()))
            end_time = time.localtime()
            send_mail(
                smtp_login, mail,
                '%s failed at %s.' % (mail_subject, format_time(end_time)),
                traceback_, debug_level)
        raise
コード例 #5
0
def regression( 
          tag
        , local
        , runner
        , platform
        , user
        , comment
        , toolsets
        , bjam_options
        , bjam_toolset
        , pjl_toolset
        , incremental
        , monitored
        , timeout
        , mail = None
        , proxy = None
        , args = []
        ):

    try:
        mail_subject = 'Boost regression for %s on %s ' % ( tag, string.split(socket.gethostname(), '.')[0] )
        start_time = time.localtime()
        if mail:
            log( 'Sending start notification to "%s"' % mail )
            utils.send_mail( mail, mail_subject + ' started at %s.' % format_time( start_time ) )

        if local is not None:
            log( 'Using local file "%s"' % local )
            
            b = os.path.basename( local )
            tag = b[ 0: b.find( '.' ) ]
            log( 'Tag: "%s"' % tag  )
            
            if not os.path.isdir( local ):
                unpack_tarball( local, regression_root )
            else:
                if b != 'boost':
                    log( 'Renaming "%s" into "%s"' % ( local, boost_root ) )
                    os.rename( local, boost_root )
                    
        else:
            if incremental:
                update_source( user, tag, proxy, [] )
            else:
                cleanup( [] )
                get_source( user, tag, proxy, [] )

        setup( comment, toolsets, bjam_toolset, pjl_toolset, monitored, proxy, [] )
        test( toolsets, bjam_options, monitored, timeout, [] )
        collect_logs( tag, runner, platform, user, comment, incremental, [] )
        upload_logs( tag, runner, user )
        update_itself()
        
        if mail:
            log( 'Sending report to "%s"' % mail )
            end_time = time.localtime()
            utils.send_mail( 
                  mail
                , mail_subject + ' completed successfully at %s.' % format_time( end_time )
                )
    except:
        if mail:
            log( 'Sending report to "%s"' % mail )
            msg = regression_log + [ '' ] + apply( traceback.format_exception, sys.exc_info() ) 
            end_time = time.localtime()
            utils.send_mail( 
                  mail
                , mail_subject + ' failed at %s.' % format_time( end_time )
                , '\n'.join( msg )
                )
        raise
コード例 #6
0
def regression( 
          tag
        , local
        , runner
        , platform
        , user
        , comment
        , toolsets
        , bjam_options
        , bjam_toolset
        , pjl_toolset
        , incremental
        , force_update
        , monitored
        , timeout
        , mail = None
        , smtp_login = None
        , proxy = None
        , ftp_proxy = None
        , debug_level = 0
        , args = []
        ):

    try:
        mail_subject = 'Boost regression for %s on %s' % ( tag, string.split(socket.gethostname(), '.')[0] )
        start_time = time.localtime()
        if mail:
            log( 'Sending start notification to "%s"' % mail )
            send_mail(
                  smtp_login
                , mail
                , '%s started at %s.' % ( mail_subject, format_time( start_time ) )
                , debug_level = debug_level
                )

        if local is not None:
            log( 'Using local file "%s"' % local )
            
            b = os.path.basename( local )
            tag = b[ 0: b.find( '.' ) ]
            log( 'Tag: "%s"' % tag  )
            
            unpack_tarball( local, regression_root )
        else:
            if incremental or force_update:
                if not incremental: cleanup( [ 'bin' ] )
                update_source( user, tag, proxy, [] )
            else:
                cleanup( [] )
                get_source( user, tag, proxy, [] )

        setup( comment, toolsets, bjam_toolset, pjl_toolset, monitored, proxy, [] )
        test( toolsets, bjam_options, monitored, timeout, [] )
        collect_logs( tag, runner, platform, user, comment, incremental, [] )
        upload_logs( tag, runner, user, ftp_proxy, debug_level )
        update_itself( tag )
        
        if mail:
            log( 'Sending report to "%s"' % mail )
            end_time = time.localtime()
            send_mail( 
                  smtp_login
                , mail
                , '%s completed successfully at %s.' % ( mail_subject, format_time( end_time ) )
                , debug_level = debug_level
                )
    except:
        if mail:
            log( 'Sending report to "%s"' % mail )
            traceback_ = '\n'.join( apply( traceback.format_exception, sys.exc_info() ) )
            end_time = time.localtime()
            send_mail(
                  smtp_login
                , mail
                , '%s failed at %s.' % ( mail_subject, format_time( end_time ) )
                , traceback_
                , debug_level
                )
        raise
コード例 #7
0
ファイル: regression.py プロジェクト: efwff/SourceFlyFF
def regression(
    tag,
    local,
    runner,
    platform,
    user,
    comment,
    toolsets,
    book,
    bjam_options,
    bjam_toolset,
    pjl_toolset,
    incremental,
    send_bjam_log,
    force_update,
    monitored,
    timeout,
    mail=None,
    smtp_login=None,
    proxy=None,
    ftp_proxy=None,
    debug_level=0,
    v2=1,
    args=[],
):

    try:
        mail_subject = "Boost regression for %s on %s" % (tag, string.split(socket.gethostname(), ".")[0])
        start_time = time.localtime()
        if mail:
            log('Sending start notification to "%s"' % mail)
            send_mail(
                smtp_login, mail, "%s started at %s." % (mail_subject, format_time(start_time)), debug_level=debug_level
            )

        if local is not None:
            log('Using local file "%s"' % local)

            b = os.path.basename(local)
            tag = b[0 : b.find(".")]
            log('Tag: "%s"' % tag)

            unpack_tarball(local, regression_root)
        else:
            if incremental or force_update:
                if not incremental:
                    cleanup(["bin"])
                update_source(user, tag, proxy, [])
            else:
                cleanup([])
                get_source(user, tag, proxy, [])

        setup(comment, toolsets, book, bjam_toolset, pjl_toolset, monitored, proxy, v2, [])
        # Not specifying --toolset in command line is not enough
        # that would mean to use Boost.Build default ones
        # We can skip test only we were explictly
        # told to have no toolsets in command line "--toolset="
        if toolsets != "":  # --toolset=,
            test(toolsets, bjam_options, monitored, timeout, v2, [])
            collect_logs(tag, runner, platform, user, comment, incremental, [])
            upload_logs(tag, runner, user, ftp_proxy, debug_level, send_bjam_log)
        if book:
            build_book()
            collect_book()
            upload_book(tag, runner, ftp_proxy, debug_level)

        update_itself(tag)

        if mail:
            log('Sending report to "%s"' % mail)
            end_time = time.localtime()
            send_mail(
                smtp_login,
                mail,
                "%s completed successfully at %s." % (mail_subject, format_time(end_time)),
                debug_level=debug_level,
            )
    except:
        if mail:
            log('Sending report to "%s"' % mail)
            traceback_ = "\n".join(apply(traceback.format_exception, sys.exc_info()))
            end_time = time.localtime()
            send_mail(
                smtp_login, mail, "%s failed at %s." % (mail_subject, format_time(end_time)), traceback_, debug_level
            )
        raise