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
47660596
Commit
47660596
authored
Sep 06, 2021
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove Gitlab::ShellAdapter from RepositoryUpdateMirrorWorker
parent
0c05d8b8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
ee/app/workers/repository_update_mirror_worker.rb
ee/app/workers/repository_update_mirror_worker.rb
+0
-1
ee/spec/workers/repository_update_mirror_worker_spec.rb
ee/spec/workers/repository_update_mirror_worker_spec.rb
+13
-1
No files found.
ee/app/workers/repository_update_mirror_worker.rb
View file @
47660596
...
...
@@ -7,7 +7,6 @@ class RepositoryUpdateMirrorWorker
idempotent!
data_consistency
:always
include
Gitlab
::
ShellAdapter
include
ProjectStartImport
feature_category
:source_code_management
...
...
ee/spec/workers/repository_update_mirror_worker_spec.rb
View file @
47660596
...
...
@@ -8,8 +8,10 @@ RSpec.describe RepositoryUpdateMirrorWorker do
let!
(
:project
)
{
create
(
:project
)
}
let!
(
:import_state
)
{
create
(
:import_state
,
:mirror
,
:scheduled
,
project:
project
)
}
subject
(
:worker
)
{
described_class
.
new
}
before
do
allow
(
subject
).
to
receive
(
:jid
).
and_return
(
jid
)
allow
(
worker
).
to
receive
(
:jid
).
and_return
(
jid
)
end
it
'sets status as finished when update mirror service executes successfully'
do
...
...
@@ -58,5 +60,15 @@ RSpec.describe RepositoryUpdateMirrorWorker do
expect
{
subject
.
perform
(
started_project
.
id
)
}.
to
change
{
import_state
.
reload
.
status
}.
to
(
'finished'
)
end
end
it_behaves_like
'an idempotent worker'
do
let
(
:job_args
)
{
[
project
.
id
]
}
before
do
allow_next_instance_of
(
Projects
::
UpdateMirrorService
)
do
|
instance
|
allow
(
instance
).
to
receive
(
:execute
).
and_return
(
status: :success
)
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