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
56eaec7b
Commit
56eaec7b
authored
Mar 12, 2020
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Automatically add 'schema: :latest' to background migration specs
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
525e5135
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
15 additions
and
10 deletions
+15
-10
ee/spec/lib/ee/gitlab/background_migration/backfill_version_data_from_gitaly_spec.rb
...round_migration/backfill_version_data_from_gitaly_spec.rb
+1
-1
ee/spec/lib/ee/gitlab/background_migration/migrate_approver_to_approval_rules_check_progress_spec.rb
...migrate_approver_to_approval_rules_check_progress_spec.rb
+1
-1
ee/spec/lib/ee/gitlab/background_migration/migrate_approver_to_approval_rules_in_batch_spec.rb
...ation/migrate_approver_to_approval_rules_in_batch_spec.rb
+1
-1
ee/spec/lib/ee/gitlab/background_migration/migrate_approver_to_approval_rules_spec.rb
...ound_migration/migrate_approver_to_approval_rules_spec.rb
+1
-1
ee/spec/lib/gitlab/background_migration/user_mentions/create_resource_user_mention_spec.rb
...ration/user_mentions/create_resource_user_mention_spec.rb
+1
-1
spec/lib/gitlab/background_migration/backfill_project_repositories_spec.rb
...ackground_migration/backfill_project_repositories_spec.rb
+1
-1
spec/lib/gitlab/background_migration/legacy_upload_mover_spec.rb
...b/gitlab/background_migration/legacy_upload_mover_spec.rb
+1
-1
spec/lib/gitlab/background_migration/legacy_uploads_migrator_spec.rb
...tlab/background_migration/legacy_uploads_migrator_spec.rb
+1
-1
spec/lib/gitlab/background_migration/merge_request_assignees_migration_progress_check_spec.rb
.../merge_request_assignees_migration_progress_check_spec.rb
+1
-1
spec/lib/gitlab/background_migration_spec.rb
spec/lib/gitlab/background_migration_spec.rb
+1
-1
spec/spec_helper.rb
spec/spec_helper.rb
+5
-0
No files found.
ee/spec/lib/ee/gitlab/background_migration/backfill_version_data_from_gitaly_spec.rb
View file @
56eaec7b
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
# rubocop:disable RSpec/FactoriesInMigrationSpecs
describe
Gitlab
::
BackgroundMigration
::
BackfillVersionDataFromGitaly
,
schema: :latest
do
describe
Gitlab
::
BackgroundMigration
::
BackfillVersionDataFromGitaly
do
let
(
:issue
)
{
create
(
:issue
)
}
def
perform_worker
...
...
ee/spec/lib/ee/gitlab/background_migration/migrate_approver_to_approval_rules_check_progress_spec.rb
View file @
56eaec7b
...
...
@@ -2,7 +2,7 @@
require
'spec_helper'
describe
Gitlab
::
BackgroundMigration
::
MigrateApproverToApprovalRulesCheckProgress
,
schema: :latest
do
describe
Gitlab
::
BackgroundMigration
::
MigrateApproverToApprovalRulesCheckProgress
do
context
'when there is MigrateApproverToApprovalRulesInBatch jobs'
do
it
'reschedules check'
do
allow
(
Gitlab
::
BackgroundMigration
).
to
receive
(
:exists?
).
with
(
'MigrateApproverToApprovalRulesInBatch'
).
and_return
(
true
)
...
...
ee/spec/lib/ee/gitlab/background_migration/migrate_approver_to_approval_rules_in_batch_spec.rb
View file @
56eaec7b
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
# rubocop:disable RSpec/FactoriesInMigrationSpecs
describe
Gitlab
::
BackgroundMigration
::
MigrateApproverToApprovalRulesInBatch
,
schema: :latest
do
describe
Gitlab
::
BackgroundMigration
::
MigrateApproverToApprovalRulesInBatch
do
context
'when there is no more MigrateApproverToApprovalRules jobs'
do
let
(
:job
)
{
double
(
:job
)
}
let
(
:project
)
{
create
(
:project
)
}
...
...
ee/spec/lib/ee/gitlab/background_migration/migrate_approver_to_approval_rules_spec.rb
View file @
56eaec7b
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
# rubocop:disable RSpec/FactoriesInMigrationSpecs
describe
Gitlab
::
BackgroundMigration
::
MigrateApproverToApprovalRules
,
schema: :latest
do
describe
Gitlab
::
BackgroundMigration
::
MigrateApproverToApprovalRules
do
def
create_skip_sync
(
*
args
)
build
(
*
args
)
do
|
record
|
allow
(
record
).
to
receive
(
:schedule_approval_migration
)
...
...
ee/spec/lib/gitlab/background_migration/user_mentions/create_resource_user_mention_spec.rb
View file @
56eaec7b
...
...
@@ -5,7 +5,7 @@ require './db/post_migrate/20191115115043_migrate_epic_mentions_to_db'
require
'./db/post_migrate/20191115115522_migrate_epic_notes_mentions_to_db'
require
'./db/post_migrate/20200124110831_migrate_design_notes_mentions_to_db'
describe
Gitlab
::
BackgroundMigration
::
UserMentions
::
CreateResourceUserMention
,
schema: :latest
do
describe
Gitlab
::
BackgroundMigration
::
UserMentions
::
CreateResourceUserMention
do
include
MigrationsHelpers
context
'when migrating data'
do
...
...
spec/lib/gitlab/background_migration/backfill_project_repositories_spec.rb
View file @
56eaec7b
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
# rubocop:disable RSpec/FactoriesInMigrationSpecs
describe
Gitlab
::
BackgroundMigration
::
BackfillProjectRepositories
,
schema: :latest
do
describe
Gitlab
::
BackgroundMigration
::
BackfillProjectRepositories
do
let
(
:group
)
{
create
(
:group
,
name:
'foo'
,
path:
'foo'
)
}
describe
described_class
::
ShardFinder
do
...
...
spec/lib/gitlab/background_migration/legacy_upload_mover_spec.rb
View file @
56eaec7b
...
...
@@ -2,7 +2,7 @@
require
'spec_helper'
# rubocop: disable RSpec/FactoriesInMigrationSpecs
describe
Gitlab
::
BackgroundMigration
::
LegacyUploadMover
,
schema: :latest
do
describe
Gitlab
::
BackgroundMigration
::
LegacyUploadMover
do
let
(
:test_dir
)
{
FileUploader
.
options
[
'storage_path'
]
}
let
(
:filename
)
{
'image.png'
}
...
...
spec/lib/gitlab/background_migration/legacy_uploads_migrator_spec.rb
View file @
56eaec7b
...
...
@@ -2,7 +2,7 @@
require
'spec_helper'
# rubocop: disable RSpec/FactoriesInMigrationSpecs
describe
Gitlab
::
BackgroundMigration
::
LegacyUploadsMigrator
,
schema: :latest
do
describe
Gitlab
::
BackgroundMigration
::
LegacyUploadsMigrator
do
let
(
:test_dir
)
{
FileUploader
.
options
[
'storage_path'
]
}
let!
(
:hashed_project
)
{
create
(
:project
)
}
...
...
spec/lib/gitlab/background_migration/merge_request_assignees_migration_progress_check_spec.rb
View file @
56eaec7b
...
...
@@ -2,7 +2,7 @@
require
'spec_helper'
describe
Gitlab
::
BackgroundMigration
::
MergeRequestAssigneesMigrationProgressCheck
,
schema: :latest
do
describe
Gitlab
::
BackgroundMigration
::
MergeRequestAssigneesMigrationProgressCheck
do
context
'rescheduling'
do
context
'when there are ongoing and no dead jobs'
do
it
'reschedules check'
do
...
...
spec/lib/gitlab/background_migration_spec.rb
View file @
56eaec7b
...
...
@@ -2,7 +2,7 @@
require
'spec_helper'
describe
Gitlab
::
BackgroundMigration
,
schema: :latest
do
describe
Gitlab
::
BackgroundMigration
do
describe
'.queue'
do
it
'returns background migration worker queue'
do
expect
(
described_class
.
queue
)
...
...
spec/spec_helper.rb
View file @
56eaec7b
...
...
@@ -81,6 +81,11 @@ RSpec.configure do |config|
metadata
[
:migration
]
=
true
if
metadata
[
:level
]
==
:migration
end
# Do not overwrite schema if it's already set
unless
metadata
.
key?
(
:schema
)
metadata
[
:schema
]
=
:latest
if
quality_level
.
background_migration?
(
location
)
end
# Do not overwrite type if it's already set
unless
metadata
.
key?
(
:type
)
match
=
location
.
match
(
%r{/spec/([^/]+)/}
)
...
...
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