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
7e68a460
Commit
7e68a460
authored
Nov 27, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract shared example to run when PostgreSQL FDW is enabled/disabled
parent
c21a1169
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
spec/workers/geo/repository_sync_worker_spec.rb
spec/workers/geo/repository_sync_worker_spec.rb
+18
-1
No files found.
spec/workers/geo/repository_sync_worker_spec.rb
View file @
7e68a460
...
...
@@ -16,7 +16,11 @@ describe Geo::RepositorySyncWorker, :geo, :truncate do
stub_current_geo_node
(
secondary
)
end
describe
'#perform'
do
shared_examples
'#perform'
do
|
skip_tests
|
before
do
skip
(
'FDW is not configured'
)
if
skip_tests
end
before
do
allow_any_instance_of
(
Gitlab
::
ExclusiveLease
).
to
receive
(
:try_obtain
)
{
true
}
allow_any_instance_of
(
Gitlab
::
ExclusiveLease
).
to
receive
(
:renew
)
{
true
}
...
...
@@ -168,4 +172,17 @@ describe Geo::RepositorySyncWorker, :geo, :truncate do
end
end
end
describe
'when PostgreSQL FDW is available'
,
:geo
do
# Skip if FDW isn't activated on this database
it_behaves_like
'#perform'
,
Gitlab
::
Database
.
postgresql?
&&
!
Gitlab
::
Geo
.
fdw?
end
describe
'when PostgreSQL FDW is not enabled'
,
:geo
do
before
do
allow
(
Gitlab
::
Geo
).
to
receive
(
:fdw?
).
and_return
(
false
)
end
it_behaves_like
'#perform'
,
false
end
end
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