Skip to content

Commit

Permalink
Fix test after applying comments
Browse files Browse the repository at this point in the history
  • Loading branch information
marcotc committed Aug 12, 2024
1 parent a40e724 commit ac004dc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions spec/datadog/tracing/contrib/propagation/sql_comment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

RSpec.describe Datadog::Tracing::Contrib::Propagation::SqlComment do
let(:propagation_mode) { Datadog::Tracing::Contrib::Propagation::SqlComment::Mode.new(mode, append) }
let(:append_comment) { false }
let(:append) { false }

describe '.annotate!' do
let(:span_op) { Datadog::Tracing::SpanOperation.new('sql_comment_propagation_span', service: 'db_service') }
Expand Down Expand Up @@ -47,7 +47,7 @@
end

let(:sql_statement) { 'SELECT 1' }
let(:append_comment) { false }
let(:append) { false }

context 'when tracing is enabled' do
before do
Expand Down Expand Up @@ -156,7 +156,7 @@
end

context 'when append is true' do
let(:append_comment) { true }
let(:append) { true }

it 'appends the comment after the sql statement' do
is_expected.to eq("#{sql_statement} /*dde='dev',ddps='api',ddpv='1.2',dddbs='db_service'*/")
Expand Down
10 changes: 5 additions & 5 deletions spec/datadog/tracing/contrib/sql_comment_propagation_examples.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
RSpec.shared_examples_for 'with sql comment propagation' do |span_op_name:, error: nil|
context 'when default `disabled`' do
it_behaves_like 'propagates with sql comment', mode: 'disabled', span_op_name: span_op_name, error: error do
let(:propagation_mode) { Datadog::Tracing::Contrib::Propagation::SqlComment::Mode.new('disabled', append) }
let(:propagation_mode) { Datadog::Tracing::Contrib::Propagation::SqlComment::Mode.new('disabled', append_comment) }
end
end

Expand All @@ -14,7 +14,7 @@
end

it_behaves_like 'propagates with sql comment', mode: 'service', span_op_name: span_op_name, error: error do
let(:propagation_mode) { Datadog::Tracing::Contrib::Propagation::SqlComment::Mode.new('service', append) }
let(:propagation_mode) { Datadog::Tracing::Contrib::Propagation::SqlComment::Mode.new('service', append_comment) }
end
end

Expand All @@ -25,7 +25,7 @@
end

it_behaves_like 'propagates with sql comment', mode: mode, span_op_name: span_op_name, error: error do
let(:propagation_mode) { Datadog::Tracing::Contrib::Propagation::SqlComment::Mode.new(mode, append) }
let(:propagation_mode) { Datadog::Tracing::Contrib::Propagation::SqlComment::Mode.new(mode, append_comment) }
end
end
end
Expand All @@ -36,7 +36,7 @@

it "propagates with mode: #{mode}" do
expect(Datadog::Tracing::Contrib::Propagation::SqlComment::Mode)
.to receive(:new).with(mode, append).and_return(propagation_mode)
.to receive(:new).with(mode, append_comment).and_return(propagation_mode)

if error
expect { subject }.to raise_error(error)
Expand Down Expand Up @@ -76,7 +76,7 @@

context 'in append mode' do
let(:append_comment) { true }
let(:configuration_options) { super().merge(append: append) }
let(:configuration_options) { super().merge(append_comment: append_comment) }

it 'appends sql comment to the sql statement' do
allow(Datadog::Tracing::Contrib::Propagation::SqlComment).to receive(:prepend_comment).and_call_original
Expand Down

0 comments on commit ac004dc

Please sign in to comment.