From 722d696bca05b21ef5f0052a75a129a8374ab330 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Joaqu=C3=ADn=20Atria?= Date: Thu, 23 Nov 2023 19:23:41 +0000 Subject: [PATCH] Add missing methods to OTLP mock in test --- t/OpenTelemetry/Exporter/OTLP.t | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/t/OpenTelemetry/Exporter/OTLP.t b/t/OpenTelemetry/Exporter/OTLP.t index 8b9e8e6..da05f9a 100644 --- a/t/OpenTelemetry/Exporter/OTLP.t +++ b/t/OpenTelemetry/Exporter/OTLP.t @@ -7,6 +7,7 @@ use experimental 'signatures'; use HTTP::Tiny; use OpenTelemetry::Constants + 'HEX_INVALID_SPAN_ID', 'INVALID_SPAN_ID', -trace_export, -span_kind, @@ -25,15 +26,18 @@ my $span_mock = mock 'Local::Span' => add => [ dropped_links => 0, end_timestamp => 100, events => sub { }, + hex_parent_span_id => sub { HEX_INVALID_SPAN_ID }, + hex_span_id => sub { shift->{context}->hex_span_id }, + hex_trace_id => sub { shift->{context}->hex_trace_id }, kind => sub { SPAN_KIND_INTERNAL }, links => sub { }, name => sub { shift->{name} //= 'X' }, parent_span_id => sub { INVALID_SPAN_ID }, - span_id => sub { shift->{context}->span_id }, + span_id => sub { shift->{context}->span_id }, start_timestamp => 0, status => sub { OpenTelemetry::Trace::Span::Status->ok }, trace_flags => sub { shift->{context}->trace_flags }, - trace_id => sub { shift->{context}->trace_id }, + trace_id => sub { shift->{context}->trace_id }, trace_state => sub { shift->{context}->trace_state }, new => sub ( $class, %data ) { $data{context} //= OpenTelemetry::Trace::SpanContext->new;