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
ae3d6f87
Commit
ae3d6f87
authored
Feb 07, 2018
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
EE-only changes to allow the specs to run on hashed storage
parent
1834df9b
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
20 additions
and
20 deletions
+20
-20
spec/ee/spec/lib/gitlab/geo/log_cursor/daemon_spec.rb
spec/ee/spec/lib/gitlab/geo/log_cursor/daemon_spec.rb
+1
-1
spec/ee/spec/models/ee/namespace_spec.rb
spec/ee/spec/models/ee/namespace_spec.rb
+3
-3
spec/ee/spec/models/ee/project_spec.rb
spec/ee/spec/models/ee/project_spec.rb
+2
-2
spec/ee/spec/services/ee/projects/hashed_storage/migrate_repository_service_spec.rb
...rojects/hashed_storage/migrate_repository_service_spec.rb
+1
-1
spec/ee/spec/services/geo/files_expire_service_spec.rb
spec/ee/spec/services/geo/files_expire_service_spec.rb
+1
-1
spec/ee/spec/services/geo/hashed_storage_attachments_event_store_spec.rb
...rvices/geo/hashed_storage_attachments_event_store_spec.rb
+1
-1
spec/ee/spec/services/geo/hashed_storage_attachments_migration_service_spec.rb
.../geo/hashed_storage_attachments_migration_service_spec.rb
+1
-1
spec/ee/spec/services/geo/hashed_storage_migrated_event_store_spec.rb
.../services/geo/hashed_storage_migrated_event_store_spec.rb
+1
-1
spec/ee/spec/services/geo/hashed_storage_migration_service_spec.rb
...pec/services/geo/hashed_storage_migration_service_spec.rb
+2
-2
spec/ee/spec/services/geo/move_repository_service_spec.rb
spec/ee/spec/services/geo/move_repository_service_spec.rb
+1
-1
spec/ee/spec/services/geo/rename_repository_service_spec.rb
spec/ee/spec/services/geo/rename_repository_service_spec.rb
+2
-2
spec/ee/spec/services/geo/repository_destroy_service_spec.rb
spec/ee/spec/services/geo/repository_destroy_service_spec.rb
+2
-2
spec/ee/spec/workers/geo/repositories_clean_up_worker_spec.rb
.../ee/spec/workers/geo/repositories_clean_up_worker_spec.rb
+2
-2
No files found.
spec/ee/spec/lib/gitlab/geo/log_cursor/daemon_spec.rb
View file @
ae3d6f87
...
...
@@ -250,7 +250,7 @@ describe Gitlab::Geo::LogCursor::Daemon, :postgresql, :clean_gitlab_redis_shared
project
=
hashed_storage_migrated_event
.
project
old_disk_path
=
hashed_storage_migrated_event
.
old_disk_path
new_disk_path
=
hashed_storage_migrated_event
.
new_disk_path
old_storage_version
=
project
.
storage_version
old_storage_version
=
hashed_storage_migrated_event
.
old_
storage_version
expect
(
::
Geo
::
HashedStorageMigrationWorker
).
to
receive
(
:perform_async
)
.
with
(
project
.
id
,
old_disk_path
,
new_disk_path
,
old_storage_version
)
...
...
spec/ee/spec/models/ee/namespace_spec.rb
View file @
ae3d6f87
...
...
@@ -102,9 +102,9 @@ describe Namespace do
it
'logs the Geo::RepositoryRenamedEvent for each project inside namespace'
do
parent
=
create
(
:namespace
)
child
=
create
(
:group
,
name:
'child'
,
path:
'child'
,
parent:
parent
)
project_legacy_storage
=
create
(
:project_empty_repo
,
namespace:
parent
)
create
(
:project
,
:hashed
,
namespace:
child
)
create
(
:project_empty_repo
,
namespace:
child
)
project_legacy_storage
=
create
(
:project_empty_repo
,
:legacy_storage
,
namespace:
parent
)
create
(
:project
,
namespace:
child
)
create
(
:project_empty_repo
,
:legacy_storage
,
namespace:
child
)
full_path_was
=
"
#{
parent
.
full_path
}
_old"
new_path
=
parent
.
full_path
...
...
spec/ee/spec/models/ee/project_spec.rb
View file @
ae3d6f87
...
...
@@ -936,11 +936,11 @@ describe Project do
context
'when running on a primary node'
do
set
(
:primary
)
{
create
(
:geo_node
,
:primary
)
}
set
(
:secondary
)
{
create
(
:geo_node
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
:legacy_storage
)
}
let
(
:gitlab_shell
)
{
Gitlab
::
Shell
.
new
}
it
'logs the Geo::RepositoryRenamedEvent for project backed by hashed storage'
do
project_hashed_storage
=
create
(
:project
,
:hashed
)
project_hashed_storage
=
create
(
:project
)
allow
(
project_hashed_storage
).
to
receive
(
:gitlab_shell
).
and_return
(
gitlab_shell
)
allow
(
project_hashed_storage
).
to
receive
(
:previous_changes
).
and_return
(
'path'
=>
[
'foo'
])
...
...
spec/ee/spec/services/ee/projects/hashed_storage/migrate_repository_service_spec.rb
View file @
ae3d6f87
require
'spec_helper'
describe
Projects
::
HashedStorage
::
MigrateRepositoryService
do
let
(
:project
)
{
create
(
:project
,
:empty_repo
,
:wiki_repo
)
}
let
(
:project
)
{
create
(
:project
,
:empty_repo
,
:wiki_repo
,
:legacy_storage
)
}
let
(
:service
)
{
described_class
.
new
(
project
)
}
let
(
:legacy_storage
)
{
Storage
::
LegacyProject
.
new
(
project
)
}
let
(
:hashed_storage
)
{
Storage
::
HashedProject
.
new
(
project
)
}
...
...
spec/ee/spec/services/geo/files_expire_service_spec.rb
View file @
ae3d6f87
...
...
@@ -3,7 +3,7 @@ require 'spec_helper'
# Disable transactions via :delete method because a foreign table
# can't see changes inside a transaction of a different connection.
describe
Geo
::
FilesExpireService
,
:geo
,
:delete
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:legacy_storage
)
}
let!
(
:old_full_path
)
{
project
.
full_path
}
subject
{
described_class
.
new
(
project
,
old_full_path
)
}
...
...
spec/ee/spec/services/geo/hashed_storage_attachments_event_store_spec.rb
View file @
ae3d6f87
require
'spec_helper'
describe
Geo
::
HashedStorageAttachmentsEventStore
do
let
(
:project
)
{
create
(
:project
,
:hashed
,
path:
'bar'
)
}
let
(
:project
)
{
create
(
:project
,
path:
'bar'
)
}
let
(
:attachments_event
)
{
build
(
:geo_hashed_storage_attachments_event
,
project:
project
)
}
set
(
:secondary_node
)
{
create
(
:geo_node
)
}
let
(
:old_attachments_path
)
{
attachments_event
.
old_attachments_path
}
...
...
spec/ee/spec/services/geo/hashed_storage_attachments_migration_service_spec.rb
View file @
ae3d6f87
...
...
@@ -5,7 +5,7 @@ def base_path(storage)
end
describe
Geo
::
HashedStorageAttachmentsMigrationService
do
let!
(
:project
)
{
create
(
:project
)
}
let!
(
:project
)
{
create
(
:project
,
:legacy_storage
)
}
let
(
:legacy_storage
)
{
Storage
::
LegacyProject
.
new
(
project
)
}
let
(
:hashed_storage
)
{
Storage
::
HashedProject
.
new
(
project
)
}
...
...
spec/ee/spec/services/geo/hashed_storage_migrated_event_store_spec.rb
View file @
ae3d6f87
require
'spec_helper'
describe
Geo
::
HashedStorageMigratedEventStore
do
let
(
:project
)
{
create
(
:project
,
:hashed
,
path:
'bar'
)
}
let
(
:project
)
{
create
(
:project
,
path:
'bar'
)
}
set
(
:secondary_node
)
{
create
(
:geo_node
)
}
let
(
:old_disk_path
)
{
"
#{
project
.
namespace
.
full_path
}
/foo"
}
let
(
:old_wiki_disk_path
)
{
"
#{
old_disk_path
}
.wiki"
}
...
...
spec/ee/spec/services/geo/hashed_storage_migration_service_spec.rb
View file @
ae3d6f87
require
'spec_helper'
describe
Geo
::
HashedStorageMigrationService
do
let!
(
:project
)
{
create
(
:project
,
:repository
)
}
let!
(
:project
)
{
create
(
:project
,
:repository
,
:legacy_storage
)
}
let
(
:old_path
)
{
project
.
full_path
}
let
(
:new_path
)
{
"
#{
old_path
}
+renamed"
}
...
...
@@ -42,7 +42,7 @@ describe Geo::HashedStorageMigrationService do
end
it
'does not move project backed by hashed storage'
do
project
=
create
(
:project
,
:repository
,
:hashed
)
project
=
create
(
:project
,
:repository
)
service
=
described_class
.
new
(
project
.
id
,
...
...
spec/ee/spec/services/geo/move_repository_service_spec.rb
View file @
ae3d6f87
...
...
@@ -2,7 +2,7 @@ require 'spec_helper'
describe
Geo
::
MoveRepositoryService
,
:geo
do
describe
'#execute'
do
let
(
:project
)
{
create
(
:project
,
:repository
,
:wiki_repo
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
:wiki_repo
,
:legacy_storage
)
}
let
(
:old_path
)
{
project
.
full_path
}
let
(
:new_path
)
{
"
#{
project
.
full_path
}
+renamed"
}
...
...
spec/ee/spec/services/geo/rename_repository_service_spec.rb
View file @
ae3d6f87
require
'spec_helper'
describe
Geo
::
RenameRepositoryService
do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
:legacy_storage
)
}
let
(
:old_path
)
{
project
.
full_path
}
let
(
:new_path
)
{
"
#{
old_path
}
+renamed"
}
...
...
@@ -42,7 +42,7 @@ describe Geo::RenameRepositoryService do
end
it
'does not move project backed by hashed storage'
do
project_hashed_storage
=
create
(
:project
,
:hashed
)
project_hashed_storage
=
create
(
:project
)
service
=
described_class
.
new
(
project_hashed_storage
.
id
,
project_hashed_storage
.
full_path
,
new_path
)
expect_any_instance_of
(
Geo
::
MoveRepositoryService
).
not_to
receive
(
:execute
)
...
...
spec/ee/spec/services/geo/repository_destroy_service_spec.rb
View file @
ae3d6f87
...
...
@@ -28,6 +28,8 @@ describe Geo::RepositoryDestroyService do
end
context
'legacy storage project'
do
let
(
:project
)
{
create
(
:project_empty_repo
,
:legacy_storage
)
}
it
'removes the repository from disk'
do
project
.
delete
...
...
@@ -50,8 +52,6 @@ describe Geo::RepositoryDestroyService do
end
context
'hashed storage project'
do
let
(
:project
)
{
create
(
:project_empty_repo
,
:hashed
)
}
it
'removes the repository from disk'
do
project
.
delete
...
...
spec/ee/spec/workers/geo/repositories_clean_up_worker_spec.rb
View file @
ae3d6f87
...
...
@@ -14,8 +14,8 @@ describe Geo::RepositoriesCleanUpWorker do
context
'legacy storage'
do
it
'performs GeoRepositoryDestroyWorker for each project that does not belong to selected namespaces to replicate'
do
project_in_synced_group
=
create
(
:project
,
group:
synced_group
)
unsynced_project
=
create
(
:project
,
:repository
)
project_in_synced_group
=
create
(
:project
,
:legacy_storage
,
group:
synced_group
)
unsynced_project
=
create
(
:project
,
:repository
,
:legacy_storage
)
disk_path
=
"
#{
unsynced_project
.
namespace
.
full_path
}
/
#{
unsynced_project
.
path
}
"
expect
(
GeoRepositoryDestroyWorker
).
to
receive
(
:perform_async
)
...
...
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