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
995999cc
Commit
995999cc
authored
Jan 22, 2018
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Specs for new streaming_active? in Gitlab::Geo::HealthCheck
parent
e4bf0579
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
spec/ee/spec/lib/gitlab/geo/health_check_spec.rb
spec/ee/spec/lib/gitlab/geo/health_check_spec.rb
+4
-4
No files found.
spec/ee/spec/lib/gitlab/geo/health_check_spec.rb
View file @
995999cc
...
...
@@ -15,7 +15,7 @@ describe Gitlab::Geo::HealthCheck, :postgresql do
allow
(
described_class
).
to
receive
(
:database_secondary?
).
and_return
(
true
)
allow
(
described_class
).
to
receive
(
:get_database_version
).
and_return
(
'20170101'
)
allow
(
described_class
).
to
receive
(
:get_migration_version
).
and_return
(
'20170201'
)
allow
(
described_class
).
to
receive
(
:
db_replication_lag_seconds
).
and_return
(
0
)
allow
(
described_class
).
to
receive
(
:
streaming_active?
).
and_return
(
true
)
message
=
subject
.
perform_checks
...
...
@@ -54,7 +54,7 @@ describe Gitlab::Geo::HealthCheck, :postgresql do
it
'returns an error when Geo database version does not match the latest migration version'
do
allow
(
described_class
).
to
receive
(
:database_secondary?
).
and_return
(
true
)
allow
(
subject
).
to
receive
(
:get_database_version
)
{
1
}
allow
(
described_class
).
to
receive
(
:
db_replication_lag_seconds
).
and_return
(
0
)
allow
(
described_class
).
to
receive
(
:
streaming_active?
).
and_return
(
true
)
expect
(
subject
.
perform_checks
).
to
match
(
/Current Geo database version \([0-9]+\) does not match latest migration \([0-9]+\)/
)
end
...
...
@@ -62,14 +62,14 @@ describe Gitlab::Geo::HealthCheck, :postgresql do
it
'returns an error when latest migration version does not match the Geo database version'
do
allow
(
described_class
).
to
receive
(
:database_secondary?
).
and_return
(
true
)
allow
(
subject
).
to
receive
(
:get_migration_version
)
{
1
}
allow
(
described_class
).
to
receive
(
:
db_replication_lag_seconds
).
and_return
(
0
)
allow
(
described_class
).
to
receive
(
:
streaming_active?
).
and_return
(
true
)
expect
(
subject
.
perform_checks
).
to
match
(
/Current Geo database version \([0-9]+\) does not match latest migration \([0-9]+\)/
)
end
it
'returns an error when replication lag is not present'
do
allow
(
described_class
).
to
receive
(
:database_secondary?
).
and_return
(
true
)
allow
(
described_class
).
to
receive
(
:
db_replication_lag_seconds
).
and_return
(
nil
)
allow
(
described_class
).
to
receive
(
:
streaming_active?
).
and_return
(
false
)
expect
(
subject
.
perform_checks
).
to
match
(
/The Geo node does not appear to be replicating data from the primary node/
)
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