Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2021-11-28 00:12:49 +00:00
parent baf3b35968
commit b52ce0cb89
2 changed files with 64 additions and 4 deletions

View File

@ -242,8 +242,7 @@ module QA
end
def change_repository_storage(new_storage)
put_body = { repository_storage: new_storage }
response = put(request_url(api_put_path), put_body)
response = put(request_url(api_put_path), repository_storage: new_storage)
unless response.code == HTTP_STATUS_OK
raise(
@ -322,11 +321,19 @@ module QA
auto_paginated_response(request_url(api_repository_branches_path, per_page: '100'), attempts: attempts)
end
def create_repository_branch(branch_name, ref = default_branch)
api_post_to(api_repository_branches_path, branch: branch_name, ref: ref)
end
def repository_tags
response = get(request_url(api_repository_tags_path))
parse_body(response)
end
def create_repository_tag(tag_name, ref = default_branch)
api_post_to(api_repository_tags_path, tag_name: tag_name, ref: ref)
end
def repository_tree
response = get(request_url(api_repository_tree_path))
parse_body(response)

View File

@ -79,7 +79,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(imported_projects.count).to eq(1), "Expected to have 1 imported project"
expect(imported_projects.count).to eq(1), 'Expected to have 1 imported project'
aggregate_failures do
expect(imported_projects.first).to eq(source_project)
@ -120,7 +120,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(imported_projects.count).to eq(1), "Expected to have 1 imported project"
expect(imported_projects.count).to eq(1), 'Expected to have 1 imported project'
aggregate_failures do
expect(imported_issues.count).to eq(1)
@ -129,6 +129,59 @@ module QA
end
end
end
context 'with repository' do
let(:imported_project) { imported_projects.first }
let(:source_commits) { source_project.commits.map { |c| c.except(:web_url) } }
let(:source_tags) do
source_project.repository_tags.tap do |tags|
tags.each { |t| t[:commit].delete(:web_url) }
end
end
let(:source_branches) do
source_project.repository_branches.tap do |branches|
branches.each do |b|
b.delete(:web_url)
b[:commit].delete(:web_url)
end
end
end
let(:imported_commits) { imported_project.commits.map { |c| c.except(:web_url) } }
let(:imported_tags) do
imported_project.repository_tags.tap do |tags|
tags.each { |t| t[:commit].delete(:web_url) }
end
end
let(:imported_branches) do
imported_project.repository_branches.tap do |branches|
branches.each do |b|
b.delete(:web_url)
b[:commit].delete(:web_url)
end
end
end
before do
source_project.create_repository_branch('test-branch')
source_project.create_repository_tag('v0.0.1')
imported_group # trigger import
end
it 'successfully imports repository' do
expect { imported_group.import_status }.to eventually_eq('finished').within(import_wait_duration)
expect(imported_projects.count).to eq(1), 'Expected to have 1 imported project'
aggregate_failures do
expect(imported_commits).to match_array(source_commits)
expect(imported_tags).to match_array(source_tags)
expect(imported_branches).to match_array(source_branches)
end
end
end
end
end
end