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
a1fc1593
Commit
a1fc1593
authored
Jun 27, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor Geo::RepositorySyncService spec
parent
1720c12e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
34 deletions
+11
-34
spec/services/geo/repository_sync_service_spec.rb
spec/services/geo/repository_sync_service_spec.rb
+11
-34
No files found.
spec/services/geo/repository_sync_service_spec.rb
View file @
a1fc1593
...
@@ -103,14 +103,12 @@ describe Geo::RepositorySyncService, services: true do
...
@@ -103,14 +103,12 @@ describe Geo::RepositorySyncService, services: true do
let
(
:last_wiki_synced_at
)
{
4
.
days
.
ago
}
let
(
:last_wiki_synced_at
)
{
4
.
days
.
ago
}
let!
(
:registry
)
do
let!
(
:registry
)
do
Geo
::
ProjectRegistry
.
create
(
create
(
:geo_project_registry
,
:synced
,
project:
project
,
project:
project
,
last_repository_synced_at:
last_repository_synced_at
,
last_repository_synced_at:
last_repository_synced_at
,
last_repository_successful_sync_at:
last_repository_synced_at
,
last_repository_successful_sync_at:
last_repository_synced_at
,
last_wiki_synced_at:
last_wiki_synced_at
,
last_wiki_synced_at:
last_wiki_synced_at
,
last_wiki_successful_sync_at:
last_wiki_synced_at
,
last_wiki_successful_sync_at:
last_wiki_synced_at
resync_repository:
false
,
resync_wiki:
false
)
)
end
end
...
@@ -147,18 +145,7 @@ describe Geo::RepositorySyncService, services: true do
...
@@ -147,18 +145,7 @@ describe Geo::RepositorySyncService, services: true do
context
'when last attempt to sync project repositories failed'
do
context
'when last attempt to sync project repositories failed'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
)
}
let!
(
:registry
)
{
create
(
:geo_project_registry
,
:sync_failed
,
project:
project
)
}
let!
(
:registry
)
do
Geo
::
ProjectRegistry
.
create
(
project:
project
,
last_repository_synced_at:
DateTime
.
now
,
last_repository_successful_sync_at:
nil
,
last_wiki_synced_at:
DateTime
.
now
,
last_wiki_successful_sync_at:
nil
,
resync_repository:
false
,
resync_wiki:
false
)
end
it
'fetches project repositories'
do
it
'fetches project repositories'
do
fetch_count
=
0
fetch_count
=
0
...
@@ -193,18 +180,13 @@ describe Geo::RepositorySyncService, services: true do
...
@@ -193,18 +180,13 @@ describe Geo::RepositorySyncService, services: true do
context
'when project repository is dirty'
do
context
'when project repository is dirty'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:last_repository_synced_at
)
{
5
.
days
.
ago
}
let
(
:last_wiki_synced_at
)
{
4
.
days
.
ago
}
let
(
:last_wiki_synced_at
)
{
4
.
days
.
ago
}
let!
(
:registry
)
do
let!
(
:registry
)
do
Geo
::
ProjectRegistry
.
create
(
create
(
:geo_project_registry
,
:synced
,
:repository_dirty
,
project:
project
,
project:
project
,
last_repository_synced_at:
last_repository_synced_at
,
last_repository_successful_sync_at:
last_repository_synced_at
,
last_wiki_synced_at:
last_wiki_synced_at
,
last_wiki_synced_at:
last_wiki_synced_at
,
last_wiki_successful_sync_at:
last_wiki_synced_at
,
last_wiki_successful_sync_at:
last_wiki_synced_at
resync_repository:
true
,
resync_wiki:
false
)
)
end
end
...
@@ -236,8 +218,8 @@ describe Geo::RepositorySyncService, services: true do
...
@@ -236,8 +218,8 @@ describe Geo::RepositorySyncService, services: true do
registry
.
reload
registry
.
reload
expect
(
registry
.
last_repository_synced_at
).
to
be_within
(
1
.
minute
).
of
(
Time
.
now
)
expect
(
registry
.
last_repository_synced_at
).
to
be_within
(
1
.
minute
).
of
(
Date
Time
.
now
)
expect
(
registry
.
last_repository_successful_sync_at
).
to
be_within
(
1
.
minute
).
of
(
Time
.
now
)
expect
(
registry
.
last_repository_successful_sync_at
).
to
be_within
(
1
.
minute
).
of
(
Date
Time
.
now
)
end
end
it
'does not update last_wiki_successful_sync_at'
do
it
'does not update last_wiki_successful_sync_at'
do
...
@@ -262,17 +244,12 @@ describe Geo::RepositorySyncService, services: true do
...
@@ -262,17 +244,12 @@ describe Geo::RepositorySyncService, services: true do
context
'when project wiki is dirty'
do
context
'when project wiki is dirty'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:last_repository_synced_at
)
{
5
.
days
.
ago
}
let
(
:last_repository_synced_at
)
{
5
.
days
.
ago
}
let
(
:last_wiki_synced_at
)
{
4
.
days
.
ago
}
let!
(
:registry
)
do
let!
(
:registry
)
do
Geo
::
ProjectRegistry
.
create
(
create
(
:geo_project_registry
,
:synced
,
:wiki_dirty
,
project:
project
,
project:
project
,
last_repository_synced_at:
last_repository_synced_at
,
last_repository_synced_at:
last_repository_synced_at
,
last_repository_successful_sync_at:
last_repository_synced_at
,
last_repository_successful_sync_at:
last_repository_synced_at
last_wiki_synced_at:
last_wiki_synced_at
,
last_wiki_successful_sync_at:
last_wiki_synced_at
,
resync_repository:
false
,
resync_wiki:
true
)
)
end
end
...
@@ -302,8 +279,8 @@ describe Geo::RepositorySyncService, services: true do
...
@@ -302,8 +279,8 @@ describe Geo::RepositorySyncService, services: true do
registry
.
reload
registry
.
reload
expect
(
registry
.
last_wiki_synced_at
).
to
be_within
(
1
.
minute
).
of
(
Time
.
now
)
expect
(
registry
.
last_wiki_synced_at
).
to
be_within
(
1
.
minute
).
of
(
Date
Time
.
now
)
expect
(
registry
.
last_wiki_successful_sync_at
).
to
be_within
(
1
.
minute
).
of
(
Time
.
now
)
expect
(
registry
.
last_wiki_successful_sync_at
).
to
be_within
(
1
.
minute
).
of
(
Date
Time
.
now
)
end
end
it
'does not update last_repository_successful_sync_at'
do
it
'does not update last_repository_successful_sync_at'
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