Test::OpenTracing::Integration - Easy Testing of OpenTracing Integrations
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' );
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.
Szymon Nieznanski <snieznanski@perceptyx.com>
'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.
To install Test::OpenTracing::Integration, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::OpenTracing::Integration
CPAN shell
perl -MCPAN -e shell install Test::OpenTracing::Integration
For more information on module installation, please visit the detailed CPAN module installation guide.