Don't call load_tasks as this would load the tasks twice
Signed-off-by: Rémy Coutable <remy@rymai.me>
This commit is contained in:
parent
6a29d3a487
commit
532ad2e56e
|
@ -63,8 +63,8 @@ module TestEnv
|
||||||
# See gitlab.yml.example test section for paths
|
# See gitlab.yml.example test section for paths
|
||||||
#
|
#
|
||||||
def init(opts = {})
|
def init(opts = {})
|
||||||
Gitlab::Application.load_tasks
|
Rake.application.rake_require 'tasks/gitlab/helpers'
|
||||||
|
Rake::Task.define_task :environment
|
||||||
# Disable mailer for spinach tests
|
# Disable mailer for spinach tests
|
||||||
disable_mailer if opts[:mailer] == false
|
disable_mailer if opts[:mailer] == false
|
||||||
|
|
||||||
|
@ -128,6 +128,7 @@ module TestEnv
|
||||||
gitlab_shell_needs_update = component_needs_update?(gitlab_shell_dir,
|
gitlab_shell_needs_update = component_needs_update?(gitlab_shell_dir,
|
||||||
Gitlab::Shell.version_required)
|
Gitlab::Shell.version_required)
|
||||||
|
|
||||||
|
Rake.application.rake_require 'tasks/gitlab/shell'
|
||||||
unless !gitlab_shell_needs_update || Rake.application.invoke_task('gitlab:shell:install')
|
unless !gitlab_shell_needs_update || Rake.application.invoke_task('gitlab:shell:install')
|
||||||
FileUtils.rm_rf(gitlab_shell_dir)
|
FileUtils.rm_rf(gitlab_shell_dir)
|
||||||
raise "Can't install gitlab-shell"
|
raise "Can't install gitlab-shell"
|
||||||
|
@ -140,6 +141,7 @@ module TestEnv
|
||||||
gitaly_needs_update = component_needs_update?(gitaly_dir,
|
gitaly_needs_update = component_needs_update?(gitaly_dir,
|
||||||
Gitlab::GitalyClient.expected_server_version)
|
Gitlab::GitalyClient.expected_server_version)
|
||||||
|
|
||||||
|
Rake.application.rake_require 'tasks/gitlab/gitaly'
|
||||||
unless !gitaly_needs_update || Rake.application.invoke_task("gitlab:gitaly:install[#{gitaly_dir}]")
|
unless !gitaly_needs_update || Rake.application.invoke_task("gitlab:gitaly:install[#{gitaly_dir}]")
|
||||||
FileUtils.rm_rf(gitaly_dir)
|
FileUtils.rm_rf(gitaly_dir)
|
||||||
raise "Can't install gitaly"
|
raise "Can't install gitaly"
|
||||||
|
|
|
@ -41,8 +41,6 @@ describe 'gitlab:gitaly namespace rake task' do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'gmake/make' do
|
describe 'gmake/make' do
|
||||||
let(:command_preamble) { %w[/usr/bin/env -u BUNDLE_GEMFILE] }
|
|
||||||
|
|
||||||
before(:all) do
|
before(:all) do
|
||||||
@old_env_ci = ENV.delete('CI')
|
@old_env_ci = ENV.delete('CI')
|
||||||
end
|
end
|
||||||
|
@ -59,12 +57,12 @@ describe 'gitlab:gitaly namespace rake task' do
|
||||||
context 'gmake is available' do
|
context 'gmake is available' do
|
||||||
before do
|
before do
|
||||||
expect_any_instance_of(Object).to receive(:checkout_or_clone_version)
|
expect_any_instance_of(Object).to receive(:checkout_or_clone_version)
|
||||||
allow_any_instance_of(Object).to receive(:run_command!).with(command_preamble + ['gmake']).and_return(true)
|
allow_any_instance_of(Object).to receive(:run_command!).with(['gmake']).and_return(true)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'calls gmake in the gitaly directory' do
|
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(Gitlab::Popen).to receive(:popen).with(%w[which gmake]).and_return(['/usr/bin/gmake', 0])
|
||||||
expect_any_instance_of(Object).to receive(:run_command!).with(command_preamble + ['gmake']).and_return(true)
|
expect_any_instance_of(Object).to receive(:run_command!).with(['gmake']).and_return(true)
|
||||||
|
|
||||||
run_rake_task('gitlab:gitaly:install', clone_path)
|
run_rake_task('gitlab:gitaly:install', clone_path)
|
||||||
end
|
end
|
||||||
|
@ -73,12 +71,12 @@ describe 'gitlab:gitaly namespace rake task' do
|
||||||
context 'gmake is not available' do
|
context 'gmake is not available' do
|
||||||
before do
|
before do
|
||||||
expect_any_instance_of(Object).to receive(:checkout_or_clone_version)
|
expect_any_instance_of(Object).to receive(:checkout_or_clone_version)
|
||||||
allow_any_instance_of(Object).to receive(:run_command!).with(command_preamble + ['make']).and_return(true)
|
allow_any_instance_of(Object).to receive(:run_command!).with(['make']).and_return(true)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'calls make in the gitaly directory' do
|
it 'calls make in the gitaly directory' do
|
||||||
expect(Gitlab::Popen).to receive(:popen).with(%w[which gmake]).and_return(['', 42])
|
expect(Gitlab::Popen).to receive(:popen).with(%w[which gmake]).and_return(['', 42])
|
||||||
expect_any_instance_of(Object).to receive(:run_command!).with(command_preamble + ['make']).and_return(true)
|
expect_any_instance_of(Object).to receive(:run_command!).with(['make']).and_return(true)
|
||||||
|
|
||||||
run_rake_task('gitlab:gitaly:install', clone_path)
|
run_rake_task('gitlab:gitaly:install', clone_path)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue