Commit 7196be85 authored by Ramya Authappan's avatar Ramya Authappan

Merge branch 'qa-shl-fix-group-file-template-spec' into 'master'

Recreate project if Readme is missing

Closes #220608

See merge request gitlab-org/gitlab!34840
parents b91d3f8e d2700a47
......@@ -96,7 +96,11 @@ module QA
end
def has_file?(file_path)
repository_tree.any? { |file| file[:path] == file_path }
response = repository_tree
raise ResourceNotFoundError, "#{response[:message]}" if response.is_a?(Hash) && response.has_key?(:message)
response.any? { |file| file[:path] == file_path }
end
def api_get_path
......
......@@ -52,14 +52,18 @@ module QA
group.api_client = @api_client
end
@file_template_project = Resource::Project.fabricate_via_api! do |project|
project.group = @group
project.name = 'group-file-template-project'
project.description = 'Add group file templates'
project.auto_devops_enabled = false
project.initialize_with_readme = true
project.user = admin
project.api_client = @api_client
Support::Retrier.retry_until(retry_on_exception: true) do
@file_template_project = Resource::Project.fabricate_via_api! do |project|
project.group = @group
project.name = 'group-file-template-project'
project.description = 'Add group file templates'
project.auto_devops_enabled = false
project.initialize_with_readme = true
project.user = admin
project.api_client = @api_client
end
@file_template_project.has_file?("README.md")
end
Resource::Repository::Commit.fabricate_via_api! do |commit|
......
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