Commit a3faf3bd authored by Andrejs Cunskis's avatar Andrejs Cunskis Committed by Dan Davison

E2E: Fail early for bulk project import test

parent e9c593c3
...@@ -48,8 +48,10 @@ module QA ...@@ -48,8 +48,10 @@ module QA
imported_group.reload!.projects imported_group.reload!.projects
end end
let(:import_details) do let(:project_import_failures) do
imported_group.import_details.find { |entity| entity[:destination_name] == source_project.name } imported_group.import_details
.find { |entity| entity[:destination_name] == source_project.name }
&.fetch(:failures)
end end
before do before do
...@@ -69,16 +71,20 @@ module QA ...@@ -69,16 +71,20 @@ module QA
end end
context 'with project' do context 'with project' do
before do
imported_group # trigger import
end
it( it(
'successfully imports project', 'successfully imports project',
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}" expect(imported_projects.count).to eq(1), "Expected to have 1 imported project"
aggregate_failures do aggregate_failures do
expect(imported_projects.count).to eq(1)
expect(imported_projects.first).to eq(source_project) expect(imported_projects.first).to eq(source_project)
expect(project_import_failures).to be_empty
end end
end end
end end
...@@ -107,6 +113,7 @@ module QA ...@@ -107,6 +113,7 @@ module QA
before do before do
source_issue # fabricate source group, project, issue source_issue # fabricate source group, project, issue
imported_group # trigger import
end end
it( it(
...@@ -114,11 +121,12 @@ module QA ...@@ -114,11 +121,12 @@ 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}" expect(imported_projects.count).to eq(1), "Expected to have 1 imported project"
aggregate_failures do aggregate_failures do
expect(imported_issues.count).to eq(1) expect(imported_issues.count).to eq(1)
expect(imported_issue.reload!).to eq(source_issue) expect(imported_issue.reload!).to eq(source_issue)
expect(project_import_failures).to be_empty
end 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