Commit 4ce03513 authored by Mark Lapierre's avatar Mark Lapierre

Merge branch 'acunskis-bulk-import-api-followup' into 'master'

E2E: Update bulk group import via api spec

See merge request gitlab-org/gitlab!67946
parents dcc2ac88 0e48348b
...@@ -35,10 +35,7 @@ module QA ...@@ -35,10 +35,7 @@ module QA
end end
def fabricate_via_api! def fabricate_via_api!
response = post(Runtime::API::Request.new(api_client, api_post_path).url, api_post_body) resource_web_url(api_post)
@import_id = parse_body(response)[:id]
"#{gitlab_address}/#{full_path}"
end end
def api_post_path def api_post_path
...@@ -71,6 +68,18 @@ module QA ...@@ -71,6 +68,18 @@ module QA
parse_body(response)[:status] parse_body(response)[:status]
end end
private
def transform_api_resource(api_resource)
return api_resource if api_resource[:web_url]
# override transformation only for /bulk_imports endpoint which doesn't have web_url in response and
# ignore others so import_id is not overwritten incorrectly
api_resource[:web_url] = "#{gitlab_address}/#{full_path}"
api_resource[:import_id] = api_resource[:id]
api_resource
end
end end
end end
end end
...@@ -78,20 +78,16 @@ module QA ...@@ -78,20 +78,16 @@ module QA
'imports group with subgroups and labels', 'imports group with subgroups and labels',
testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1871' testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1871'
) do ) do
Page::Group::BulkImport.perform do |import_page| expect { imported_group.import_status }.to(
imported_group eventually_eq('finished').within(max_duration: 300, sleep_interval: 2)
)
expect { imported_group.import_status }.to( aggregate_failures do
eventually_eq('finished').within(max_duration: 300, sleep_interval: 2) expect(imported_group.reload!).to eq(source_group)
) expect(imported_group.labels).to include(*source_group.labels)
aggregate_failures do expect(imported_subgroup.reload!).to eq(subgroup)
expect(imported_group.reload!).to eq(source_group) expect(imported_subgroup.labels).to include(*subgroup.labels)
expect(imported_group.labels).to include(*source_group.labels)
expect(imported_subgroup.reload!).to eq(subgroup)
expect(imported_subgroup.labels).to include(*subgroup.labels)
end
end end
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