gitlab-org--gitlab-foss/spec
Thong Kuah 885ea5c33c Make subgroup specs :nested_groups
Subgroups are not supported in mySQL. I changed Namespace#root_ancestor
to return from self_and_ancestors as a bugfix.

```
  184   # Returns all the ancestors of the current namespaces
  185   def ancestors
  186     return self.class.none unless parent_id
  187
  188     Gitlab::GroupHierarchy
  189       .new(self.class.where(id: parent_id))
  190       .base_and_ancestors
  191   end
```

So it seems like on mySQL we accidentally returned the parent group :

```
ancestors = self.class.where(id: parent_id)
ancestors.reorder(nil).find_by(parent_id: nil)
```

Project#root_namespace is used only by shared_runners_limit_namespace
and all the tests for shared_runner_minutes_on_root_namespace are only
enabled on `:nested_groups`

`when :shared_runner_minutes_on_root_namespace is enabled', :nested_groups`

We very clearly state in https://docs.gitlab.com/ee/user/group/subgroups/ that `
Nested groups are only supported when you use PostgreSQL`, so I think I
will fix forward and add `:nested_groups` to the two failing feature
specs.
2018-12-05 10:16:44 +13:00
..
bin
config
controllers Merge branch 'ce-7210-add-sort-direction-button-sort-dropdown' into 'master' 2018-12-04 15:04:35 +00:00
db
dependencies
factories Fallback to admin token for project clusters only 2018-12-04 15:44:33 +13:00
features Make subgroup specs :nested_groups 2018-12-05 10:16:44 +13:00
finders
fixtures Update Dependency Scanning report fixtures 2018-12-03 14:01:05 +01:00
graphql
helpers
initializers
javascripts Updated variable name to forceExpanded 2018-12-04 13:27:18 +00:00
lib Various improvements to hierarchy sorting 2018-12-05 10:16:44 +13:00
mailers Merge branch 'security-guest-comments' into 'master' 2018-11-28 19:11:56 -05:00
migrations Merge commit '83f0798e7dc588f0e4cb6816daadeef7dbfc8b81' into fix/gb/encrypt-runners-tokens 2018-12-04 09:11:33 +01:00
models Eager load clusters to prevent N+1 2018-12-05 10:16:44 +13:00
policies Merge branch 'security-guest-comments' into 'master' 2018-11-28 19:11:56 -05:00
presenters
rack_servers
requests CE port Refactor Gitlab::Checks::ChangeAccess class 2018-12-04 11:55:49 +00:00
routing Revert "Resolve "[Rails5] `ActionView::MissingTemplate` in spec/features/projects/wiki/user_views_wiki_page_spec.rb"" 2018-12-03 12:28:51 +01:00
rubocop
serializers
services Create k8s namespace for project in group clusters 2018-12-05 10:16:44 +13:00
sidekiq/cron
support Modify service so that it can be re-run 2018-12-05 10:16:44 +13:00
tasks
uploaders
validators Merge branch 'security-fj-crlf-injection' into 'master' 2018-11-28 19:14:06 -05:00
views
workers Create k8s namespace for project in group clusters 2018-12-05 10:16:44 +13:00
factories_spec.rb
fast_spec_helper.rb
rails_helper.rb
rake_helper.rb
simplecov_env.rb
spec_helper.rb