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
566e3e7f
Commit
566e3e7f
authored
Apr 29, 2020
by
nmilojevic1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix disable upload object storage
- Fix specs for import export task - Replace File.exists with File.exist
parent
ce1893e3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
17 deletions
+9
-17
lib/gitlab/import_export/project/base_task.rb
lib/gitlab/import_export/project/base_task.rb
+2
-4
spec/lib/gitlab/import_export/project/export_task_spec.rb
spec/lib/gitlab/import_export/project/export_task_spec.rb
+1
-1
spec/support/shared_contexts/lib/gitlab/import_export/project/rake_task_object_storage_shared_context.rb
...export/project/rake_task_object_storage_shared_context.rb
+3
-6
spec/support/shared_examples/lib/gitlab/import_export/project/rake_task_object_storage_shared_examples.rb
...xport/project/rake_task_object_storage_shared_examples.rb
+3
-6
No files found.
lib/gitlab/import_export/project/base_task.rb
View file @
566e3e7f
...
...
@@ -27,10 +27,8 @@ module Gitlab
end
def
disable_upload_object_storage
overwrite_uploads_setting
(
'background_upload'
,
false
)
do
overwrite_uploads_setting
(
'direct_upload'
,
false
)
do
yield
end
overwrite_uploads_setting
(
'enabled'
,
false
)
do
yield
end
end
...
...
spec/lib/gitlab/import_export/project/export_task_spec.rb
View file @
566e3e7f
...
...
@@ -30,7 +30,7 @@ describe Gitlab::ImportExport::Project::ExportTask do
around
do
|
example
|
example
.
run
ensure
File
.
delete
(
file_path
)
if
File
.
exist
s
?
(
file_path
)
File
.
delete
(
file_path
)
if
File
.
exist?
(
file_path
)
end
include_context
'rake task object storage shared context'
...
...
spec/support/shared_contexts/lib/gitlab/import_export/project/rake_task_object_storage_shared_context.rb
View file @
566e3e7f
...
...
@@ -6,15 +6,12 @@ RSpec.shared_context 'rake task object storage shared context' do
end
around
do
|
example
|
old_direct_upload_setting
=
Settings
.
uploads
.
object_store
[
'direct_upload'
]
old_background_upload_setting
=
Settings
.
uploads
.
object_store
[
'background_upload'
]
old_object_store_setting
=
Settings
.
uploads
.
object_store
[
'enabled'
]
Settings
.
uploads
.
object_store
[
'direct_upload'
]
=
true
Settings
.
uploads
.
object_store
[
'background_upload'
]
=
true
Settings
.
uploads
.
object_store
[
'enabled'
]
=
true
example
.
run
Settings
.
uploads
.
object_store
[
'direct_upload'
]
=
old_direct_upload_setting
Settings
.
uploads
.
object_store
[
'background_upload'
]
=
old_background_upload_setting
Settings
.
uploads
.
object_store
[
'enabled'
]
=
old_object_store_setting
end
end
spec/support/shared_examples/lib/gitlab/import_export/project/rake_task_object_storage_shared_examples.rb
View file @
566e3e7f
...
...
@@ -4,18 +4,15 @@ RSpec.shared_examples 'rake task with disabled object_storage' do |service_class
it
'disables direct & background upload only for service call'
do
expect_next_instance_of
(
service_class
)
do
|
service
|
expect
(
service
).
to
receive
(
:execute
).
and_wrap_original
do
|
m
|
expect
(
Settings
.
uploads
.
object_store
[
'background_upload'
]).
to
eq
(
false
)
expect
(
Settings
.
uploads
.
object_store
[
'direct_upload'
]).
to
eq
(
false
)
expect
(
Settings
.
uploads
.
object_store
[
'enabled'
]).
to
eq
(
false
)
m
.
call
end
end
expect
(
rake_task
).
to
receive
(
method
).
and_wrap_original
do
|
m
,
*
args
|
expect
(
Settings
.
uploads
.
object_store
[
'background_upload'
]).
to
eq
(
true
)
expect
(
Settings
.
uploads
.
object_store
[
'direct_upload'
]).
to
eq
(
true
)
expect
(
Settings
.
uploads
.
object_store
).
not_to
receive
(
:[]=
).
with
(
'backgroud_upload'
,
false
)
expect
(
Settings
.
uploads
.
object_store
).
not_to
receive
(
:[]=
).
with
(
'direct_upload'
,
false
)
expect
(
Settings
.
uploads
.
object_store
[
'enabled'
]).
to
eq
(
true
)
expect
(
Settings
.
uploads
.
object_store
).
not_to
receive
(
:[]=
).
with
(
'enabled'
,
false
)
m
.
call
(
*
args
)
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