The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Test::OpenTracing::Integration - Easy Testing of OpenTracing Integrations

SYNOPSIS

Your 'App'

    package MyApp {
        use OpenTracing::GlobalTracer qw/$TRACER/;
        
        sub something {
            my $scope = $TRACER->start_active_span('some-work');
            
            $TRACER->start_span('more-work')->finish;
            
            $scope->close
        }
    }

In the test:

    use OpenTracing::Implementation qw/Test/;
    use Test::OpenTracing::Integration;
    
    use MyApp;
    
    MyApp->something();
    
    global_tracer_cmp_easy(
        [
            { operation_name => 'more-work', level => 1 },
        ],
        'child span created'
    );

IMPORTED FUNCTIONS

All of these functions require the current global tracer to be an instance of OpenTracing::Implementation::Test::Tracer. All are exported by default.

global_tracer_cmp_deeply

Runs a cmp_deeply on the current global tracer.

See: "cmp_deeply" in OpenTracing::Implementation::Test::Tracder

global_tracer_cmp_easy

Runs a cmp_easy on the current global tracer.

See: "cmp_easy" in OpenTracing::Implementation::Test::Tracder

reset_spans

Removes all saved spans from the current global tracer. Useful to start fresh before new test cases.

AUTHOR

Szymon Nieznanski <snieznanski@perceptyx.com>

COPYRIGHT AND LICENSE

'Test::OpenTracing::Integration' is Copyright (C) 2019 .. 2020, Perceptyx Inc

This library is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0.

This package is distributed in the hope that it will be useful, but it is provided "as is" and without any express or implied warranties.

For details, see the full text of the license in the file LICENSE.