diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-31 12:08:53 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-31 12:08:53 +0300 |
commit | fd3a95f07ae9cd78fecffcfa5de4494f933a7808 (patch) | |
tree | a38a8abb0afb14aa396edd30137ddf45e71d2713 /spec/lib/gitlab/sidekiq_middleware_spec.rb | |
parent | 6a7005feed2e88568f42627e7190ff5c4f2aa8d3 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/sidekiq_middleware_spec.rb')
-rw-r--r-- | spec/lib/gitlab/sidekiq_middleware_spec.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/spec/lib/gitlab/sidekiq_middleware_spec.rb b/spec/lib/gitlab/sidekiq_middleware_spec.rb index b3c0a5b04f0..e8dcbbd2ee1 100644 --- a/spec/lib/gitlab/sidekiq_middleware_spec.rb +++ b/spec/lib/gitlab/sidekiq_middleware_spec.rb @@ -110,6 +110,14 @@ describe Gitlab::SidekiqMiddleware do let(:queue) { 'default' } let(:redis_pool) { Sidekiq.redis_pool } let(:middleware_expected_args) { [worker_class_arg, job, queue, redis_pool] } + let(:expected_middlewares) do + [ + Gitlab::SidekiqStatus::ClientMiddleware, + Gitlab::SidekiqMiddleware::ClientMetrics, + Gitlab::SidekiqMiddleware::WorkerContext::Client, + Labkit::Middleware::Sidekiq::Client + ] + end before do described_class.client_configurator.call(chain) @@ -120,8 +128,9 @@ describe Gitlab::SidekiqMiddleware do # this will prevent the full middleware chain from being executed. # This test ensures that this does not happen it "invokes the chain" do - expect_any_instance_of(Gitlab::SidekiqStatus::ClientMiddleware).to receive(:call).with(*middleware_expected_args).once.and_call_original - expect_any_instance_of(Labkit::Middleware::Sidekiq::Client).to receive(:call).with(*middleware_expected_args).once.and_call_original + expected_middlewares do |middleware| + expect_any_instance_of(middleware).to receive(:call).with(*middleware_expected_args).once.ordered.and_call_original + end expect { |b| chain.invoke(worker_class_arg, job, queue, redis_pool, &b) }.to yield_control.once end |