diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-20 14:10:13 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-20 14:10:13 +0300 |
commit | 0ea3fcec397b69815975647f5e2aa5fe944a8486 (patch) | |
tree | 7979381b89d26011bcf9bdc989a40fcc2f1ed4ff /spec/tasks/gitlab/pages_rake_spec.rb | |
parent | 72123183a20411a36d607d70b12d57c484394c8e (diff) |
Add latest changes from gitlab-org/gitlab@15-1-stable-eev15.1.0-rc42
Diffstat (limited to 'spec/tasks/gitlab/pages_rake_spec.rb')
-rw-r--r-- | spec/tasks/gitlab/pages_rake_spec.rb | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/spec/tasks/gitlab/pages_rake_spec.rb b/spec/tasks/gitlab/pages_rake_spec.rb index d4bfcafa7b4..9e3d5c3ccf0 100644 --- a/spec/tasks/gitlab/pages_rake_spec.rb +++ b/spec/tasks/gitlab/pages_rake_spec.rb @@ -7,86 +7,6 @@ RSpec.describe 'gitlab:pages', :silence_stdout do Rake.application.rake_require 'tasks/gitlab/pages' end - describe 'migrate_legacy_storage task' do - subject { run_rake_task('gitlab:pages:migrate_legacy_storage') } - - it 'calls migration service' do - expect_next_instance_of(::Pages::MigrateFromLegacyStorageService, anything, - ignore_invalid_entries: false, - mark_projects_as_not_deployed: false) do |service| - expect(service).to receive(:execute_with_threads).with(threads: 3, batch_size: 10).and_call_original - end - - subject - end - - it 'uses PAGES_MIGRATION_THREADS environment variable' do - stub_env('PAGES_MIGRATION_THREADS', '5') - - expect_next_instance_of(::Pages::MigrateFromLegacyStorageService, anything, - ignore_invalid_entries: false, - mark_projects_as_not_deployed: false) do |service| - expect(service).to receive(:execute_with_threads).with(threads: 5, batch_size: 10).and_call_original - end - - subject - end - - it 'uses PAGES_MIGRATION_BATCH_SIZE environment variable' do - stub_env('PAGES_MIGRATION_BATCH_SIZE', '100') - - expect_next_instance_of(::Pages::MigrateFromLegacyStorageService, anything, - ignore_invalid_entries: false, - mark_projects_as_not_deployed: false) do |service| - expect(service).to receive(:execute_with_threads).with(threads: 3, batch_size: 100).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, - ignore_invalid_entries: true, - mark_projects_as_not_deployed: false) do |service| - expect(service).to receive(:execute_with_threads).with(threads: 3, batch_size: 10).and_call_original - end - - subject - end - - it 'uses PAGES_MIGRATION_MARK_PROJECTS_AS_NOT_DEPLOYED environment variable' do - stub_env('PAGES_MIGRATION_MARK_PROJECTS_AS_NOT_DEPLOYED', 'true') - - expect_next_instance_of(::Pages::MigrateFromLegacyStorageService, anything, - ignore_invalid_entries: false, - mark_projects_as_not_deployed: true) do |service| - expect(service).to receive(:execute_with_threads).with(threads: 3, batch_size: 10).and_call_original - end - - subject - end - end - - describe 'clean_migrated_zip_storage task' do - it 'removes only migrated deployments' do - regular_deployment = create(:pages_deployment) - migrated_deployment = create(:pages_deployment, :migrated) - - regular_deployment.project.update_pages_deployment!(regular_deployment) - migrated_deployment.project.update_pages_deployment!(migrated_deployment) - - expect(PagesDeployment.all).to contain_exactly(regular_deployment, migrated_deployment) - - run_rake_task('gitlab:pages:clean_migrated_zip_storage') - - expect(PagesDeployment.all).to contain_exactly(regular_deployment) - expect(PagesDeployment.find_by_id(regular_deployment.id)).not_to be_nil - expect(PagesDeployment.find_by_id(migrated_deployment.id)).to be_nil - end - end - describe 'gitlab:pages:deployments:migrate_to_object_storage' do subject { run_rake_task('gitlab:pages:deployments:migrate_to_object_storage') } |