BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
7affc231
Unverified
Commit
7affc231
authored
Jan 26, 2018
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add spec
parent
865bb64a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
1 deletion
+14
-1
project.rb
app/models/project.rb
+1
-0
repository_import_worker.rb
app/workers/repository_import_worker.rb
+0
-1
repository_import_worker_spec.rb
spec/workers/repository_import_worker_spec.rb
+13
-0
No files found.
app/models/project.rb
View file @
7affc231
...
...
@@ -569,6 +569,7 @@ class Project < ActiveRecord::Base
forked_from_project
.
repository_storage_path
,
forked_from_project
.
disk_path
)
elsif
gitlab_project_import?
# Do not retry on Import/Export until https://gitlab.com/gitlab-org/gitlab-ce/issues/26189 is solved.
RepositoryImportWorker
.
set
(
retry:
false
).
perform_async
(
self
.
id
)
else
RepositoryImportWorker
.
perform_async
(
self
.
id
)
...
...
app/workers/repository_import_worker.rb
View file @
7affc231
...
...
@@ -21,7 +21,6 @@ class RepositoryImportWorker
return
if
service
.
async?
if
result
[
:status
]
==
:error
fail_import
(
project
,
result
[
:message
])
if
project
.
gitlab_project_import?
raise
result
[
:message
]
...
...
spec/workers/repository_import_worker_spec.rb
View file @
7affc231
...
...
@@ -52,6 +52,19 @@ describe RepositoryImportWorker do
end
.
to
raise_error
(
StandardError
,
error
)
expect
(
project
.
reload
.
import_jid
).
not_to
be_nil
end
it
'updates the error on Import/Export'
do
error
=
%q{remote: Not Found fatal: repository 'https://user:pass@test.com/root/repoC.git/' not found }
project
.
update_attributes
(
import_jid:
'123'
,
import_type:
'gitlab_project'
)
expect_any_instance_of
(
Projects
::
ImportService
).
to
receive
(
:execute
).
and_return
({
status: :error
,
message:
error
})
expect
do
subject
.
perform
(
project
.
id
)
end
.
to
raise_error
(
StandardError
,
error
)
expect
(
project
.
reload
.
import_error
).
not_to
be_nil
end
end
context
'when using an asynchronous importer'
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