Commit cd570488 authored by Stan Hu's avatar Stan Hu

Clean up after finishing spec by destroying jobs that were added

parent a6c7263d
...@@ -121,6 +121,8 @@ describe Gitlab::Geo, lib: true do ...@@ -121,6 +121,8 @@ describe Gitlab::Geo, lib: true do
end end
describe '.configure_cron_jobs!' do describe '.configure_cron_jobs!' do
JOBS = %w(ldap_test geo_bulk_notify_worker geo_repository_sync_worker geo_file_download_dispatch_worker).freeze
def init_cron_job(job_name, class_name) def init_cron_job(job_name, class_name)
job = Sidekiq::Cron::Job.new( job = Sidekiq::Cron::Job.new(
name: job_name, name: job_name,
...@@ -132,8 +134,11 @@ describe Gitlab::Geo, lib: true do ...@@ -132,8 +134,11 @@ describe Gitlab::Geo, lib: true do
end end
before(:all) do before(:all) do
jobs = %w(ldap_test geo_bulk_notify_worker geo_repository_sync_worker geo_file_download_dispatch_worker) JOBS.each { |job| init_cron_job(job, job.camelize) }
jobs.each { |job| init_cron_job(job, job.camelize) } end
after(:all) do
JOBS.each { |job| Sidekiq::Cron::Job.find(job)&.destroy }
end end
it 'activates cron jobs for primary' do it 'activates cron jobs for primary' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment