debian-mirror-gitlab/lib/tasks/spec.rake

55 lines
1.1 KiB
Ruby
Raw Normal View History

2014-09-02 18:07:02 +05:30
Rake::Task["spec"].clear if Rake::Task.task_defined?('spec')
namespace :spec do
2015-09-11 14:41:01 +05:30
desc 'GitLab | Rspec | Run request specs'
2014-09-02 18:07:02 +05:30
task :api do
cmds = [
%W(rake gitlab:setup),
%W(rspec spec --tag @api)
]
run_commands(cmds)
end
2015-09-11 14:41:01 +05:30
desc 'GitLab | Rspec | Run feature specs'
2014-09-02 18:07:02 +05:30
task :feature do
cmds = [
%W(rake gitlab:setup),
%W(rspec spec --tag @feature)
]
run_commands(cmds)
end
2015-10-24 18:46:33 +05:30
desc 'GitLab | Rspec | Run benchmark specs'
task :benchmark do
cmds = [
%W(rake gitlab:setup),
%W(rspec spec --tag @benchmark)
]
run_commands(cmds)
end
2015-09-11 14:41:01 +05:30
desc 'GitLab | Rspec | Run other specs'
2014-09-02 18:07:02 +05:30
task :other do
cmds = [
%W(rake gitlab:setup),
2015-10-24 18:46:33 +05:30
%W(rspec spec --tag ~@api --tag ~@feature --tag ~@benchmark)
2014-09-02 18:07:02 +05:30
]
run_commands(cmds)
end
end
2015-09-11 14:41:01 +05:30
desc "GitLab | Run specs"
2014-09-02 18:07:02 +05:30
task :spec do
cmds = [
%W(rake gitlab:setup),
2015-10-24 18:46:33 +05:30
%W(rspec spec --tag ~@benchmark),
2014-09-02 18:07:02 +05:30
]
run_commands(cmds)
end
def run_commands(cmds)
cmds.each do |cmd|
system({'RAILS_ENV' => 'test', 'force' => 'yes'}, *cmd) or raise("#{cmd} failed!")
end
end