BigW Consortium Gitlab

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

3
namespace :spinach do
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
  namespace :project do
    desc "GitLab | Spinach | Run project commits, issues and merge requests spinach features"
    task :half do
      cmds = [
        %W(rake gitlab:setup),
        %W(spinach --tags @project_commits,@project_issues,@project_merge_requests),
      ]
      run_commands(cmds)
    end

    desc "GitLab | Spinach | Run remaining project spinach features"
    task :rest do
      cmds = [
        %W(rake gitlab:setup),
        %W(spinach --tags ~@admin,~@dashboard,~@profile,~@public,~@snippets,~@project_commits,~@project_issues,~@project_merge_requests),
      ]
      run_commands(cmds)
    end
  end

24 25 26 27
  desc "GitLab | Spinach | Run project spinach features"
  task :project do
    cmds = [
      %W(rake gitlab:setup),
28
      %W(spinach --tags ~@admin,~@dashboard,~@profile,~@public,~@snippets),
29 30 31
    ]
    run_commands(cmds)
  end
32

33 34 35 36
  desc "GitLab | Spinach | Run other spinach features"
  task :other do
    cmds = [
      %W(rake gitlab:setup),
37
      %W(spinach --tags @admin,@dashboard,@profile,@public,@snippets),
38 39 40
    ]
    run_commands(cmds)
  end
41 42
end

43 44
desc "GitLab | Run spinach"
task :spinach do
45 46
  cmds = [
    %W(rake gitlab:setup),
47
    %W(spinach),
48 49 50
  ]
  run_commands(cmds)
end
51

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