gitlab-org--gitlab-foss/lib/tasks/spec.rake

38 lines
704 B
Ruby
Raw Normal View History

2014-04-11 15:45:56 -04:00
Rake::Task["spec"].clear if Rake::Task.task_defined?('spec')
2014-04-11 07:31:37 -04:00
2014-04-11 15:45:56 -04:00
namespace :spec do
2014-04-11 07:31:37 -04:00
desc 'GITLAB | Run feature specs'
2014-04-11 15:45:56 -04:00
task :api do
2014-04-11 07:31:37 -04:00
cmds = [
%W(rake gitlab:setup),
2014-04-11 15:45:56 -04:00
%W(rspec spec --tag @api)
2014-04-11 07:31:37 -04:00
]
run_commands(cmds)
end
2014-04-11 07:31:37 -04:00
desc 'GITLAB | Run other specs'
task :other do
cmds = [
%W(rake gitlab:setup),
2014-04-11 15:45:56 -04:00
%W(rspec spec --tag ~@api)
2014-04-11 07:31:37 -04:00
]
run_commands(cmds)
end
2014-04-11 15:45:56 -04:00
end
desc "GITLAB | Run specs"
task :spec do
cmds = [
%W(rake gitlab:setup),
%W(rspec spec),
]
run_commands(cmds)
end
2014-04-11 15:45:56 -04:00
def run_commands(cmds)
cmds.each do |cmd|
system({'RAILS_ENV' => 'test', 'force' => 'yes'}, *cmd)
raise "#{cmd} failed!" unless $?.exitstatus.zero?
end
end