summaryrefslogtreecommitdiff
path: root/spec/workers
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2018-06-12 13:32:46 +0000
committerDouwe Maan <douwe@gitlab.com>2018-06-12 13:32:46 +0000
commit8b0d2283d77df0e99f5f49db3f78f6101ac1b8ef (patch)
treea3b9796d29da06ddf83fbe8dec1def9b972bec65 /spec/workers
parenta2785eb82e0e016c71ed3d5d7747c52e6a2e9682 (diff)
parentf376347f24f24efc157d80de63381dd22d060630 (diff)
downloadgitlab-ce-8b0d2283d77df0e99f5f49db3f78f6101ac1b8ef.tar.gz
Merge branch 'gitaly-disk-access-3' into 'master'
Find and mark more Git disk access locations, part 2 See merge request gitlab-org/gitlab-ce!19437
Diffstat (limited to 'spec/workers')
-rw-r--r--spec/workers/git_garbage_collect_worker_spec.rb8
-rw-r--r--spec/workers/project_destroy_worker_spec.rb6
-rw-r--r--spec/workers/repository_fork_worker_spec.rb3
3 files changed, 14 insertions, 3 deletions
diff --git a/spec/workers/git_garbage_collect_worker_spec.rb b/spec/workers/git_garbage_collect_worker_spec.rb
index f44b4edc305..807d1b8c084 100644
--- a/spec/workers/git_garbage_collect_worker_spec.rb
+++ b/spec/workers/git_garbage_collect_worker_spec.rb
@@ -218,7 +218,9 @@ describe GitGarbageCollectWorker do
# Create a new commit on a random new branch
def create_objects(project)
- rugged = project.repository.rugged
+ rugged = Gitlab::GitalyClient::StorageSettings.allow_disk_access do
+ project.repository.rugged
+ end
old_commit = rugged.branches.first.target
new_commit_sha = Rugged::Commit.create(
rugged,
@@ -237,7 +239,9 @@ describe GitGarbageCollectWorker do
end
def packs(project)
- Dir["#{project.repository.path_to_repo}/objects/pack/*.pack"]
+ Gitlab::GitalyClient::StorageSettings.allow_disk_access do
+ Dir["#{project.repository.path_to_repo}/objects/pack/*.pack"]
+ end
end
def packed_refs(project)
diff --git a/spec/workers/project_destroy_worker_spec.rb b/spec/workers/project_destroy_worker_spec.rb
index f19c9dff941..42e1d86e3bb 100644
--- a/spec/workers/project_destroy_worker_spec.rb
+++ b/spec/workers/project_destroy_worker_spec.rb
@@ -2,7 +2,11 @@ require 'spec_helper'
describe ProjectDestroyWorker do
let(:project) { create(:project, :repository, pending_delete: true) }
- let(:path) { project.repository.path_to_repo }
+ let(:path) do
+ Gitlab::GitalyClient::StorageSettings.allow_disk_access do
+ project.repository.path_to_repo
+ end
+ end
subject { described_class.new }
diff --git a/spec/workers/repository_fork_worker_spec.rb b/spec/workers/repository_fork_worker_spec.rb
index ae4786389c7..5d83397e8df 100644
--- a/spec/workers/repository_fork_worker_spec.rb
+++ b/spec/workers/repository_fork_worker_spec.rb
@@ -94,6 +94,9 @@ describe RepositoryForkWorker do
it_behaves_like 'RepositoryForkWorker performing'
it 'logs a message about forking with old-style arguments' do
+ allow(subject).to receive(:gitlab_shell).and_return(shell)
+ expect(shell).to receive(:fork_repository) { true }
+
allow(Rails.logger).to receive(:info).with(anything) # To compensate for other logs
expect(Rails.logger).to receive(:info).with("Project #{fork_project.id} is being forked using old-style arguments.")