Commit 75cbd1cb authored by Andrejs Cunskis's avatar Andrejs Cunskis

Merge branch 'acunskis-import-improvements' into 'master'

E2E: Check for failure presence for bulk imports

See merge request gitlab-org/gitlab!72673
parents b3211781 23a7a7f0
......@@ -59,6 +59,9 @@ module QA
}
end
# Get import status
#
# @return [String]
def import_status
response = get(Runtime::API::Request.new(api_client, "/bulk_imports/#{import_id}").url)
......@@ -69,6 +72,15 @@ module QA
parse_body(response)[:status]
end
# Get import details
#
# @return [Array]
def import_details
response = get(Runtime::API::Request.new(api_client, "/bulk_imports/#{import_id}/entities").url)
parse_body(response)
end
private
def transform_api_resource(api_resource)
......
......@@ -48,6 +48,10 @@ module QA
imported_group.reload!.projects
end
let(:import_details) do
imported_group.import_details.find { |entity| entity[:destination_name] == source_project.name }
end
before do
Runtime::Feature.enable(:bulk_import_projects)
Runtime::Feature.enable(:top_level_group_creation_enabled) if staging?
......@@ -70,6 +74,7 @@ module QA
testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/2297'
) do
expect { imported_group.import_status }.to eventually_eq('finished').within(import_wait_duration)
expect(import_details[:failures]).to be_empty, "Expected to not have import errors, was: #{import_details}"
aggregate_failures do
expect(imported_projects.count).to eq(1)
......@@ -109,6 +114,7 @@ module QA
testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/2325'
) do
expect { imported_group.import_status }.to eventually_eq('finished').within(import_wait_duration)
expect(import_details[:failures]).to be_empty, "Expected to not have import errors, was: #{import_details}"
aggregate_failures do
expect(imported_issues.count).to eq(1)
......
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