From a8082e6059559719e106d76540c77393293e081e Mon Sep 17 00:00:00 2001 From: Eric Mustin Date: Mon, 8 Nov 2021 20:10:05 -0500 Subject: [PATCH] chore: fix tests for sidekiq to support inline lua changes (#1011) * chore: fix tests for sidekiq to support inline lua changes to redis calls * chore: add additional sidekiq appraisal --- instrumentation/sidekiq/Appraisals | 4 ++++ .../instrumentation/sidekiq/patches/poller_test.rb | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/instrumentation/sidekiq/Appraisals b/instrumentation/sidekiq/Appraisals index 6cb0f10e7..008b9c89e 100644 --- a/instrumentation/sidekiq/Appraisals +++ b/instrumentation/sidekiq/Appraisals @@ -1,5 +1,9 @@ # frozen_string_literal: true +appraise 'sidekiq-6.3' do + gem 'sidekiq', '~> 6.3' +end + appraise 'sidekiq-6.1' do gem 'sidekiq', '~> 6.1' end diff --git a/instrumentation/sidekiq/test/opentelemetry/instrumentation/sidekiq/patches/poller_test.rb b/instrumentation/sidekiq/test/opentelemetry/instrumentation/sidekiq/patches/poller_test.rb index e6124389d..31357dbda 100644 --- a/instrumentation/sidekiq/test/opentelemetry/instrumentation/sidekiq/patches/poller_test.rb +++ b/instrumentation/sidekiq/test/opentelemetry/instrumentation/sidekiq/patches/poller_test.rb @@ -46,7 +46,8 @@ poller.enqueue span_names = spans.map(&:name) _(span_names).must_include('Sidekiq::Scheduled::Poller#enqueue') - _(span_names).must_include('ZRANGEBYSCORE') + # Inline Lua uses a different redis client method in 6.3+ https://github.com/mperham/sidekiq/pull/5044 + _(span_names).must_include('ZRANGEBYSCORE') if Gem.loaded_specs['sidekiq'].version < Gem::Version.new('6.3') end describe 'when peer_service config is set' do