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
cdef13e5
Commit
cdef13e5
authored
Oct 18, 2021
by
Andrejs Cunskis
Committed by
Mark Lapierre
Oct 18, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
E2E: Validate project issues are imported correctly
parent
3b9f8743
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
87 additions
and
1 deletion
+87
-1
qa/qa/resource/issue.rb
qa/qa/resource/issue.rb
+47
-0
qa/qa/specs/features/api/1_manage/bulk_import_project_spec.rb
...a/specs/features/api/1_manage/bulk_import_project_spec.rb
+40
-1
No files found.
qa/qa/resource/issue.rb
View file @
cdef13e5
...
...
@@ -9,6 +9,7 @@ module QA
Project
.
fabricate!
do
|
resource
|
resource
.
name
=
'project-for-issues'
resource
.
description
=
'project for adding issues'
resource
.
api_client
=
api_client
end
end
...
...
@@ -93,6 +94,52 @@ module QA
attempts:
attempts
)
end
# Object comparison
#
# @param [QA::Resource::Issue] other
# @return [Boolean]
def
==
(
other
)
other
.
is_a?
(
Issue
)
&&
comparable_issue
==
other
.
comparable_issue
end
# Override inspect for a better rspec failure diff output
#
# @return [String]
def
inspect
JSON
.
pretty_generate
(
comparable_issue
)
end
protected
# Return subset of fields for comparing issues
#
# @return [Hash]
def
comparable_issue
reload!
if
api_response
.
nil?
api_resource
.
slice
(
:state
,
:description
,
:type
,
:title
,
:labels
,
:milestone
,
:upvotes
,
:downvotes
,
:merge_requests_count
,
:user_notes_count
,
:due_date
,
:has_tasks
,
:task_status
,
:confidential
,
:discussion_locked
,
:issue_type
,
:task_completion_status
,
:closed_at
,
:created_at
)
end
end
end
end
qa/qa/specs/features/api/1_manage/bulk_import_project_spec.rb
View file @
cdef13e5
...
...
@@ -44,6 +44,10 @@ module QA
end
end
let
(
:imported_projects
)
do
imported_group
.
reload!
.
projects
end
before
do
Runtime
::
Feature
.
enable
(
:bulk_import_projects
)
Runtime
::
Feature
.
enable
(
:top_level_group_creation_enabled
)
if
staging?
...
...
@@ -67,13 +71,48 @@ module QA
)
do
expect
{
imported_group
.
import_status
}.
to
eventually_eq
(
'finished'
).
within
(
import_wait_duration
)
imported_projects
=
imported_group
.
reload!
.
projects
aggregate_failures
do
expect
(
imported_projects
.
count
).
to
eq
(
1
)
expect
(
imported_projects
.
first
).
to
eq
(
source_project
)
end
end
end
context
'with project issues'
do
let
(
:source_issue
)
do
Resource
::
Issue
.
fabricate_via_api!
do
|
issue
|
issue
.
api_client
=
api_client
issue
.
project
=
source_project
issue
.
labels
=
%w[label_one label_two]
end
end
let
(
:imported_issues
)
do
imported_projects
.
first
.
issues
end
let
(
:imported_issue
)
do
issue
=
imported_issues
.
first
Resource
::
Issue
.
init
do
|
resource
|
resource
.
api_client
=
api_client
resource
.
project
=
imported_projects
.
first
resource
.
iid
=
issue
[
:iid
]
end
end
before
do
source_issue
# fabricate source group, project, issue
end
it
'successfully imports issue'
do
expect
{
imported_group
.
import_status
}.
to
eventually_eq
(
'finished'
).
within
(
import_wait_duration
)
aggregate_failures
do
expect
(
imported_issues
.
count
).
to
eq
(
1
)
expect
(
imported_issue
.
reload!
).
to
eq
(
source_issue
)
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