diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 16:16:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 16:16:36 +0300 |
commit | 311b0269b4eb9839fa63f80c8d7a58f32b8138a0 (patch) | |
tree | 07e7870bca8aed6d61fdcc810731c50d2c40af47 /spec/lib/gitlab/sidekiq_config/cli_methods_spec.rb | |
parent | 27909cef6c4170ed9205afa7426b8d3de47cbb0c (diff) |
Add latest changes from gitlab-org/gitlab@14-5-stable-eev14.5.0-rc42
Diffstat (limited to 'spec/lib/gitlab/sidekiq_config/cli_methods_spec.rb')
-rw-r--r-- | spec/lib/gitlab/sidekiq_config/cli_methods_spec.rb | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/spec/lib/gitlab/sidekiq_config/cli_methods_spec.rb b/spec/lib/gitlab/sidekiq_config/cli_methods_spec.rb index bc63289a344..576b36c1829 100644 --- a/spec/lib/gitlab/sidekiq_config/cli_methods_spec.rb +++ b/spec/lib/gitlab/sidekiq_config/cli_methods_spec.rb @@ -11,12 +11,12 @@ RSpec.describe Gitlab::SidekiqConfig::CliMethods do end def stub_exists(exists: true) - ['app/workers/all_queues.yml', 'ee/app/workers/all_queues.yml'].each do |path| + ['app/workers/all_queues.yml', 'ee/app/workers/all_queues.yml', 'jh/app/workers/all_queues.yml'].each do |path| allow(File).to receive(:exist?).with(expand_path(path)).and_return(exists) end end - def stub_contents(foss_queues, ee_queues) + def stub_contents(foss_queues, ee_queues, jh_queues) allow(YAML).to receive(:load_file) .with(expand_path('app/workers/all_queues.yml')) .and_return(foss_queues) @@ -24,6 +24,10 @@ RSpec.describe Gitlab::SidekiqConfig::CliMethods do allow(YAML).to receive(:load_file) .with(expand_path('ee/app/workers/all_queues.yml')) .and_return(ee_queues) + + allow(YAML).to receive(:load_file) + .with(expand_path('jh/app/workers/all_queues.yml')) + .and_return(jh_queues) end before do @@ -45,8 +49,9 @@ RSpec.describe Gitlab::SidekiqConfig::CliMethods do end it 'flattens and joins the contents' do - expected_queues = %w[queue_a queue_b] - expected_queues = expected_queues.first(1) unless Gitlab.ee? + expected_queues = %w[queue_a] + expected_queues << 'queue_b' if Gitlab.ee? + expected_queues << 'queue_c' if Gitlab.jh? expect(described_class.worker_queues(dummy_root)) .to match_array(expected_queues) @@ -55,7 +60,7 @@ RSpec.describe Gitlab::SidekiqConfig::CliMethods do context 'when the file contains an array of hashes' do before do - stub_contents([{ name: 'queue_a' }], [{ name: 'queue_b' }]) + stub_contents([{ name: 'queue_a' }], [{ name: 'queue_b' }], [{ name: 'queue_c' }]) end include_examples 'valid file contents' |