diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-12 00:09:34 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-12 00:09:34 +0000 |
commit | 5781a4966047232d4725f9ee4769c4bd5aed9b26 (patch) | |
tree | 0ef2b81a40931ec51f8fdd5284ed9e47cf42a923 /spec/bin | |
parent | 4d48b3cfcd74bcca0f0f305746f74cf7224dd78b (diff) | |
download | gitlab-ce-5781a4966047232d4725f9ee4769c4bd5aed9b26.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/bin')
-rw-r--r-- | spec/bin/sidekiq_cluster_spec.rb | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/spec/bin/sidekiq_cluster_spec.rb b/spec/bin/sidekiq_cluster_spec.rb new file mode 100644 index 00000000000..67de55ad9f5 --- /dev/null +++ b/spec/bin/sidekiq_cluster_spec.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'bin/sidekiq-cluster' do + using RSpec::Parameterized::TableSyntax + + context 'when selecting some queues and excluding others' do + where(:args, :included, :excluded) do + %w[--negate cronjob] | '-qdefault,1' | '-qcronjob,1' + %w[--experimental-queue-selector resource_boundary=cpu] | '-qupdate_merge_requests,1' | '-qdefault,1' + end + + with_them do + it 'runs successfully', :aggregate_failures do + cmd = %w[bin/sidekiq-cluster --dryrun] + args + + output, status = Gitlab::Popen.popen(cmd, Rails.root.to_s) + + expect(status).to be(0) + expect(output).to include('"bundle", "exec", "sidekiq"') + expect(output).to include(included) + expect(output).not_to include(excluded) + end + end + end + + context 'when selecting all queues' do + [ + %w[*], + %w[--experimental-queue-selector *] + ].each do |args| + it "runs successfully with `#{args}`", :aggregate_failures do + cmd = %w[bin/sidekiq-cluster --dryrun] + args + + output, status = Gitlab::Popen.popen(cmd, Rails.root.to_s) + + expect(status).to be(0) + expect(output).to include('"bundle", "exec", "sidekiq"') + expect(output).to include('-qdefault,1') + expect(output).to include('-qcronjob:ci_archive_traces_cron,1') + end + end + end +end |