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
c75908f9
Commit
c75908f9
authored
Apr 11, 2017
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix typo: NotImplemented -> NotImplementedError
parent
97aa4542
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
1 deletion
+17
-1
lib/gitlab/geo/health_check.rb
lib/gitlab/geo/health_check.rb
+1
-1
spec/lib/gitlab/geo/health_check_spec.rb
spec/lib/gitlab/geo/health_check_spec.rb
+12
-0
spec/requests/api/geo_spec.rb
spec/requests/api/geo_spec.rb
+4
-0
No files found.
lib/gitlab/geo/health_check.rb
View file @
c75908f9
...
...
@@ -51,7 +51,7 @@ module Gitlab
end
def
self
.
database_secondary?
raise
NotImplemented
unless
Gitlab
::
Database
.
postgresql?
raise
NotImplemented
Error
unless
Gitlab
::
Database
.
postgresql?
ActiveRecord
::
Base
.
connection
.
execute
(
'SELECT pg_is_in_recovery()'
)
.
first
...
...
spec/lib/gitlab/geo/health_check_spec.rb
View file @
c75908f9
...
...
@@ -6,6 +6,10 @@ describe Gitlab::Geo::HealthCheck do
subject
{
described_class
}
describe
'.perform_checks'
do
before
do
skip
(
"Not using PostgreSQL"
)
unless
Gitlab
::
Database
.
postgresql?
end
it
'returns an empty string when not running on a secondary node'
do
allow
(
Gitlab
::
Geo
).
to
receive
(
:secondary?
)
{
false
}
...
...
@@ -38,4 +42,12 @@ describe Gitlab::Geo::HealthCheck do
expect
(
subject
.
perform_checks
).
not_to
be_blank
end
end
describe
'MySQL checks'
do
it
'raises an error'
do
allow
(
Gitlab
::
Database
).
to
receive
(
:postgresql?
)
{
false
}
expect
{
subject
.
perform_checks
}.
to
raise_error
(
NotImplementedError
)
end
end
end
spec/requests/api/geo_spec.rb
View file @
c75908f9
...
...
@@ -277,6 +277,10 @@ describe API::Geo, api: true do
let!
(
:secondary_node
)
{
create
(
:geo_node
)
}
let
(
:request
)
{
Gitlab
::
Geo
::
BaseRequest
.
new
}
before
do
skip
(
"Not using PostgreSQL"
)
unless
Gitlab
::
Database
.
postgresql?
end
it
'responds with 401 with invalid auth header'
do
get
api
(
'/geo/status'
),
nil
,
Authorization
:
'Test'
...
...
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