diff options
author | Jacob Vosmaer <jacob@gitlab.com> | 2017-08-10 18:24:44 +0200 |
---|---|---|
committer | Jacob Vosmaer <jacob@gitlab.com> | 2017-08-11 15:49:50 +0200 |
commit | fab0c1eb80b3eda00024a4e1fb961ba5b8bcc7bb (patch) | |
tree | a7c6a1fdf58f71dde6954ebd80d057e899c880bd /spec/tasks | |
parent | cfc5f0f5e4cb5a9b52aaf81d1c80c2d7774279a6 (diff) | |
download | gitlab-ce-fab0c1eb80b3eda00024a4e1fb961ba5b8bcc7bb.tar.gz |
Use existing BUNDLE_PATH for gitaly in local testsgitaly-test-bundle-path
Diffstat (limited to 'spec/tasks')
-rw-r--r-- | spec/tasks/gitlab/gitaly_rake_spec.rb | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/spec/tasks/gitlab/gitaly_rake_spec.rb b/spec/tasks/gitlab/gitaly_rake_spec.rb index 43ac1a72152..b29d63c7d67 100644 --- a/spec/tasks/gitlab/gitaly_rake_spec.rb +++ b/spec/tasks/gitlab/gitaly_rake_spec.rb @@ -54,17 +54,17 @@ describe 'gitlab:gitaly namespace rake task' do before do FileUtils.mkdir_p(clone_path) expect(Dir).to receive(:chdir).with(clone_path).and_call_original + allow(Bundler).to receive(:bundle_path).and_return('/fake/bundle_path') end context 'gmake is available' do before do expect(main_object).to receive(:checkout_or_clone_version) - allow(main_object).to receive(:run_command!).with(command_preamble + ['gmake']).and_return(true) end it 'calls gmake in the gitaly directory' do expect(Gitlab::Popen).to receive(:popen).with(%w[which gmake]).and_return(['/usr/bin/gmake', 0]) - expect(main_object).to receive(:run_command!).with(command_preamble + ['gmake']).and_return(true) + expect(main_object).to receive(:run_command!).with(command_preamble + %w[gmake BUNDLE_PATH=/fake/bundle_path]).and_return(true) run_rake_task('gitlab:gitaly:install', clone_path) end @@ -73,15 +73,26 @@ describe 'gitlab:gitaly namespace rake task' do context 'gmake is not available' do before do expect(main_object).to receive(:checkout_or_clone_version) - allow(main_object).to receive(:run_command!).with(command_preamble + ['make']).and_return(true) + expect(Gitlab::Popen).to receive(:popen).with(%w[which gmake]).and_return(['', 42]) end it 'calls make in the gitaly directory' do - expect(Gitlab::Popen).to receive(:popen).with(%w[which gmake]).and_return(['', 42]) - expect(main_object).to receive(:run_command!).with(command_preamble + ['make']).and_return(true) + expect(main_object).to receive(:run_command!).with(command_preamble + %w[make BUNDLE_PATH=/fake/bundle_path]).and_return(true) run_rake_task('gitlab:gitaly:install', clone_path) end + + context 'when Rails.env is not "test"' do + before do + allow(Rails.env).to receive(:test?).and_return(false) + end + + it 'calls make in the gitaly directory without BUNDLE_PATH' do + expect(main_object).to receive(:run_command!).with(command_preamble + ['make']).and_return(true) + + run_rake_task('gitlab:gitaly:install', clone_path) + end + end end end end |