Exemplo n.º 1
0
def do_autobuild(commands, name):
    server_url = options.server_url or default_server_url
    if not options.force_build:
        if not check(name, server_url, tags=tags):
            print 'check build says no need to build; bye'
            sys.exit(0)

    context = TempDirectoryContext(options.cleanup_temp)
    results = do(name, commands, context=context)
    client_info, reslist = results

    if options.report:
        print 'result: %s; sending' % (client_info['success'],)
        send(server_url, results, tags=tags)
    else:
        print 'build result:'
        import pprint
        pprint.pprint(client_info)
        pprint.pprint(reslist)
        print '(NOT SENDING BUILD RESULT TO SERVER)'
Exemplo n.º 2
0
def test_exception_command():
    c = Context()

    (client_info, _, _) = do('foo', [ExceptedCommand()], context=c)
    assert not client_info['success']
Exemplo n.º 3
0
def test_failed_command():
    c = Context()

    (client_info, _, _) = do('foo', [FailedCommand()], context=c)
    assert not client_info['success']
Exemplo n.º 4
0
def test_context_failure():
    c = FailedContextInit()

    (client_info, _, _) = do('foo', [SuccessfulCommand()], context=c)
    assert not client_info['success']
Exemplo n.º 5
0
def test_successful_command():
    c = Context()

    (client_info, _, _) = do('foo', [SuccessfulCommand()], context=c)
    assert client_info['success']
Exemplo n.º 6
0
name = 'mechanize'
tags = ['mechanize']
server_url = options.server_url

if not options.force_build:
    if not check(name, server_url, tags=tags):
        print 'check build says no need to build; bye'
        sys.exit(0)

commands = [
    SvnCheckout('mechanize', repo_url, name='checkout'),
    BuildCommand([python_exe, 'setup.py', 'test'])
]

context = TempDirectoryContext()
results = do(name, commands, context=context)
client_info, reslist, files = results

if options.report:
    print 'result: %s; sending' % (client_info['success'], )
    send(server_url, results, tags=tags)
else:
    print 'build result:'
    pprint.pprint(client_info)
    pprint.pprint(reslist)

    print '(NOT SENDING BUILD RESULT TO SERVER)'

if not client_info['success']:
    sys.exit(-1)
Exemplo n.º 7
0
name = 'mechanize'
tags = ['mechanize']
server_url = options.server_url

if not options.force_build:
    if not check(name, server_url, tags=tags):
        print 'check build says no need to build; bye'
        sys.exit(0)

commands = [ SvnCheckout('mechanize', repo_url, name='checkout'),
             BuildCommand([python_exe, 'setup.py', 'test'])
             ]

context = TempDirectoryContext()
results = do(name, commands, context=context)
client_info, reslist, files = results

if options.report:
    print 'result: %s; sending' % (client_info['success'],)
    send(server_url, results, tags=tags)
else:
    print 'build result:'
    pprint.pprint(client_info)
    pprint.pprint(reslist)
    
    print '(NOT SENDING BUILD RESULT TO SERVER)'

if not client_info['success']:
    sys.exit(-1)
Exemplo n.º 8
0
def test_exception_command():
    c = Context()

    (client_info, _, _) = do('foo', [ ExceptedCommand() ], context=c)
    assert not client_info['success']
Exemplo n.º 9
0
def test_failed_command():
    c = Context()

    (client_info, _, _) = do('foo', [ FailedCommand() ], context=c)
    assert not client_info['success']
Exemplo n.º 10
0
def test_context_failure():
    c = FailedContextInit()

    (client_info, _, _) = do('foo', [ SuccessfulCommand() ], context=c)
    assert not client_info['success']
Exemplo n.º 11
0
def test_successful_command():
    c = Context()

    (client_info, _, _) = do('foo', [ SuccessfulCommand() ], context=c)
    assert client_info['success']