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
7026b05a
Commit
7026b05a
authored
Mar 12, 2020
by
James Fargher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract second storage path into constant
parent
576a4372
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
6 deletions
+6
-6
spec/lib/gitlab/git/repository_spec.rb
spec/lib/gitlab/git/repository_spec.rb
+2
-3
spec/requests/api/projects_spec.rb
spec/requests/api/projects_spec.rb
+1
-1
spec/services/projects/fork_service_spec.rb
spec/services/projects/fork_service_spec.rb
+1
-1
spec/support/helpers/test_env.rb
spec/support/helpers/test_env.rb
+2
-1
No files found.
spec/lib/gitlab/git/repository_spec.rb
View file @
7026b05a
...
...
@@ -2139,18 +2139,17 @@ describe Gitlab::Git::Repository, :seed_helper do
end
describe
'#replicate'
do
let
(
:second_storage_path
)
{
'tmp/tests/second_storage'
}
let
(
:new_repository
)
do
Gitlab
::
Git
::
Repository
.
new
(
'test_second_storage'
,
TEST_REPO_PATH
,
''
,
'group/project'
)
end
let
(
:new_repository_path
)
{
File
.
join
(
second_storage_path
,
new_repository
.
relative_path
)
}
let
(
:new_repository_path
)
{
File
.
join
(
TestEnv
::
SECOND_STORAGE_PATH
,
new_repository
.
relative_path
)
}
subject
{
new_repository
.
replicate
(
repository
)
}
before
do
stub_storage_settings
(
'test_second_storage'
=>
{
'gitaly_address'
=>
Gitlab
.
config
.
repositories
.
storages
.
default
.
gitaly_address
,
'path'
=>
second_storage_path
'path'
=>
TestEnv
::
SECOND_STORAGE_PATH
})
Gitlab
::
Shell
.
new
.
create_repository
(
'test_second_storage'
,
TEST_REPO_PATH
,
'group/project'
)
end
...
...
spec/requests/api/projects_spec.rb
View file @
7026b05a
...
...
@@ -2455,7 +2455,7 @@ describe API::Projects do
end
it
'returns 200 when repository storage has changed'
do
stub_storage_settings
(
'test_second_storage'
=>
{
'path'
=>
'tmp/tests/second_storage'
})
stub_storage_settings
(
'test_second_storage'
=>
{
'path'
=>
TestEnv
::
SECOND_STORAGE_PATH
})
expect
do
Sidekiq
::
Testing
.
fake!
do
...
...
spec/services/projects/fork_service_spec.rb
View file @
7026b05a
...
...
@@ -311,7 +311,7 @@ describe Projects::ForkService do
fork_before_move
=
fork_project
(
project
)
# Stub everything required to move a project to a Gitaly shard that does not exist
stub_storage_settings
(
'test_second_storage'
=>
{
'path'
=>
'tmp/tests/second_storage'
})
stub_storage_settings
(
'test_second_storage'
=>
{
'path'
=>
TestEnv
::
SECOND_STORAGE_PATH
})
allow_any_instance_of
(
Gitlab
::
Git
::
Repository
).
to
receive
(
:replicate
)
allow_any_instance_of
(
Gitlab
::
Git
::
Repository
).
to
receive
(
:checksum
)
.
and_return
(
::
Gitlab
::
Git
::
BLANK_SHA
)
...
...
spec/support/helpers/test_env.rb
View file @
7026b05a
...
...
@@ -84,6 +84,7 @@ module TestEnv
TMP_TEST_PATH
=
Rails
.
root
.
join
(
'tmp'
,
'tests'
,
'**'
)
REPOS_STORAGE
=
'default'
.
freeze
SECOND_STORAGE_PATH
=
Rails
.
root
.
join
(
'tmp'
,
'tests'
,
'second_storage'
)
# Test environment
#
...
...
@@ -141,7 +142,7 @@ module TestEnv
end
FileUtils
.
mkdir_p
(
repos_path
)
FileUtils
.
mkdir_p
(
Rails
.
root
.
join
(
'tmp'
,
'tests'
,
'second_storage'
)
)
FileUtils
.
mkdir_p
(
SECOND_STORAGE_PATH
)
FileUtils
.
mkdir_p
(
backup_path
)
FileUtils
.
mkdir_p
(
pages_path
)
FileUtils
.
mkdir_p
(
artifacts_path
)
...
...
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