diff options
author | Alejandro RodrÃguez <alejorro70@gmail.com> | 2016-07-25 16:18:33 -0400 |
---|---|---|
committer | Alejandro RodrÃguez <alejorro70@gmail.com> | 2016-07-27 11:13:19 -0400 |
commit | 0625d469d6645d90eeab18449b70b6d2463085ce (patch) | |
tree | d929996b6ebdc342bcb1c60b758a54b95725ee93 /spec/gitlab_projects_spec.rb | |
parent | 522567afca91f2e04871e3d9bf8e9884f48a9855 (diff) | |
download | gitlab-shell-mv-storage.tar.gz |
Track ongoing pushes and reject mv-storage commands if there are push running (after waiting some time)mv-storage
Diffstat (limited to 'spec/gitlab_projects_spec.rb')
-rw-r--r-- | spec/gitlab_projects_spec.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/gitlab_projects_spec.rb b/spec/gitlab_projects_spec.rb index 5e50af0..19646e3 100644 --- a/spec/gitlab_projects_spec.rb +++ b/spec/gitlab_projects_spec.rb @@ -213,6 +213,7 @@ describe GitlabProjects do before do FileUtils.mkdir_p(tmp_repo_path) FileUtils.mkdir_p(alternative_storage_path) + allow_any_instance_of(GitlabReferenceCounter).to receive(:value).and_return(0) end after { FileUtils.rm_rf(alternative_storage_path) } @@ -235,6 +236,12 @@ describe GitlabProjects do bad_source.exec.should be_false end + it "should fail if there are pushes ongoing" do + allow_any_instance_of(GitlabReferenceCounter).to receive(:value).and_return(1) + $logger.should_receive(:error).with("mv-storage failed: source path <#{tmp_repo_path}> is waiting for pushes to finish.") + gl_projects.exec.should be_false + end + it "should log an mv-storage event" do message = "Syncing project #{repo_name} from <#{tmp_repo_path}> to <#{new_repo_path}>." $logger.should_receive(:info).with(message) |