diff options
Diffstat (limited to 'spec/services/projects/hashed_storage/migration_service_spec.rb')
-rw-r--r-- | spec/services/projects/hashed_storage/migration_service_spec.rb | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/spec/services/projects/hashed_storage/migration_service_spec.rb b/spec/services/projects/hashed_storage/migration_service_spec.rb index ffbd5c2500a..d5b04688322 100644 --- a/spec/services/projects/hashed_storage/migration_service_spec.rb +++ b/spec/services/projects/hashed_storage/migration_service_spec.rb @@ -14,43 +14,6 @@ RSpec.describe Projects::HashedStorage::MigrationService, feature_category: :gro subject(:service) { described_class.new(project, project.full_path, logger: logger) } describe '#execute' do - context 'repository migration' do - let(:repository_service) do - Projects::HashedStorage::MigrateRepositoryService.new( - project: project, - old_disk_path: project.full_path, - logger: logger - ) - end - - it 'delegates migration to Projects::HashedStorage::MigrateRepositoryService' do - expect(service).to receive(:migrate_repository_service).and_return(repository_service) - expect(repository_service).to receive(:execute) - - service.execute - end - - it 'does not delegate migration if repository is already migrated' do - project.storage_version = ::Project::LATEST_STORAGE_VERSION - expect(Projects::HashedStorage::MigrateRepositoryService).not_to receive(:new) - - service.execute - end - - it 'migrates legacy repositories to hashed storage' do - legacy_attachments_path = FileUploader.absolute_base_dir(project) - hashed_project = project.dup.tap { |p| p.id = project.id } - hashed_project.storage_version = ::Project::HASHED_STORAGE_FEATURES[:attachments] - hashed_attachments_path = FileUploader.absolute_base_dir(hashed_project) - - expect(logger).to receive(:info).with(/Repository moved from '#{project_legacy_path}' to '#{project_hashed_path}'/) - expect(logger).to receive(:info).with(/Repository moved from '#{wiki_legacy_path}' to '#{wiki_hashed_path}'/) - expect(logger).to receive(:info).with(/Project attachments moved from '#{legacy_attachments_path}' to '#{hashed_attachments_path}'/) - - expect { service.execute }.to change { project.storage_version }.from(nil).to(2) - end - end - context 'attachments migration' do let(:project) { create(:project, :empty_repo, :wiki_repo, storage_version: ::Project::HASHED_STORAGE_FEATURES[:repository]) } @@ -62,13 +25,6 @@ RSpec.describe Projects::HashedStorage::MigrationService, feature_category: :gro ) end - it 'delegates migration to Projects::HashedStorage::MigrateRepositoryService' do - expect(service).to receive(:migrate_attachments_service).and_return(attachments_service) - expect(attachments_service).to receive(:execute) - - service.execute - end - it 'does not delegate migration if attachments are already migrated' do project.storage_version = ::Project::LATEST_STORAGE_VERSION expect(Projects::HashedStorage::MigrateAttachmentsService).not_to receive(:new) |