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
9f533aaf
Commit
9f533aaf
authored
Mar 02, 2022
by
Andrejs Cunskis
Committed by
Mark Lapierre
Mar 02, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove duplicate spec
Fixup quotes
parent
e5f32c63
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
50 deletions
+69
-50
qa/qa/resource/group_base.rb
qa/qa/resource/group_base.rb
+1
-17
qa/qa/specs/features/api/1_manage/migration/gitlab_migration_group_spec.rb
...res/api/1_manage/migration/gitlab_migration_group_spec.rb
+0
-33
qa/qa/specs/features/api/1_manage/migration/gitlab_migration_members_spec.rb
...s/api/1_manage/migration/gitlab_migration_members_spec.rb
+68
-0
No files found.
qa/qa/resource/group_base.rb
View file @
9f533aaf
...
@@ -65,7 +65,7 @@ module QA
...
@@ -65,7 +65,7 @@ module QA
end
end
def
marked_for_deletion?
def
marked_for_deletion?
!
parse_body
(
api_get_from
(
"
#{
api_get_path
}
"
))[
:marked_for_deletion_on
].
nil?
!
parse_body
(
api_get_from
(
api_get_path
.
to_s
))[
:marked_for_deletion_on
].
nil?
end
end
# Get group badges
# Get group badges
...
@@ -84,22 +84,6 @@ module QA
...
@@ -84,22 +84,6 @@ module QA
end
end
end
end
# Get group members
#
# @return [Array<QA::Resource::User>]
def
members
parse_body
(
api_get_from
(
"
#{
api_get_path
}
/members"
)).
map
do
|
member
|
User
.
init
do
|
resource
|
resource
.
api_client
=
api_client
resource
.
id
=
member
[
:id
]
resource
.
name
=
member
[
:name
]
resource
.
username
=
member
[
:username
]
resource
.
email
=
member
[
:email
]
resource
.
access_level
=
member
[
:access_level
]
end
end
end
# API get path
# API get path
#
#
# @return [String]
# @return [String]
...
...
qa/qa/specs/features/api/1_manage/migration/gitlab_migration_group_spec.rb
View file @
9f533aaf
...
@@ -147,39 +147,6 @@ module QA
...
@@ -147,39 +147,6 @@ module QA
end
end
end
end
end
end
context
'with group members'
do
let
(
:member
)
do
Resource
::
User
.
fabricate_via_api!
do
|
usr
|
usr
.
api_client
=
admin_api_client
usr
.
hard_delete_on_api_removal
=
true
end
end
before
do
member
.
set_public_email
source_group
.
add_member
(
member
,
Resource
::
Members
::
AccessLevel
::
DEVELOPER
)
imported_group
# trigger import
end
after
do
member
.
remove_via_api!
end
it
(
'adds members for imported group'
,
testcase:
'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347609'
)
do
expect
{
imported_group
.
import_status
}.
to
eventually_eq
(
'finished'
).
within
(
import_wait_duration
)
imported_member
=
imported_group
.
reload!
.
members
.
find
{
|
usr
|
usr
.
username
==
member
.
username
}
aggregate_failures
do
expect
(
imported_member
).
not_to
be_nil
expect
(
imported_member
.
access_level
).
to
eq
(
Resource
::
Members
::
AccessLevel
::
DEVELOPER
)
end
end
end
end
end
end
end
end
end
qa/qa/specs/features/api/1_manage/migration/gitlab_migration_members_spec.rb
0 → 100644
View file @
9f533aaf
# frozen_string_literal: true
require_relative
'gitlab_project_migration_common'
module
QA
RSpec
.
describe
'Manage'
do
describe
'Gitlab migration'
do
include_context
'with gitlab project migration'
let
(
:member
)
do
Resource
::
User
.
fabricate_via_api!
do
|
usr
|
usr
.
api_client
=
admin_api_client
usr
.
hard_delete_on_api_removal
=
true
end
end
let
(
:imported_group_member
)
do
imported_group
.
reload!
.
list_members
.
find
{
|
usr
|
usr
[
'username'
]
==
member
.
username
}
end
let
(
:imported_project_member
)
do
imported_project
.
reload!
.
list_members
.
find
{
|
usr
|
usr
[
'username'
]
==
member
.
username
}
end
before
do
member
.
set_public_email
end
after
do
member
.
remove_via_api!
end
context
'with group member'
do
before
do
source_group
.
add_member
(
member
,
Resource
::
Members
::
AccessLevel
::
DEVELOPER
)
end
it
'member retains indirect membership in imported project'
do
expect_import_finished
aggregate_failures
do
expect
(
imported_project_member
).
to
be_nil
expect
(
imported_group_member
&
.
fetch
(
'access_level'
)).
to
eq
(
Resource
::
Members
::
AccessLevel
::
DEVELOPER
)
end
end
end
context
'with project member'
do
before
do
source_project
.
add_member
(
member
,
Resource
::
Members
::
AccessLevel
::
DEVELOPER
)
end
it
'member retains direct membership in imported project'
do
expect_import_finished
aggregate_failures
do
expect
(
imported_group_member
).
to
be_nil
expect
(
imported_project_member
&
.
fetch
(
'access_level'
)).
to
eq
(
Resource
::
Members
::
AccessLevel
::
DEVELOPER
)
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