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
cbe9cbc4
Commit
cbe9cbc4
authored
Dec 01, 2017
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a couple more specs
parent
b2d0410c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
1 deletion
+13
-1
app/services/geo/wiki_sync_service.rb
app/services/geo/wiki_sync_service.rb
+1
-1
spec/services/geo/repository_sync_service_spec.rb
spec/services/geo/repository_sync_service_spec.rb
+6
-0
spec/services/geo/wiki_sync_service_spec.rb
spec/services/geo/wiki_sync_service_spec.rb
+6
-0
No files found.
app/services/geo/wiki_sync_service.rb
View file @
cbe9cbc4
...
...
@@ -21,7 +21,7 @@ module Geo
fetch_geo_mirror
(
project
.
wiki
.
repository
)
end
update_registry!
(
finished_at:
DateTime
.
now
,
attrs:
{
last_wiki_sync_failure:
nil
})
update_registry!
(
finished_at:
DateTime
.
now
,
attrs:
{
last_wiki_sync_failure:
nil
})
log_info
(
'Finished wiki sync'
,
update_delay_s:
update_delay_in_seconds
,
...
...
spec/services/geo/repository_sync_service_spec.rb
View file @
cbe9cbc4
...
...
@@ -52,6 +52,12 @@ describe Geo::RepositorySyncService do
subject
.
execute
end
it
'voids the failure message when it succeeds after an error'
do
registry
=
create
(
:geo_project_registry
,
project:
project
,
last_repository_sync_failure:
'error'
)
expect
{
subject
.
execute
}.
to
change
{
registry
.
reload
.
last_repository_sync_failure
}.
to
(
nil
)
end
it
'returns the lease when sync fail'
do
allow
(
repository
).
to
receive
(
:fetch_as_mirror
).
with
(
url_to_repo
,
forced:
true
)
{
raise
Gitlab
::
Shell
::
Error
}
...
...
spec/services/geo/wiki_sync_service_spec.rb
View file @
cbe9cbc4
...
...
@@ -44,6 +44,12 @@ RSpec.describe Geo::WikiSyncService do
subject
.
execute
end
it
'voids the failure message when it succeeds after an error'
do
registry
=
create
(
:geo_project_registry
,
project:
project
,
last_wiki_sync_failure:
'error'
)
expect
{
subject
.
execute
}.
to
change
{
registry
.
reload
.
last_wiki_sync_failure
}.
to
(
nil
)
end
it
'does not fetch wiki repository if cannot obtain a lease'
do
allow
(
lease
).
to
receive
(
:try_obtain
)
{
false
}
...
...
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