Skip to content

Commit

Permalink
Merge pull request #2382 from DataDog/upgrade_que
Browse files Browse the repository at this point in the history
  • Loading branch information
marcotc authored Nov 22, 2022
2 parents 1fba323 + 58582d3 commit a1d9d96
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ elsif ruby_version?('2.2')
gem 'sqlite3', '~> 1.3.6'
gem 'sucker_punch'
gem 'typhoeus'
gem 'que', '>= 1.0.0'
gem 'que', '>= 1.0.0', '< 2.0.0'
end

appraise 'sinatra' do
Expand Down Expand Up @@ -502,7 +502,7 @@ elsif ruby_version?('2.3')
gem 'sqlite3', '~> 1.3.6'
gem 'sucker_punch'
gem 'typhoeus'
gem 'que', '>= 1.0.0'
gem 'que', '>= 1.0.0', '< 2.0.0'
end

appraise 'sinatra' do
Expand Down Expand Up @@ -630,7 +630,7 @@ elsif ruby_version?('2.4')
gem 'sqlite3', '~> 1.3.6'
gem 'sucker_punch'
gem 'typhoeus'
gem 'que', '>= 1.0.0'
gem 'que', '>= 1.0.0', '< 2.0.0'
end

appraise 'sinatra' do
Expand Down Expand Up @@ -889,7 +889,7 @@ elsif ruby_version?('2.5')
gem 'jdbc-sqlite3', '>= 3.28', platform: :jruby
gem 'sucker_punch'
gem 'typhoeus'
gem 'que', '>= 1.0.0'
gem 'que', '>= 1.0.0', '< 2.0.0'
end

appraise 'sinatra' do
Expand Down Expand Up @@ -1130,7 +1130,7 @@ elsif ruby_version?('2.6')
gem 'jdbc-sqlite3', '>= 3.28', platform: :jruby
gem 'sucker_punch'
gem 'typhoeus'
gem 'que', '>= 1.0.0'
gem 'que', '>= 1.0.0', '< 2.0.0'
end

appraise 'sinatra' do
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/ruby_3.0.3_contrib.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions spec/datadog/tracing/contrib/que/tracer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
require 'que'

RSpec.describe Datadog::Tracing::Contrib::Que::Tracer do
let(:job_args) do
let(:job_options) do
{
field_one: 1,
queue: 'low',
priority: 10,
tags: { a: 1, b: 2 }
}
end
let(:job_args) { { field_one: 1 } }
let(:job_class) do
stub_const(
'TestJobClass',
Expand Down Expand Up @@ -48,7 +48,7 @@ def run(*_args)
end

describe '#call' do
subject(:enqueue) { job_class.enqueue(**job_args) }
subject(:enqueue) { job_class.enqueue(job_args, job_options: job_options) }

context 'with default options' do
let(:configuration_options) { {} }
Expand All @@ -59,8 +59,8 @@ def run(*_args)
expect(span.service).to eq(tracer.default_service)
expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_COMPONENT)).to eq('que')
expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_OPERATION)).to eq('job')
expect(span.get_tag(Datadog::Tracing::Contrib::Que::Ext::TAG_JOB_QUEUE)).to eq(job_args[:queue])
expect(span.get_tag(Datadog::Tracing::Contrib::Que::Ext::TAG_JOB_PRIORITY)).to eq(job_args[:priority])
expect(span.get_tag(Datadog::Tracing::Contrib::Que::Ext::TAG_JOB_QUEUE)).to eq(job_options[:queue])
expect(span.get_tag(Datadog::Tracing::Contrib::Que::Ext::TAG_JOB_PRIORITY)).to eq(job_options[:priority])
expect(span.get_tag(Datadog::Tracing::Contrib::Que::Ext::TAG_JOB_ERROR_COUNT)).to eq(0)
expect(span.get_tag(Datadog::Tracing::Contrib::Que::Ext::TAG_JOB_EXPIRED_AT)).to eq('')
expect(span.get_tag(Datadog::Tracing::Contrib::Que::Ext::TAG_JOB_FINISHED_AT)).to eq('')
Expand Down Expand Up @@ -103,7 +103,7 @@ def run(*_args)
enqueue

actual_span_value = span.get_tag(Datadog::Tracing::Contrib::Que::Ext::TAG_JOB_DATA)
expected_span_value = { tags: job_args[:tags] }.to_s
expected_span_value = { tags: job_options[:tags] }.to_s

expect(actual_span_value).to eq(expected_span_value)
end
Expand Down

0 comments on commit a1d9d96

Please sign in to comment.