Commit ec2129ca authored by Andrejs Cunskis's avatar Andrejs Cunskis Committed by Tiffany Rea

E2E: Validate ci pipelines import

parent 3a4e3c65
# 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
# 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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment