Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
e7ed280e
Commit
e7ed280e
authored
Apr 01, 2019
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor spec for Geo::ProjectRegistryFinder
parent
74eae236
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
185 additions
and
221 deletions
+185
-221
ee/app/finders/geo/project_registry_finder.rb
ee/app/finders/geo/project_registry_finder.rb
+18
-14
ee/spec/finders/geo/project_registry_finder_spec.rb
ee/spec/finders/geo/project_registry_finder_spec.rb
+167
-207
No files found.
ee/app/finders/geo/project_registry_finder.rb
View file @
e7ed280e
...
...
@@ -163,12 +163,16 @@ module Geo
private
def
fdw_disabled?
!
Gitlab
::
Geo
::
Fdw
.
enabled?
end
def
use_legacy_queries_for_selective_sync?
selective_sync?
&&
!
Gitlab
::
Geo
::
Fdw
.
enabled_for_selective_sync?
fdw_disabled?
||
selective_sync?
&&
!
Gitlab
::
Geo
::
Fdw
.
enabled_for_selective_sync?
end
def
finder_klass_for_synced_registries
if
!
Gitlab
::
Geo
::
Fdw
.
enabled?
||
use_legacy_queries_for_selective_sync?
if
use_legacy_queries_for_selective_sync?
Geo
::
LegacyProjectRegistrySyncedFinder
else
Geo
::
ProjectRegistrySyncedFinder
...
...
@@ -182,7 +186,7 @@ module Geo
end
def
finder_klass_for_failed_registries
if
!
Gitlab
::
Geo
::
Fdw
.
enabled?
||
use_legacy_queries_for_selective_sync?
if
use_legacy_queries_for_selective_sync?
Geo
::
LegacyProjectRegistrySyncFailedFinder
else
Geo
::
ProjectRegistrySyncFailedFinder
...
...
@@ -196,7 +200,7 @@ module Geo
end
def
finder_klass_for_verified_registries
if
!
Gitlab
::
Geo
::
Fdw
.
enabled?
||
use_legacy_queries_for_selective_sync?
if
use_legacy_queries_for_selective_sync?
Geo
::
LegacyProjectRegistryVerifiedFinder
else
Geo
::
ProjectRegistryVerifiedFinder
...
...
@@ -210,10 +214,10 @@ module Geo
end
def
finder_klass_for_verification_failed_registries
if
Gitlab
::
Geo
::
Fdw
.
enabled_for_selective_sync?
Geo
::
ProjectRegistryVerificationFailedFinder
else
if
use_legacy_queries_for_selective_sync?
Geo
::
LegacyProjectRegistryVerificationFailedFinder
else
Geo
::
ProjectRegistryVerificationFailedFinder
end
end
...
...
@@ -224,10 +228,10 @@ module Geo
end
def
finder_klass_for_registries_retrying_verification
if
Gitlab
::
Geo
::
Fdw
.
enabled_for_selective_sync?
Geo
::
ProjectRegistryRetryingVerificationFinder
else
if
use_legacy_queries_for_selective_sync?
Geo
::
LegacyProjectRegistryRetryingVerificationFinder
else
Geo
::
ProjectRegistryRetryingVerificationFinder
end
end
...
...
@@ -238,10 +242,10 @@ module Geo
end
def
finder_klass_for_mismatch_registries
if
Gitlab
::
Geo
::
Fdw
.
enabled_for_selective_sync?
Geo
::
ProjectRegistryMismatchFinder
else
if
use_legacy_queries_for_selective_sync?
Geo
::
LegacyProjectRegistryMismatchFinder
else
Geo
::
ProjectRegistryMismatchFinder
end
end
...
...
@@ -252,7 +256,7 @@ module Geo
end
def
finder_klass_for_registries_pending_verification
if
!
Gitlab
::
Geo
::
Fdw
.
enabled?
||
use_legacy_queries_for_selective_sync?
if
use_legacy_queries_for_selective_sync?
Geo
::
LegacyProjectRegistryPendingVerificationFinder
else
Geo
::
ProjectRegistryPendingVerificationFinder
...
...
ee/spec/finders/geo/project_registry_finder_spec.rb
View file @
e7ed280e
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment