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
ec2129ca
Commit
ec2129ca
authored
Mar 08, 2022
by
Andrejs Cunskis
Committed by
Tiffany Rea
Mar 08, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
E2E: Validate ci pipelines import
parent
3a4e3c65
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
4 deletions
+61
-4
qa/qa/specs/features/api/1_manage/migration/gitlab_migration_pipeline_spec.rb
.../api/1_manage/migration/gitlab_migration_pipeline_spec.rb
+59
-0
qa/qa/specs/features/api/1_manage/migration/gitlab_project_migration_common.rb
...api/1_manage/migration/gitlab_project_migration_common.rb
+2
-4
No files found.
qa/qa/specs/features/api/1_manage/migration/gitlab_migration_pipeline_spec.rb
0 → 100644
View file @
ec2129ca
# 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'
context
'with ci pipeline'
do
let!
(
:source_project_with_readme
)
{
true
}
let
(
:source_pipelines
)
do
source_project
.
pipelines
.
map
do
|
pipeline
|
pipeline
.
except
(
:id
,
:web_url
,
:project_id
)
end
end
let
(
:imported_pipelines
)
do
imported_project
.
pipelines
.
map
do
|
pipeline
|
pipeline
.
except
(
:id
,
:web_url
,
:project_id
)
end
end
before
do
Resource
::
Repository
::
Commit
.
fabricate_via_api!
do
|
commit
|
commit
.
api_client
=
api_client
commit
.
project
=
source_project
commit
.
commit_message
=
'Add .gitlab-ci.yml'
commit
.
add_files
(
[
{
file_path:
'.gitlab-ci.yml'
,
content:
<<~
YML
test-success:
script: echo 'OK'
YML
}
]
)
end
Support
::
Waiter
.
wait_until
(
max_duration:
10
,
sleep_interval:
1
)
do
!
source_project
.
pipelines
.
empty?
end
end
it
(
'successfully imports ci pipeline'
,
testcase:
'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/354650'
)
do
expect_import_finished
expect
(
imported_pipelines
).
to
eq
(
source_pipelines
)
end
end
end
end
end
qa/qa/specs/features/api/1_manage/migration/gitlab_project_migration_common.rb
View file @
ec2129ca
# frozen_string_literal: true
module
QA
# Disable on
staging
until bulk_import_projects toggle is on by default
# Disable on
live envs
until bulk_import_projects toggle is on by default
# Otherwise tests running in parallel can disable feature in the middle of other test
RSpec
.
shared_context
'with gitlab project migration'
,
:requires_admin
,
except:
{
subdomain: :staging
}
do
RSpec
.
shared_context
'with gitlab project migration'
,
:requires_admin
,
:skip_live_env
do
let
(
:source_project_with_readme
)
{
false
}
let
(
:import_wait_duration
)
{
{
max_duration:
300
,
sleep_interval:
2
}
}
let
(
:admin_api_client
)
{
Runtime
::
API
::
Client
.
as_admin
}
...
...
@@ -79,8 +79,6 @@ module QA
# Log failures for easier debugging
Runtime
::
Logger
.
warn
(
"Import failures:
#{
import_failures
}
"
)
if
example
.
exception
&&
!
import_failures
.
empty?
ensure
Runtime
::
Feature
.
disable
(
:bulk_import_projects
)
user
.
remove_via_api!
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