diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-20 14:18:08 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-20 14:18:08 +0300 |
commit | 5afcbe03ead9ada87621888a31a62652b10a7e4f (patch) | |
tree | 9918b67a0d0f0bafa6542e839a8be37adf73102d /spec/support/shared_examples/workers/batched_background_migration_execution_worker_shared_example.rb | |
parent | c97c0201564848c1f53226fe19d71fdcc472f7d0 (diff) |
Add latest changes from gitlab-org/gitlab@16-4-stable-eev16.4.0-rc42
Diffstat (limited to 'spec/support/shared_examples/workers/batched_background_migration_execution_worker_shared_example.rb')
-rw-r--r-- | spec/support/shared_examples/workers/batched_background_migration_execution_worker_shared_example.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/support/shared_examples/workers/batched_background_migration_execution_worker_shared_example.rb b/spec/support/shared_examples/workers/batched_background_migration_execution_worker_shared_example.rb index 8fdd59d1d8c..cf488a4d753 100644 --- a/spec/support/shared_examples/workers/batched_background_migration_execution_worker_shared_example.rb +++ b/spec/support/shared_examples/workers/batched_background_migration_execution_worker_shared_example.rb @@ -3,6 +3,10 @@ RSpec.shared_examples 'batched background migrations execution worker' do include ExclusiveLeaseHelpers + before do + stub_feature_flags(disallow_database_ddl_feature_flags: false) + end + it 'is a limited capacity worker' do expect(described_class.new).to be_a(LimitedCapacity::Worker) end @@ -100,6 +104,23 @@ RSpec.shared_examples 'batched background migrations execution worker' do end end + context 'when disable ddl flag is enabled' do + let(:migration) do + create(:batched_background_migration, :active, interval: job_interval, table_name: table_name) + end + + before do + stub_feature_flags(disallow_database_ddl_feature_flags: true) + end + + it 'does nothing' do + expect(Gitlab::Database::BackgroundMigration::BatchedMigration).not_to receive(:find_executable) + expect(worker).not_to receive(:run_migration_job) + + worker.perform_work(database_name, migration.id) + end + end + context 'when the feature flag is enabled' do before do stub_feature_flags(execute_batched_migrations_on_schedule: true) |