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
fcb55244
Commit
fcb55244
authored
Dec 07, 2021
by
Andrejs Cunskis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
E2E: Validate error presence for group imports
parent
c1f3d5e8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
5 deletions
+34
-5
qa/qa/resource/group.rb
qa/qa/resource/group.rb
+2
-1
qa/qa/resource/group_base.rb
qa/qa/resource/group_base.rb
+1
-1
qa/qa/resource/sandbox.rb
qa/qa/resource/sandbox.rb
+2
-1
qa/qa/specs/features/api/1_manage/bulk_import_group_spec.rb
qa/qa/specs/features/api/1_manage/bulk_import_group_spec.rb
+20
-2
qa/qa/specs/features/ee/api/1_manage/bulk_import_group_spec.rb
.../specs/features/ee/api/1_manage/bulk_import_group_spec.rb
+9
-0
No files found.
qa/qa/resource/group.rb
View file @
fcb55244
...
...
@@ -68,7 +68,8 @@ module QA
path:
path
,
name:
path
,
visibility:
'public'
,
require_two_factor_authentication:
@require_two_factor_authentication
require_two_factor_authentication:
@require_two_factor_authentication
,
avatar:
avatar
}
end
...
...
qa/qa/resource/group_base.rb
View file @
fcb55244
...
...
@@ -7,7 +7,7 @@ module QA
class
GroupBase
<
Base
include
Members
attr_accessor
:path
attr_accessor
:path
,
:avatar
attributes
:id
,
:runners_token
,
...
...
qa/qa/resource/sandbox.rb
View file @
fcb55244
...
...
@@ -69,7 +69,8 @@ module QA
{
path:
path
,
name:
path
,
visibility:
'public'
visibility:
'public'
,
avatar:
avatar
}
end
...
...
qa/qa/specs/features/api/1_manage/bulk_import_group_spec.rb
View file @
fcb55244
...
...
@@ -26,6 +26,7 @@ module QA
Resource
::
Sandbox
.
fabricate_via_api!
do
|
group
|
group
.
api_client
=
api_client
group
.
path
=
"source-group-for-import-
#{
SecureRandom
.
hex
(
4
)
}
"
group
.
avatar
=
File
.
new
(
'qa/fixtures/designs/tanuki.jpg'
,
'r'
)
end
end
...
...
@@ -37,6 +38,10 @@ module QA
end
end
let
(
:import_failures
)
do
imported_group
.
import_details
.
sum
([])
{
|
details
|
details
[
:failures
]
}
end
before
do
sandbox
.
add_member
(
user
,
Resource
::
Members
::
AccessLevel
::
MAINTAINER
)
end
...
...
@@ -73,6 +78,8 @@ module QA
label
.
group
=
subgroup
label
.
title
=
"subgroup-
#{
SecureRandom
.
hex
(
4
)
}
"
end
imported_group
# trigger import
end
it
(
...
...
@@ -87,6 +94,8 @@ module QA
expect
(
imported_subgroup
.
reload!
).
to
eq
(
subgroup
)
expect
(
imported_subgroup
.
labels
).
to
include
(
*
subgroup
.
labels
)
expect
(
import_failures
).
to
be_empty
,
"Expected no errors, received:
#{
import_failures
}
"
end
end
end
...
...
@@ -108,6 +117,8 @@ module QA
badge
.
link_url
=
"http://example.com/badge"
badge
.
image_url
=
"http://shields.io/badge"
end
imported_group
# trigger import
end
it
(
...
...
@@ -124,6 +135,8 @@ module QA
expect
(
imported_milestone
.
updated_at
).
to
eq
(
source_milestone
.
updated_at
)
expect
(
imported_group
.
badges
).
to
eq
(
source_group
.
badges
)
expect
(
import_failures
).
to
be_empty
,
"Expected no errors, received:
#{
import_failures
}
"
end
end
end
...
...
@@ -139,6 +152,8 @@ module QA
before
do
member
.
set_public_email
source_group
.
add_member
(
member
,
Resource
::
Members
::
AccessLevel
::
DEVELOPER
)
imported_group
# trigger import
end
after
do
...
...
@@ -153,8 +168,11 @@ module QA
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
)
aggregate_failures
do
expect
(
imported_member
).
not_to
be_nil
expect
(
imported_member
.
access_level
).
to
eq
(
Resource
::
Members
::
AccessLevel
::
DEVELOPER
)
expect
(
import_failures
).
to
be_empty
,
"Expected no errors, received:
#{
import_failures
}
"
end
end
end
end
...
...
qa/qa/specs/features/ee/api/1_manage/bulk_import_group_spec.rb
View file @
fcb55244
...
...
@@ -33,6 +33,7 @@ module QA
Resource
::
Sandbox
.
fabricate_via_api!
do
|
group
|
group
.
api_client
=
api_client
group
.
path
=
"source-group-for-import-
#{
SecureRandom
.
hex
(
4
)
}
"
group
.
avatar
=
File
.
new
(
'qa/fixtures/designs/tanuki.jpg'
,
'r'
)
end
end
...
...
@@ -54,6 +55,10 @@ module QA
end
end
let
(
:import_failures
)
do
imported_group
.
import_details
.
sum
([])
{
|
details
|
details
[
:failures
]
}
end
# Find epic by title
#
# @param [Array] epics
...
...
@@ -86,6 +91,8 @@ module QA
child_epic
.
award_emoji
(
'thumbsdown'
)
source_iteration
imported_group
# trigger import
end
after
do
...
...
@@ -115,6 +122,8 @@ module QA
expect
(
imported_iteration
.
iid
).
to
eq
(
source_iteration
.
iid
)
expect
(
imported_iteration
.
created_at
).
to
eq
(
source_iteration
.
created_at
)
expect
(
imported_iteration
.
updated_at
).
to
eq
(
source_iteration
.
updated_at
)
expect
(
import_failures
).
to
be_empty
,
"Expected no errors, received:
#{
import_failures
}
"
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