Commit 23a7a7f0 authored by Andrejs Cunskis's avatar Andrejs Cunskis

Check for failure presence for bulk imports

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