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
1098a3ba
Commit
1098a3ba
authored
Oct 11, 2021
by
Andrejs Cunskis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Validate members are imported for bulk group import
parent
81bfb7cd
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
7 deletions
+55
-7
qa/qa/resource/group_base.rb
qa/qa/resource/group_base.rb
+16
-0
qa/qa/resource/user.rb
qa/qa/resource/user.rb
+12
-7
qa/qa/specs/features/api/1_manage/bulk_import_group_spec.rb
qa/qa/specs/features/api/1_manage/bulk_import_group_spec.rb
+27
-0
No files found.
qa/qa/resource/group_base.rb
View file @
1098a3ba
...
...
@@ -78,6 +78,22 @@ module QA
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
#
# @return [String]
...
...
qa/qa/resource/user.rb
View file @
1098a3ba
...
...
@@ -7,13 +7,18 @@ module QA
attr_reader
:unique_id
attr_writer
:username
,
:password
attr_accessor
:admin
,
:provider
,
:extern_uid
,
:expect_fabrication_success
,
:hard_delete_on_api_removal
attribute
:id
attribute
:name
attribute
:first_name
attribute
:last_name
attribute
:email
attr_accessor
:admin
,
:provider
,
:extern_uid
,
:expect_fabrication_success
,
:hard_delete_on_api_removal
,
:access_level
attributes
:id
,
:name
,
:first_name
,
:last_name
,
:email
def
initialize
@admin
=
false
...
...
qa/qa/specs/features/api/1_manage/bulk_import_group_spec.rb
View file @
1098a3ba
...
...
@@ -126,6 +126,33 @@ module QA
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
)
end
after
do
member
.
remove_via_api!
end
it
'adds members for imported group'
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
}
expect
(
imported_member
).
not_to
be_nil
expect
(
imported_member
.
access_level
).
to
eq
(
Resource
::
Members
::
AccessLevel
::
DEVELOPER
)
end
end
after
do
user
.
remove_via_api!
ensure
...
...
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