예제 #1
0
def pytest_runtest_call(__multicall__, item):
    """hook to run each test with traced function calls"""
    if item.config.getvalue('tracer'):
        out = art_client.fire_hook('filedump', grab_result=True,
                                   test_name=item.name, test_location=item.parent.name,
                                   filename="function_trace.txt", contents="",
                                   fd_ident="func_trace")
        if out:
            filename = os.path.join(out['artifact_path'], 'filedump-function_trace.txt')
        else:
            filename = './tracelogs/' + item.name.replace("/", "_")
        with function_trace.trace_on(
                tracer=function_trace.PerThreadFileTracer(
                    to_trace,
                    depths=depths,
                    filename=filename)):
            __multicall__.execute()
예제 #2
0
def pytest_runtest_call(item):
    """hook to run each test with traced function calls"""
    if item.config.getvalue('tracer'):
        out = art_client.fire_hook('filedump', grab_result=True,
                                   test_name=item.name, test_location=item.parent.name,
                                   description="Function trace", contents="",
                                   file_type="func_trace", group_id="misc-artifacts")
        if out:
            filename = os.path.join(out['artifact_path'], 'filedump-function_trace.txt')
        else:
            filename = './tracelogs/' + item.name.replace("/", "_")
        with function_trace.trace_on(
                tracer=function_trace.PerThreadFileTracer(
                    to_trace,
                    depths=depths,
                    filename=filename)):
            yield
    else:
        yield
예제 #3
0
def pytest_runtest_call(item):
    """hook to run each test with traced function calls"""
    if item.config.getvalue('tracer'):
        out = art_client.fire_hook('filedump',
                                   grab_result=True,
                                   test_name=item.name,
                                   test_location=item.parent.name,
                                   filename="function_trace.txt",
                                   contents="",
                                   fd_ident="func_trace")
        if out:
            filename = os.path.join(out['artifact_path'],
                                    'filedump-function_trace.txt')
        else:
            filename = './tracelogs/' + item.name.replace("/", "_")
        with function_trace.trace_on(tracer=function_trace.PerThreadFileTracer(
                to_trace, depths=depths, filename=filename)):
            yield
    else:
        yield
예제 #4
0
def trace_on():
    with function_trace.trace_on(
            tracer=function_trace.StdoutTracer(to_trace, depths=depths)):
        yield
예제 #5
0
def trace_on():
    with function_trace.trace_on(
            tracer=function_trace.StdoutTracer(
                to_trace,
                depths=depths)):
        yield