Skip to content

Commit 61e0e33

Browse files
committed
better testing
1 parent eecb3d0 commit 61e0e33

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

spec/datadog/tracing/contrib/environment_service_name_examples.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
expect { subject }.to raise_error error
1212
else
1313
subject
14+
# _dd.base_service is set in SpanOperation#finish. If the integration
15+
# test uses an open SpanOperation as `span` (e.g. because the complete
16+
# callback is mocked out), finish it now so the tag is available.
17+
span.finish if span.respond_to?(:finished?) && !span.finished?
1418
end
1519
end
1620

spec/datadog/tracing/contrib/span_attribute_schema_examples.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
RSpec.shared_examples 'schema version span' do
22
before do
33
subject
4+
# _dd.base_service is set in SpanOperation#finish. If the integration
5+
# test uses an open SpanOperation as `span` (e.g. because the complete
6+
# callback is mocked out), finish it now so the tag is available.
7+
span.finish if span.respond_to?(:finished?) && !span.finished?
48
end
59

610
context 'service name env var testing' do

0 commit comments

Comments
 (0)