BigW Consortium Gitlab

spec.rake 1.08 KB
Newer Older
1
Rake::Task["spec"].clear if Rake::Task.task_defined?('spec')
2

3
namespace :spec do
4
  desc 'GitLab | Rspec | Run request specs'
5
  task :api do
6 7
    cmds = [
      %W(rake gitlab:setup),
8
      %W(rspec spec --tag @api)
9 10 11
    ]
    run_commands(cmds)
  end
12

13
  desc 'GitLab | Rspec | Run feature specs'
14 15 16 17 18 19 20 21
  task :feature do
    cmds = [
      %W(rake gitlab:setup),
      %W(rspec spec --tag @feature)
    ]
    run_commands(cmds)
  end

22 23 24 25 26 27 28 29 30
  desc 'GitLab | Rspec | Run benchmark specs'
  task :benchmark do
    cmds = [
      %W(rake gitlab:setup),
      %W(rspec spec --tag @benchmark)
    ]
    run_commands(cmds)
  end

31
  desc 'GitLab | Rspec | Run other specs'
32 33 34
  task :other do
    cmds = [
      %W(rake gitlab:setup),
35
      %W(rspec spec --tag ~@api --tag ~@feature --tag ~@benchmark)
36 37 38
    ]
    run_commands(cmds)
  end
39 40
end

41
desc "GitLab | Run specs"
42 43 44
task :spec do
  cmds = [
    %W(rake gitlab:setup),
45
    %W(rspec spec --tag ~@benchmark),
46 47 48
  ]
  run_commands(cmds)
end
49

50 51
def run_commands(cmds)
  cmds.each do |cmd|
Dmitriy Zaporozhets committed
52
    system({'RAILS_ENV' => 'test', 'force' => 'yes'}, *cmd) or raise("#{cmd} failed!")
53 54
  end
end