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
5acfcb37
Commit
5acfcb37
authored
Dec 11, 2017
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use deletion truncation strategy since it's faster on CI
parent
b2681e0f
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
21 additions
and
17 deletions
+21
-17
spec/ee/spec/finders/geo/attachment_registry_finder_spec.rb
spec/ee/spec/finders/geo/attachment_registry_finder_spec.rb
+2
-2
spec/ee/spec/finders/geo/expire_uploads_finder_spec.rb
spec/ee/spec/finders/geo/expire_uploads_finder_spec.rb
+2
-2
spec/ee/spec/finders/geo/project_registry_finder_spec.rb
spec/ee/spec/finders/geo/project_registry_finder_spec.rb
+2
-2
spec/models/geo_node_status_spec.rb
spec/models/geo_node_status_spec.rb
+4
-4
spec/services/geo/files_expire_service_spec.rb
spec/services/geo/files_expire_service_spec.rb
+2
-2
spec/support/db_cleaner.rb
spec/support/db_cleaner.rb
+4
-0
spec/workers/geo/file_download_dispatch_worker_spec.rb
spec/workers/geo/file_download_dispatch_worker_spec.rb
+3
-3
spec/workers/geo/repository_shard_sync_worker_spec.rb
spec/workers/geo/repository_shard_sync_worker_spec.rb
+2
-2
No files found.
spec/ee/spec/finders/geo/attachment_registry_finder_spec.rb
View file @
5acfcb37
...
@@ -26,9 +26,9 @@ describe Geo::AttachmentRegistryFinder, :geo do
...
@@ -26,9 +26,9 @@ describe Geo::AttachmentRegistryFinder, :geo do
stub_current_geo_node
(
secondary
)
stub_current_geo_node
(
secondary
)
end
end
# Disable transactions via :
trunca
te method because a foreign table
# Disable transactions via :
dele
te method because a foreign table
# can't see changes inside a transaction of a different connection.
# can't see changes inside a transaction of a different connection.
context
'FDW'
,
:
trunca
te
do
context
'FDW'
,
:
dele
te
do
before
do
before
do
skip
(
'FDW is not configured'
)
if
Gitlab
::
Database
.
postgresql?
&&
!
Gitlab
::
Geo
.
fdw?
skip
(
'FDW is not configured'
)
if
Gitlab
::
Database
.
postgresql?
&&
!
Gitlab
::
Geo
.
fdw?
end
end
...
...
spec/ee/spec/finders/geo/expire_uploads_finder_spec.rb
View file @
5acfcb37
...
@@ -3,9 +3,9 @@ require 'spec_helper'
...
@@ -3,9 +3,9 @@ require 'spec_helper'
describe
Geo
::
ExpireUploadsFinder
,
:geo
do
describe
Geo
::
ExpireUploadsFinder
,
:geo
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
)
}
# Disable transactions via :
trunca
te method because a foreign table
# Disable transactions via :
dele
te method because a foreign table
# can't see changes inside a transaction of a different connection.
# can't see changes inside a transaction of a different connection.
context
'FDW'
,
:
trunca
te
do
context
'FDW'
,
:
dele
te
do
before
do
before
do
skip
(
'FDW is not configured'
)
if
Gitlab
::
Database
.
postgresql?
&&
!
Gitlab
::
Geo
.
fdw?
skip
(
'FDW is not configured'
)
if
Gitlab
::
Database
.
postgresql?
&&
!
Gitlab
::
Geo
.
fdw?
end
end
...
...
spec/ee/spec/finders/geo/project_registry_finder_spec.rb
View file @
5acfcb37
...
@@ -152,9 +152,9 @@ describe Geo::ProjectRegistryFinder, :geo do
...
@@ -152,9 +152,9 @@ describe Geo::ProjectRegistryFinder, :geo do
end
end
end
end
# Disable transactions via :
trunca
te method because a foreign table
# Disable transactions via :
dele
te method because a foreign table
# can't see changes inside a transaction of a different connection.
# can't see changes inside a transaction of a different connection.
context
'FDW'
,
:
trunca
te
do
context
'FDW'
,
:
dele
te
do
before
do
before
do
skip
(
'FDW is not configured'
)
if
Gitlab
::
Database
.
postgresql?
&&
!
Gitlab
::
Geo
.
fdw?
skip
(
'FDW is not configured'
)
if
Gitlab
::
Database
.
postgresql?
&&
!
Gitlab
::
Geo
.
fdw?
end
end
...
...
spec/models/geo_node_status_spec.rb
View file @
5acfcb37
...
@@ -50,9 +50,9 @@ describe GeoNodeStatus, :geo do
...
@@ -50,9 +50,9 @@ describe GeoNodeStatus, :geo do
end
end
end
end
# Disable transactions via :
trunca
te method because a foreign table
# Disable transactions via :
dele
te method because a foreign table
# can't see changes inside a transaction of a different connection.
# can't see changes inside a transaction of a different connection.
describe
'#attachments_synced_count'
,
:
trunca
te
do
describe
'#attachments_synced_count'
,
:
dele
te
do
it
'only counts successful syncs'
do
it
'only counts successful syncs'
do
create_list
(
:user
,
3
,
avatar:
fixture_file_upload
(
Rails
.
root
+
'spec/fixtures/dk.png'
,
'image/png'
))
create_list
(
:user
,
3
,
avatar:
fixture_file_upload
(
Rails
.
root
+
'spec/fixtures/dk.png'
,
'image/png'
))
uploads
=
Upload
.
all
.
pluck
(
:id
)
uploads
=
Upload
.
all
.
pluck
(
:id
)
...
@@ -95,7 +95,7 @@ describe GeoNodeStatus, :geo do
...
@@ -95,7 +95,7 @@ describe GeoNodeStatus, :geo do
end
end
end
end
describe
'#attachments_failed_count'
,
:
trunca
te
do
describe
'#attachments_failed_count'
,
:
dele
te
do
it
'counts failed avatars, attachment, personal snippets and files'
do
it
'counts failed avatars, attachment, personal snippets and files'
do
# These two should be ignored
# These two should be ignored
create
(
:geo_file_registry
,
:lfs
,
:with_file
,
success:
false
)
create
(
:geo_file_registry
,
:lfs
,
:with_file
,
success:
false
)
...
@@ -110,7 +110,7 @@ describe GeoNodeStatus, :geo do
...
@@ -110,7 +110,7 @@ describe GeoNodeStatus, :geo do
end
end
end
end
describe
'#attachments_synced_in_percentage'
,
:
trunca
te
do
describe
'#attachments_synced_in_percentage'
,
:
dele
te
do
let
(
:avatar
)
{
fixture_file_upload
(
Rails
.
root
.
join
(
'spec/fixtures/dk.png'
))
}
let
(
:avatar
)
{
fixture_file_upload
(
Rails
.
root
.
join
(
'spec/fixtures/dk.png'
))
}
let
(
:upload_1
)
{
create
(
:upload
,
model:
group
,
path:
avatar
)
}
let
(
:upload_1
)
{
create
(
:upload
,
model:
group
,
path:
avatar
)
}
let
(
:upload_2
)
{
create
(
:upload
,
model:
project_1
,
path:
avatar
)
}
let
(
:upload_2
)
{
create
(
:upload
,
model:
project_1
,
path:
avatar
)
}
...
...
spec/services/geo/files_expire_service_spec.rb
View file @
5acfcb37
require
'spec_helper'
require
'spec_helper'
# Disable transactions via :
trunca
te method because a foreign table
# Disable transactions via :
dele
te method because a foreign table
# can't see changes inside a transaction of a different connection.
# can't see changes inside a transaction of a different connection.
describe
Geo
::
FilesExpireService
,
:geo
,
:
trunca
te
do
describe
Geo
::
FilesExpireService
,
:geo
,
:
dele
te
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
)
}
let!
(
:old_full_path
)
{
project
.
full_path
}
let!
(
:old_full_path
)
{
project
.
full_path
}
subject
{
described_class
.
new
(
project
,
old_full_path
)
}
subject
{
described_class
.
new
(
project
,
old_full_path
)
}
...
...
spec/support/db_cleaner.rb
View file @
5acfcb37
...
@@ -21,6 +21,10 @@ RSpec.configure do |config|
...
@@ -21,6 +21,10 @@ RSpec.configure do |config|
DatabaseCleaner
.
strategy
=
:truncation
,
{
except:
%w[licenses]
}
DatabaseCleaner
.
strategy
=
:truncation
,
{
except:
%w[licenses]
}
end
end
config
.
before
(
:each
,
:delete
)
do
DatabaseCleaner
.
strategy
=
:deletion
,
{
except:
%w[licenses plans]
}
end
config
.
before
(
:each
,
:migration
)
do
config
.
before
(
:each
,
:migration
)
do
DatabaseCleaner
.
strategy
=
:truncation
,
{
cache_tables:
false
}
DatabaseCleaner
.
strategy
=
:truncation
,
{
cache_tables:
false
}
end
end
...
...
spec/workers/geo/file_download_dispatch_worker_spec.rb
View file @
5acfcb37
require
'spec_helper'
require
'spec_helper'
# Disable transactions via :truncate method because a foreign table
# can't see changes inside a transaction of a different connection.
describe
Geo
::
FileDownloadDispatchWorker
,
:geo
do
describe
Geo
::
FileDownloadDispatchWorker
,
:geo
do
include
::
EE
::
GeoHelpers
include
::
EE
::
GeoHelpers
...
@@ -171,7 +169,9 @@ describe Geo::FileDownloadDispatchWorker, :geo do
...
@@ -171,7 +169,9 @@ describe Geo::FileDownloadDispatchWorker, :geo do
end
end
end
end
describe
'when PostgreSQL FDW is available'
,
:geo
,
:truncate
do
# Disable transactions via :delete method because a foreign table
# can't see changes inside a transaction of a different connection.
describe
'when PostgreSQL FDW is available'
,
:geo
,
:delete
do
# Skip if FDW isn't activated on this database
# Skip if FDW isn't activated on this database
it_behaves_like
'#perform'
,
Gitlab
::
Database
.
postgresql?
&&
!
Gitlab
::
Geo
.
fdw?
it_behaves_like
'#perform'
,
Gitlab
::
Database
.
postgresql?
&&
!
Gitlab
::
Geo
.
fdw?
end
end
...
...
spec/workers/geo/repository_shard_sync_worker_spec.rb
View file @
5acfcb37
require
'spec_helper'
require
'spec_helper'
# Disable transactions via :
trunca
te method because a foreign table
# Disable transactions via :
dele
te method because a foreign table
# can't see changes inside a transaction of a different connection.
# can't see changes inside a transaction of a different connection.
describe
Geo
::
RepositoryShardSyncWorker
,
:geo
,
:
trunca
te
,
:clean_gitlab_redis_cache
do
describe
Geo
::
RepositoryShardSyncWorker
,
:geo
,
:
dele
te
,
:clean_gitlab_redis_cache
do
include
::
EE
::
GeoHelpers
include
::
EE
::
GeoHelpers
let!
(
:primary
)
{
create
(
:geo_node
,
:primary
)
}
let!
(
:primary
)
{
create
(
:geo_node
,
:primary
)
}
...
...
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