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
13da4f20
Commit
13da4f20
authored
Nov 27, 2021
by
Andrejs Cunskis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
E2E: Gitlab migration - validate repository migration
parent
6695bf1c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
4 deletions
+64
-4
qa/qa/resource/project.rb
qa/qa/resource/project.rb
+9
-2
qa/qa/specs/features/api/1_manage/bulk_import_project_spec.rb
...a/specs/features/api/1_manage/bulk_import_project_spec.rb
+55
-2
No files found.
qa/qa/resource/project.rb
View file @
13da4f20
...
@@ -242,8 +242,7 @@ module QA
...
@@ -242,8 +242,7 @@ module QA
end
end
def
change_repository_storage
(
new_storage
)
def
change_repository_storage
(
new_storage
)
put_body
=
{
repository_storage:
new_storage
}
response
=
put
(
request_url
(
api_put_path
),
repository_storage:
new_storage
)
response
=
put
(
request_url
(
api_put_path
),
put_body
)
unless
response
.
code
==
HTTP_STATUS_OK
unless
response
.
code
==
HTTP_STATUS_OK
raise
(
raise
(
...
@@ -322,11 +321,19 @@ module QA
...
@@ -322,11 +321,19 @@ module QA
auto_paginated_response
(
request_url
(
api_repository_branches_path
,
per_page:
'100'
),
attempts:
attempts
)
auto_paginated_response
(
request_url
(
api_repository_branches_path
,
per_page:
'100'
),
attempts:
attempts
)
end
end
def
create_repository_branch
(
branch_name
,
ref
=
default_branch
)
api_post_to
(
api_repository_branches_path
,
branch:
branch_name
,
ref:
ref
)
end
def
repository_tags
def
repository_tags
response
=
get
(
request_url
(
api_repository_tags_path
))
response
=
get
(
request_url
(
api_repository_tags_path
))
parse_body
(
response
)
parse_body
(
response
)
end
end
def
create_repository_tag
(
tag_name
,
ref
=
default_branch
)
api_post_to
(
api_repository_tags_path
,
tag_name:
tag_name
,
ref:
ref
)
end
def
repository_tree
def
repository_tree
response
=
get
(
request_url
(
api_repository_tree_path
))
response
=
get
(
request_url
(
api_repository_tree_path
))
parse_body
(
response
)
parse_body
(
response
)
...
...
qa/qa/specs/features/api/1_manage/bulk_import_project_spec.rb
View file @
13da4f20
...
@@ -79,7 +79,7 @@ module QA
...
@@ -79,7 +79,7 @@ module QA
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/2297'
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/2297'
)
do
)
do
expect
{
imported_group
.
import_status
}.
to
eventually_eq
(
'finished'
).
within
(
import_wait_duration
)
expect
{
imported_group
.
import_status
}.
to
eventually_eq
(
'finished'
).
within
(
import_wait_duration
)
expect
(
imported_projects
.
count
).
to
eq
(
1
),
"Expected to have 1 imported project"
expect
(
imported_projects
.
count
).
to
eq
(
1
),
'Expected to have 1 imported project'
aggregate_failures
do
aggregate_failures
do
expect
(
imported_projects
.
first
).
to
eq
(
source_project
)
expect
(
imported_projects
.
first
).
to
eq
(
source_project
)
...
@@ -120,7 +120,7 @@ module QA
...
@@ -120,7 +120,7 @@ module QA
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/2325'
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/2325'
)
do
)
do
expect
{
imported_group
.
import_status
}.
to
eventually_eq
(
'finished'
).
within
(
import_wait_duration
)
expect
{
imported_group
.
import_status
}.
to
eventually_eq
(
'finished'
).
within
(
import_wait_duration
)
expect
(
imported_projects
.
count
).
to
eq
(
1
),
"Expected to have 1 imported project"
expect
(
imported_projects
.
count
).
to
eq
(
1
),
'Expected to have 1 imported project'
aggregate_failures
do
aggregate_failures
do
expect
(
imported_issues
.
count
).
to
eq
(
1
)
expect
(
imported_issues
.
count
).
to
eq
(
1
)
...
@@ -129,6 +129,59 @@ module QA
...
@@ -129,6 +129,59 @@ module QA
end
end
end
end
end
end
context
'with repository'
do
let
(
:imported_project
)
{
imported_projects
.
first
}
let
(
:source_commits
)
{
source_project
.
commits
.
map
{
|
c
|
c
.
except
(
:web_url
)
}
}
let
(
:source_tags
)
do
source_project
.
repository_tags
.
tap
do
|
tags
|
tags
.
each
{
|
t
|
t
[
:commit
].
delete
(
:web_url
)
}
end
end
let
(
:source_branches
)
do
source_project
.
repository_branches
.
tap
do
|
branches
|
branches
.
each
do
|
b
|
b
.
delete
(
:web_url
)
b
[
:commit
].
delete
(
:web_url
)
end
end
end
let
(
:imported_commits
)
{
imported_project
.
commits
.
map
{
|
c
|
c
.
except
(
:web_url
)
}
}
let
(
:imported_tags
)
do
imported_project
.
repository_tags
.
tap
do
|
tags
|
tags
.
each
{
|
t
|
t
[
:commit
].
delete
(
:web_url
)
}
end
end
let
(
:imported_branches
)
do
imported_project
.
repository_branches
.
tap
do
|
branches
|
branches
.
each
do
|
b
|
b
.
delete
(
:web_url
)
b
[
:commit
].
delete
(
:web_url
)
end
end
end
before
do
source_project
.
create_repository_branch
(
'test-branch'
)
source_project
.
create_repository_tag
(
'v0.0.1'
)
imported_group
# trigger import
end
it
'successfully imports repository'
do
expect
{
imported_group
.
import_status
}.
to
eventually_eq
(
'finished'
).
within
(
import_wait_duration
)
expect
(
imported_projects
.
count
).
to
eq
(
1
),
'Expected to have 1 imported project'
aggregate_failures
do
expect
(
imported_commits
).
to
match_array
(
source_commits
)
expect
(
imported_tags
).
to
match_array
(
source_tags
)
expect
(
imported_branches
).
to
match_array
(
source_branches
)
end
end
end
end
end
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