add spec
This commit is contained in:
parent
865bb64a06
commit
7affc23112
3 changed files with 14 additions and 1 deletions
|
@ -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)
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue