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
f9bd2d7a
Commit
f9bd2d7a
authored
Sep 14, 2021
by
Mike Kozono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Geo: Alternate redownload and normal design sync attempts
Changelog: changed EE: true
parent
bc6c2a5c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
17 deletions
+20
-17
ee/app/models/geo/design_registry.rb
ee/app/models/geo/design_registry.rb
+1
-1
ee/spec/models/geo/design_registry_spec.rb
ee/spec/models/geo/design_registry_spec.rb
+19
-16
No files found.
ee/app/models/geo/design_registry.rb
View file @
f9bd2d7a
...
@@ -120,6 +120,6 @@ class Geo::DesignRegistry < Geo::BaseRegistry
...
@@ -120,6 +120,6 @@ class Geo::DesignRegistry < Geo::BaseRegistry
def
should_be_redownloaded?
def
should_be_redownloaded?
return
true
if
force_to_redownload
return
true
if
force_to_redownload
retry_count
>
RETRIES_BEFORE_REDOWNLOAD
retry_count
.
present?
&&
retry_count
>
RETRIES_BEFORE_REDOWNLOAD
&&
retry_count
.
odd?
end
end
end
end
ee/spec/models/geo/design_registry_spec.rb
View file @
f9bd2d7a
...
@@ -4,6 +4,7 @@ require 'spec_helper'
...
@@ -4,6 +4,7 @@ require 'spec_helper'
RSpec
.
describe
Geo
::
DesignRegistry
,
:geo
do
RSpec
.
describe
Geo
::
DesignRegistry
,
:geo
do
include
::
EE
::
GeoHelpers
include
::
EE
::
GeoHelpers
using
RSpec
::
Parameterized
::
TableSyntax
it_behaves_like
'a BulkInsertSafe model'
,
Geo
::
DesignRegistry
do
it_behaves_like
'a BulkInsertSafe model'
,
Geo
::
DesignRegistry
do
let
(
:valid_items_for_bulk_insertion
)
do
let
(
:valid_items_for_bulk_insertion
)
do
...
@@ -266,25 +267,27 @@ RSpec.describe Geo::DesignRegistry, :geo do
...
@@ -266,25 +267,27 @@ RSpec.describe Geo::DesignRegistry, :geo do
end
end
describe
'#should_be_redownloaded?'
do
describe
'#should_be_redownloaded?'
do
let_it_be
(
:design_registry
)
{
create
(
:geo_design_registry
)
}
where
(
:force_to_redownload
,
:retry_count
,
:expected
)
do
false
|
nil
|
false
context
'when force_to_redownload is false'
do
false
|
0
|
false
it
'returns false'
do
false
|
1
|
false
expect
(
design_registry
.
should_be_redownloaded?
).
to
be
false
false
|
10
|
false
end
false
|
11
|
true
false
|
12
|
false
it
'returns true when limit is exceeded'
do
false
|
13
|
true
design_registry
.
retry_count
=
Geo
::
DesignRegistry
::
RETRIES_BEFORE_REDOWNLOAD
+
1
false
|
14
|
false
false
|
101
|
true
expect
(
design_registry
.
should_be_redownloaded?
).
to
be
true
false
|
102
|
false
end
true
|
nil
|
true
end
true
|
0
|
true
true
|
11
|
true
context
'when force_to_redownload is true'
do
end
it
'resets the state of the sync'
do
design_registry
.
force_to_redownload
=
true
with_them
do
it
"returns the expected boolean"
do
expect
(
design_registry
.
should_be_redownloaded?
).
to
be
true
registry
=
build
(
:geo_design_registry
,
retry_count:
retry_count
,
force_to_redownload:
force_to_redownload
)
expect
(
registry
.
should_be_redownloaded?
).
to
eq
(
expected
)
end
end
end
end
end
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