diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-06 00:09:04 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-06 00:09:04 +0300 |
commit | 96e23b2017cbe56969771960f6c274c5d3599397 (patch) | |
tree | b8b17da1ab080dd41fc64fc0262de2cf16754559 /spec/migrations | |
parent | 2f1a81fd16ff9968d6b986f8a407d963bc2218f9 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/migrations')
-rw-r--r-- | spec/migrations/20230412141541_reschedule_links_avoiding_duplication_spec.rb | 8 | ||||
-rw-r--r-- | spec/migrations/20230522111534_reschedule_migration_for_links_from_metadata_spec.rb | 31 |
2 files changed, 32 insertions, 7 deletions
diff --git a/spec/migrations/20230412141541_reschedule_links_avoiding_duplication_spec.rb b/spec/migrations/20230412141541_reschedule_links_avoiding_duplication_spec.rb index 06eccf03ca4..342504ca3c5 100644 --- a/spec/migrations/20230412141541_reschedule_links_avoiding_duplication_spec.rb +++ b/spec/migrations/20230412141541_reschedule_links_avoiding_duplication_spec.rb @@ -10,13 +10,7 @@ RSpec.describe RescheduleLinksAvoidingDuplication, :migration, feature_category: it 'schedules a batched background migration' do migrate! - expect(migration).to have_scheduled_batched_migration( - table_name: :vulnerability_occurrences, - column_name: :id, - interval: described_class::DELAY_INTERVAL, - batch_size: described_class::BATCH_SIZE, - sub_batch_size: described_class::SUB_BATCH_SIZE - ) + expect(migration).not_to have_scheduled_batched_migration end end diff --git a/spec/migrations/20230522111534_reschedule_migration_for_links_from_metadata_spec.rb b/spec/migrations/20230522111534_reschedule_migration_for_links_from_metadata_spec.rb new file mode 100644 index 00000000000..efaef3e6892 --- /dev/null +++ b/spec/migrations/20230522111534_reschedule_migration_for_links_from_metadata_spec.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +require 'spec_helper' +require_migration! + +RSpec.describe RescheduleMigrationForLinksFromMetadata, :migration, feature_category: :vulnerability_management do + let(:migration) { described_class::MIGRATION } + + describe '#up' do + it 'schedules a batched background migration' do + migrate! + + expect(migration).to have_scheduled_batched_migration( + table_name: :vulnerability_occurrences, + column_name: :id, + interval: described_class::DELAY_INTERVAL, + batch_size: described_class::BATCH_SIZE, + sub_batch_size: described_class::SUB_BATCH_SIZE + ) + end + end + + describe '#down' do + it 'deletes all batched migration records' do + migrate! + schema_migrate_down! + + expect(migration).not_to have_scheduled_batched_migration + end + end +end |