Commit db779388fee09b14ee591d9cb4981bdae3d23be9

Authored by Dmitriy Zaporozhets
2 parents 08c3c065 e84057da

Merge pull request #7075 from jvanbaarsen/split-spinach-tests

Splitted the Spinach tests to prevent time-outs
.travis.yml
... ... @@ -3,12 +3,14 @@ env:
3 3 global:
4 4 - TRAVIS=true
5 5 matrix:
6   - - TASK=spinach DB=mysql
  6 + - TASK=spinach_project DB=mysql
  7 + - TASK=spinach_other DB=mysql
7 8 - TASK=spec:api DB=mysql
8 9 - TASK=spec:feature DB=mysql
9 10 - TASK=spec:other DB=mysql
10 11 - TASK=jasmine:ci DB=mysql
11   - - TASK=spinach DB=postgresql
  12 + - TASK=spinach_project DB=postgresql
  13 + - TASK=spinach_other DB=postgresql
12 14 - TASK=spec:api DB=postgresql
13 15 - TASK=spec:feature DB=postgresql
14 16 - TASK=spec:other DB=postgresql
... ...
features/admin/active_tab.feature
  1 +@admin
1 2 Feature: Admin active tab
2 3 Background:
3 4 Given I sign in as an admin
... ...
features/admin/broadcast_messages.feature
  1 +@admin
1 2 Feature: Admin Broadcast Messages
2 3 Background:
3 4 Given I sign in as an admin
... ...
features/admin/groups.feature
  1 +@admin
1 2 Feature: Admin Groups
2 3 Background:
3 4 Given I sign in as an admin
... ...
features/admin/logs.feature
  1 +@admin
1 2 Feature: Admin Logs
2 3 Background:
3 4 Given I sign in as an admin
... ...
features/admin/projects.feature
  1 +@admin
1 2 Feature: Admin Projects
2 3 Background:
3 4 Given I sign in as an admin
... ...
features/admin/users.feature
  1 +@admin
1 2 Feature: Admin Users
2 3 Background:
3 4 Given I sign in as an admin
... ...
features/dashboard/active_tab.feature
  1 +@dashboard
1 2 Feature: Dashboard active tab
2 3 Background:
3 4 Given I sign in as a user
... ...
features/dashboard/archived_projects.feature
  1 +@dashboard
1 2 Feature: Dashboard with archived projects
2 3 Background:
3 4 Given I sign in as a user
... ...
features/dashboard/dashboard.feature
  1 +@dashboard
1 2 Feature: Dashboard
2 3 Background:
3 4 Given I sign in as a user
... ...
features/dashboard/event_filters.feature
  1 +@dashboard
1 2 Feature: Event filters
2 3 Background:
3 4 Given I sign in as a user
... ...
features/dashboard/help.feature
  1 +@dashboard
1 2 Feature: Help
2 3 Background:
3 4 Given I sign in as a user
... ...
features/dashboard/issues.feature
  1 +@dashboard
1 2 Feature: Dashboard Issues
2 3 Background:
3 4 Given I sign in as a user
... ...
features/dashboard/merge_requests.feature
  1 +@dashboard
1 2 Feature: Dashboard Merge Requests
2 3 Background:
3 4 Given I sign in as a user
... ...
features/dashboard/projects.feature
  1 +@dashboard
1 2 Feature: Dashboard projects
2 3 Background:
3 4 Given I sign in as a user
... ...
features/dashboard/search.feature
  1 +@dashboard
1 2 Feature: Dashboard Search
2 3 Background:
3 4 Given I sign in as a user
... ...
features/profile/active_tab.feature
  1 +@profile
1 2 Feature: Profile active tab
2 3 Background:
3 4 Given I sign in as a user
... ...
features/profile/emails.feature
  1 +@profile
1 2 Feature: Profile Emails
2 3 Background:
3 4 Given I sign in as a user
... ...
features/profile/group.feature
  1 +@profile
1 2 Feature: Profile Group
2 3 Background:
3 4 Given I sign in as "John Doe"
... ...
features/profile/notifications.feature
  1 +@profile
1 2 Feature: Profile Notifications
2 3 Background:
3 4 Given I sign in as a user
... ...
features/profile/profile.feature
  1 +@profile
1 2 Feature: Profile
2 3 Background:
3 4 Given I sign in as a user
... ...
features/profile/ssh_keys.feature
  1 +@profile
1 2 Feature: Profile SSH Keys
2 3 Background:
3 4 Given I sign in as a user
... ...
features/public/projects.feature
  1 +@public
1 2 Feature: Public Projects Feature
2 3 Background:
3 4 Given public project "Community"
... ...
features/public/public_groups.feature
  1 +@public
1 2 Feature: Public Projects Feature
2 3 Background:
3 4 Given group "TestGroup" has private project "Enterprise"
... ...
features/snippets/discover.feature
  1 +@snippets
1 2 Feature: Discover Snippets
2 3 Background:
3 4 Given I sign in as a user
... ...
features/snippets/snippets.feature
  1 +@snippets
1 2 Feature: Snippets Feature
2 3 Background:
3 4 Given I sign in as a user
... ...
features/snippets/user.feature
  1 +@snippets
1 2 Feature: User Snippets
2 3 Background:
3 4 Given I sign in as a user
... ...
lib/tasks/spinach.rake
... ... @@ -6,7 +6,28 @@ task :spinach do
6 6 %W(rake gitlab:setup),
7 7 %W(spinach),
8 8 ]
  9 + run_commands(cmds)
  10 +end
  11 +
  12 +desc "GITLAB | Run project spinach features"
  13 +task :spinach_project do
  14 + cmds = [
  15 + %W(rake gitlab:setup),
  16 + %W(spinach --tags ~@admin,~@dashboard,~@profile,~@public,~@snippets),
  17 + ]
  18 + run_commands(cmds)
  19 +end
  20 +
  21 +desc "GITLAB | Run other spinach features"
  22 +task :spinach_other do
  23 + cmds = [
  24 + %W(rake gitlab:setup),
  25 + %W(spinach --tags @admin,@dashboard,@profile,@public,@snippets),
  26 + ]
  27 + run_commands(cmds)
  28 +end
9 29  
  30 +def run_commands(cmds)
10 31 cmds.each do |cmd|
11 32 system({'RAILS_ENV' => 'test', 'force' => 'yes'}, *cmd) or raise("#{cmd} failed!")
12 33 end
... ...