gitlab-org--gitlab-foss/lib/tasks/spec.rake
Dmitriy Zaporozhets e426d43924
Check return system value for gitlab test rake tasks
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-05-26 21:54:57 +03:00

46 lines
867 B
Ruby

Rake::Task["spec"].clear if Rake::Task.task_defined?('spec')
namespace :spec do
desc 'GITLAB | Run request specs'
task :api do
cmds = [
%W(rake gitlab:setup),
%W(rspec spec --tag @api)
]
run_commands(cmds)
end
desc 'GITLAB | Run feature specs'
task :feature do
cmds = [
%W(rake gitlab:setup),
%W(rspec spec --tag @feature)
]
run_commands(cmds)
end
desc 'GITLAB | Run other specs'
task :other do
cmds = [
%W(rake gitlab:setup),
%W(rspec spec --tag ~@api --tag ~@feature)
]
run_commands(cmds)
end
end
desc "GITLAB | Run specs"
task :spec do
cmds = [
%W(rake gitlab:setup),
%W(rspec spec),
]
run_commands(cmds)
end
def run_commands(cmds)
cmds.each do |cmd|
system({'RAILS_ENV' => 'test', 'force' => 'yes'}, *cmd) ||
raise "#{cmd} failed!"
end
end