Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlejandro Rodríguez <alejorro70@gmail.com>2017-04-11 02:15:48 +0300
committerAlejandro Rodríguez <alejorro70@gmail.com>2017-04-13 23:32:00 +0300
commite61325ff432db669012a1291f5f2332eb5b0d43f (patch)
tree866f5333f816f3bc10e5ee05ab963789bb132519 /spec/tasks/gitlab/gitaly_rake_spec.rb
parent0fa00e8461bc70d20006de4e2e30d07eabda1e69 (diff)
Expand components version specification format to allow branches
Currently we specify versions for Gitlab-Shell, Workhorse and Gitaly using version strings, to which we prepend 'v' and assume are tags. These changes allow branches or tags with other name formats to be specified by prepending '=' to the version string (á la govendor). We also simplify the process to reset to the given version (now a branch or tag): Right now there's a check to supposedly try to avoid fetching from the remote the version if it already exist locally. But the previous logic already clones if the directory doesn't exist or fetches if it does, so this check is pointless. We can safely assume the version exists once we get to the reset stage.
Diffstat (limited to 'spec/tasks/gitlab/gitaly_rake_spec.rb')
-rw-r--r--spec/tasks/gitlab/gitaly_rake_spec.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/tasks/gitlab/gitaly_rake_spec.rb b/spec/tasks/gitlab/gitaly_rake_spec.rb
index b369dcbb305..aaf998a546f 100644
--- a/spec/tasks/gitlab/gitaly_rake_spec.rb
+++ b/spec/tasks/gitlab/gitaly_rake_spec.rb
@@ -8,7 +8,7 @@ describe 'gitlab:gitaly namespace rake task' do
describe 'install' do
let(:repo) { 'https://gitlab.com/gitlab-org/gitaly.git' }
let(:clone_path) { Rails.root.join('tmp/tests/gitaly').to_s }
- let(:tag) { "v#{File.read(Rails.root.join(Gitlab::GitalyClient::SERVER_VERSION_FILE)).chomp}" }
+ let(:version) { File.read(Rails.root.join(Gitlab::GitalyClient::SERVER_VERSION_FILE)).chomp }
context 'no dir given' do
it 'aborts and display a help message' do
@@ -21,7 +21,7 @@ describe 'gitlab:gitaly namespace rake task' do
context 'when an underlying Git command fail' do
it 'aborts and display a help message' do
expect_any_instance_of(Object).
- to receive(:checkout_or_clone_tag).and_raise 'Git error'
+ to receive(:checkout_or_clone_version).and_raise 'Git error'
expect { run_rake_task('gitlab:gitaly:install', clone_path) }.to raise_error 'Git error'
end
@@ -32,9 +32,9 @@ describe 'gitlab:gitaly namespace rake task' do
expect(Dir).to receive(:chdir).with(clone_path)
end
- it 'calls checkout_or_clone_tag with the right arguments' do
+ it 'calls checkout_or_clone_version with the right arguments' do
expect_any_instance_of(Object).
- to receive(:checkout_or_clone_tag).with(tag: tag, repo: repo, target_dir: clone_path)
+ to receive(:checkout_or_clone_version).with(version: version, repo: repo, target_dir: clone_path)
run_rake_task('gitlab:gitaly:install', clone_path)
end
@@ -48,7 +48,7 @@ describe 'gitlab:gitaly namespace rake task' do
context 'gmake is available' do
before do
- expect_any_instance_of(Object).to receive(:checkout_or_clone_tag)
+ expect_any_instance_of(Object).to receive(:checkout_or_clone_version)
allow_any_instance_of(Object).to receive(:run_command!).with(['gmake']).and_return(true)
end
@@ -62,7 +62,7 @@ describe 'gitlab:gitaly namespace rake task' do
context 'gmake is not available' do
before do
- expect_any_instance_of(Object).to receive(:checkout_or_clone_tag)
+ expect_any_instance_of(Object).to receive(:checkout_or_clone_version)
allow_any_instance_of(Object).to receive(:run_command!).with(['make']).and_return(true)
end