diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-12 00:09:00 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-12 00:09:00 +0300 |
commit | bf217da41b429d80da49287b84dadcbf499ac22c (patch) | |
tree | b3499733d7e1abb88a3f0975333c85d00a80fd96 /spec/tasks | |
parent | 559d99e40299e67969023a1afd23d084fbf23ed1 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/tasks')
-rw-r--r-- | spec/tasks/gitlab/pages_rake_spec.rb | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/spec/tasks/gitlab/pages_rake_spec.rb b/spec/tasks/gitlab/pages_rake_spec.rb index 608458b2393..08194f4d1c9 100644 --- a/spec/tasks/gitlab/pages_rake_spec.rb +++ b/spec/tasks/gitlab/pages_rake_spec.rb @@ -11,7 +11,10 @@ RSpec.describe 'gitlab:pages' do subject { run_rake_task('gitlab:pages:migrate_legacy_storage') } it 'calls migration service' do - expect_next_instance_of(::Pages::MigrateFromLegacyStorageService, anything, 3, 10) do |service| + expect_next_instance_of(::Pages::MigrateFromLegacyStorageService, anything, + migration_threads: 3, + batch_size: 10, + ignore_invalid_entries: false) do |service| expect(service).to receive(:execute).and_call_original end @@ -21,7 +24,10 @@ RSpec.describe 'gitlab:pages' do it 'uses PAGES_MIGRATION_THREADS environment variable' do stub_env('PAGES_MIGRATION_THREADS', '5') - expect_next_instance_of(::Pages::MigrateFromLegacyStorageService, anything, 5, 10) do |service| + expect_next_instance_of(::Pages::MigrateFromLegacyStorageService, anything, + migration_threads: 5, + batch_size: 10, + ignore_invalid_entries: false) do |service| expect(service).to receive(:execute).and_call_original end @@ -31,7 +37,23 @@ RSpec.describe 'gitlab:pages' do it 'uses PAGES_MIGRATION_BATCH_SIZE environment variable' do stub_env('PAGES_MIGRATION_BATCH_SIZE', '100') - expect_next_instance_of(::Pages::MigrateFromLegacyStorageService, anything, 3, 100) do |service| + expect_next_instance_of(::Pages::MigrateFromLegacyStorageService, anything, + migration_threads: 3, + batch_size: 100, + ignore_invalid_entries: false) do |service| + expect(service).to receive(:execute).and_call_original + end + + subject + end + + it 'uses PAGES_MIGRATION_IGNORE_INVALID_ENTRIES environment variable' do + stub_env('PAGES_MIGRATION_IGNORE_INVALID_ENTRIES', 'true') + + expect_next_instance_of(::Pages::MigrateFromLegacyStorageService, anything, + migration_threads: 3, + batch_size: 10, + ignore_invalid_entries: true) do |service| expect(service).to receive(:execute).and_call_original end |