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
d519e8eb
Commit
d519e8eb
authored
Sep 01, 2021
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix-master-migration-test' into 'master'
Fix broken test See merge request gitlab-org/gitlab!69364
parents
c2bb991e
baa7be3c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
11 deletions
+3
-11
spec/lib/gitlab/background_migration/migrate_pages_metadata_spec.rb
...itlab/background_migration/migrate_pages_metadata_spec.rb
+3
-11
No files found.
spec/lib/gitlab/background_migration/migrate_pages_metadata_spec.rb
View file @
d519e8eb
...
@@ -7,7 +7,7 @@ RSpec.describe Gitlab::BackgroundMigration::MigratePagesMetadata, schema: 201909
...
@@ -7,7 +7,7 @@ RSpec.describe Gitlab::BackgroundMigration::MigratePagesMetadata, schema: 201909
subject
(
:migrate_pages_metadata
)
{
described_class
.
new
}
subject
(
:migrate_pages_metadata
)
{
described_class
.
new
}
describe
'#perform
_on_relation
'
do
describe
'#perform'
do
let
(
:namespaces
)
{
table
(
:namespaces
)
}
let
(
:namespaces
)
{
table
(
:namespaces
)
}
let
(
:builds
)
{
table
(
:ci_builds
)
}
let
(
:builds
)
{
table
(
:ci_builds
)
}
let
(
:pages_metadata
)
{
table
(
:project_pages_metadata
)
}
let
(
:pages_metadata
)
{
table
(
:project_pages_metadata
)
}
...
@@ -23,9 +23,9 @@ RSpec.describe Gitlab::BackgroundMigration::MigratePagesMetadata, schema: 201909
...
@@ -23,9 +23,9 @@ RSpec.describe Gitlab::BackgroundMigration::MigratePagesMetadata, schema: 201909
not_migrated_no_pages
=
projects
.
create!
(
namespace_id:
namespace
.
id
,
name:
'Not Migrated No Pages'
)
not_migrated_no_pages
=
projects
.
create!
(
namespace_id:
namespace
.
id
,
name:
'Not Migrated No Pages'
)
project_not_in_relation_scope
=
projects
.
create!
(
namespace_id:
namespace
.
id
,
name:
'Other'
)
project_not_in_relation_scope
=
projects
.
create!
(
namespace_id:
namespace
.
id
,
name:
'Other'
)
projects_relation
=
projects
.
where
(
id:
[
not_migrated_with_pages
,
not_migrated_no_pages
,
migrated
])
ids
=
[
not_migrated_no_pages
.
id
,
not_migrated_with_pages
.
id
,
migrated
.
id
]
migrate_pages_metadata
.
perform
_on_relation
(
projects_relation
)
migrate_pages_metadata
.
perform
(
ids
.
min
,
ids
.
max
)
expect
(
pages_metadata
.
find_by_project_id
(
not_migrated_with_pages
.
id
).
deployed
).
to
eq
(
true
)
expect
(
pages_metadata
.
find_by_project_id
(
not_migrated_with_pages
.
id
).
deployed
).
to
eq
(
true
)
expect
(
pages_metadata
.
find_by_project_id
(
not_migrated_no_pages
.
id
).
deployed
).
to
eq
(
false
)
expect
(
pages_metadata
.
find_by_project_id
(
not_migrated_no_pages
.
id
).
deployed
).
to
eq
(
false
)
...
@@ -33,12 +33,4 @@ RSpec.describe Gitlab::BackgroundMigration::MigratePagesMetadata, schema: 201909
...
@@ -33,12 +33,4 @@ RSpec.describe Gitlab::BackgroundMigration::MigratePagesMetadata, schema: 201909
expect
(
pages_metadata
.
find_by_project_id
(
project_not_in_relation_scope
.
id
)).
to
be_nil
expect
(
pages_metadata
.
find_by_project_id
(
project_not_in_relation_scope
.
id
)).
to
be_nil
end
end
end
end
describe
'#perform'
do
it
'creates relation and delegates to #perform_on_relation'
do
expect
(
migrate_pages_metadata
).
to
receive
(
:perform_on_relation
).
with
(
projects
.
where
(
id:
3
..
5
))
migrate_pages_metadata
.
perform
(
3
,
5
)
end
end
end
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