Skip to content
代码片段 群组 项目
提交 6229da44 编辑于 作者: Heinrich Lee Yu's avatar Heinrich Lee Yu
浏览文件

Merge branch 'bwill/consolidate-gitlab-ci-config-stubbing' into 'master'

Consolidate .gitlab-ci.yml stubbing

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/130206



Merged-by: default avatarHeinrich Lee Yu <heinrich@gitlab.com>
Approved-by: default avatardrew stachon <730684-drew@users.noreply.gitlab.com>
Approved-by: default avatarHeinrich Lee Yu <heinrich@gitlab.com>
Co-authored-by: default avatarBrian Williams <bwilliams@gitlab.com>
No related branches found
No related tags found
无相关合并请求
......@@ -23,13 +23,17 @@ def gitlab_ci_yaml
end
def stub_ci_pipeline_yaml_file(ci_yaml_content)
allow_any_instance_of(Gitlab::Ci::ProjectConfig::Repository)
.to receive(:file_in_repository?)
.and_return(ci_yaml_content.present?)
blob = instance_double(Blob, empty?: ci_yaml_content.blank?, data: ci_yaml_content)
allow(blob).to receive(:load_all_data!)
allow_any_instance_of(Repository)
.to receive(:gitlab_ci_yml_for)
.and_return(ci_yaml_content)
.to receive(:blob_at)
.and_call_original
allow_any_instance_of(Repository)
.to receive(:blob_at)
.with(String, '.gitlab-ci.yml')
.and_return(blob)
# Ensure we don't hit auto-devops when config not found in repository
unless ci_yaml_content
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册