Skip to content
代码片段 群组 项目
未验证 提交 4c3c68f1 编辑于 作者: Stan Hu's avatar Stan Hu
浏览文件

Fix 404 handling in detect-previous-failed-tests job

Previously `scripts/pipeline_test_report_builder.rb` would fail with
an exit code of 1 when attempting to retrieve CI artifacts that
returned a 404 error. This was happening because the comparison failed
because `Net::HTTP::Response#code` returns a string, not an integer.

Closes https://gitlab.com/gitlab-org/gitlab/-/issues/367944
上级 d2c11b9b
No related branches found
No related tags found
无相关合并请求
...@@ -73,7 +73,7 @@ def failed_builds_for_pipeline(pipeline) ...@@ -73,7 +73,7 @@ def failed_builds_for_pipeline(pipeline)
def test_report_for_build(pipeline, build_id) def test_report_for_build(pipeline, build_id)
fetch("#{pipeline['web_url']}/tests/suite.json?build_ids[]=#{build_id}") fetch("#{pipeline['web_url']}/tests/suite.json?build_ids[]=#{build_id}")
rescue Net::HTTPServerException => e rescue Net::HTTPServerException => e
raise e unless e.response.code == 404 raise e unless e.response.code.to_i == 404
puts "Artifacts not found. They may have expired. Skipping this build." puts "Artifacts not found. They may have expired. Skipping this build."
end end
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册