diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2019-01-08 03:07:02 +0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2019-01-08 03:07:02 +0300 |
commit | 31f2c7b00ee52516c288b1b2f7e2064897e36ad8 (patch) | |
tree | 4e40daa89f18eb34642d58855b9ed63df0c087e8 /spec/services | |
parent | 30572739b0664da481d4cded68c91c7d13246e93 (diff) | |
parent | ee4af0c64cdf00d2c34ce7feb773e057f9758cff (diff) |
Merge branch '53966-hashed-storage-read-only' into 'master'
Hashed Storage: Only set as `read_only` when starting the per-project migration
See merge request gitlab-org/gitlab-ce!24128
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/projects/hashed_storage/migrate_repository_service_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/services/projects/hashed_storage/migrate_repository_service_spec.rb b/spec/services/projects/hashed_storage/migrate_repository_service_spec.rb index 0e82194e9ee..b720f37ffdb 100644 --- a/spec/services/projects/hashed_storage/migrate_repository_service_spec.rb +++ b/spec/services/projects/hashed_storage/migrate_repository_service_spec.rb @@ -15,6 +15,20 @@ describe Projects::HashedStorage::MigrateRepositoryService do allow(service).to receive(:gitlab_shell) { gitlab_shell } end + context 'repository lock' do + it 'tries to lock the repository' do + expect(service).to receive(:try_to_set_repository_read_only!) + + service.execute + end + + it 'fails when a git operation is in progress' do + allow(project).to receive(:repo_reference_count) { 1 } + + expect { service.execute }.to raise_error(Projects::HashedStorage::RepositoryMigrationError) + end + end + context 'when succeeds' do it 'renames project and wiki repositories' do service.execute |