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
74036b23
Commit
74036b23
authored
Aug 22, 2017
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs for repository and Wiki sync logging
parent
aea9108a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
6 deletions
+20
-6
spec/services/geo/repository_sync_service_spec.rb
spec/services/geo/repository_sync_service_spec.rb
+10
-3
spec/services/geo/wiki_sync_service_spec.rb
spec/services/geo/wiki_sync_service_spec.rb
+10
-3
No files found.
spec/services/geo/repository_sync_service_spec.rb
View file @
74036b23
...
...
@@ -79,17 +79,24 @@ RSpec.describe Geo::RepositorySyncService do
context
'when repository sync succeed'
do
let
(
:registry
)
{
Geo
::
ProjectRegistry
.
find_by
(
project_id:
project
.
id
)
}
before
do
it
'sets last_repository_synced_at'
do
subject
.
execute
end
it
'sets last_repository_synced_at'
do
expect
(
registry
.
last_repository_synced_at
).
not_to
be_nil
end
it
'sets last_repository_successful_sync_at'
do
subject
.
execute
expect
(
registry
.
last_repository_successful_sync_at
).
not_to
be_nil
end
it
'logs success with timings'
do
allow
(
Gitlab
::
Geo
::
Logger
).
to
receive
(
:info
).
and_call_original
expect
(
Gitlab
::
Geo
::
Logger
).
to
receive
(
:info
).
with
(
hash_including
(
:message
,
:update_delay_s
,
:download_time_s
)).
and_call_original
subject
.
execute
end
end
context
'when repository sync fail'
do
...
...
spec/services/geo/wiki_sync_service_spec.rb
View file @
74036b23
...
...
@@ -69,17 +69,24 @@ RSpec.describe Geo::WikiSyncService do
context
'when repository sync succeed'
do
let
(
:registry
)
{
Geo
::
ProjectRegistry
.
find_by
(
project_id:
project
.
id
)
}
before
do
it
'sets last_wiki_synced_at'
do
subject
.
execute
end
it
'sets last_wiki_synced_at'
do
expect
(
registry
.
last_wiki_synced_at
).
not_to
be_nil
end
it
'sets last_wiki_successful_sync_at'
do
subject
.
execute
expect
(
registry
.
last_wiki_successful_sync_at
).
not_to
be_nil
end
it
'logs success with timings'
do
allow
(
Gitlab
::
Geo
::
Logger
).
to
receive
(
:info
).
and_call_original
expect
(
Gitlab
::
Geo
::
Logger
).
to
receive
(
:info
).
with
(
hash_including
(
:message
,
:update_delay_s
,
:download_time_s
)).
and_call_original
subject
.
execute
end
end
context
'when wiki sync fail'
do
...
...
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