fix: 本地 Pod 索引缺少所需版本时自动 --repo-update 重试
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
10c39b5116
commit
a9e169b00c
@@ -295,6 +295,28 @@ async def test_run_pod_install_uses_xcode_subdirectory(tmp_path, log_streamer):
|
||||
assert mock_exec.call_args.kwargs["cwd"] == str(sub)
|
||||
|
||||
|
||||
async def test_run_pod_install_retries_with_repo_update(tmp_path, log_streamer):
|
||||
"""本地 Specs 索引过旧找不到版本时,带 --repo-update 重试一次。"""
|
||||
(tmp_path / "Podfile").write_text("pod 'OpenSSL-Universal', '1.1.2301'")
|
||||
missing = _make_mock_process(1, b"[!] Unable to find a specification for `OpenSSL-Universal (= 1.1.2301)`\n")
|
||||
|
||||
with patch("asyncio.create_subprocess_exec", side_effect=[missing, _make_mock_process()]) as mock_exec:
|
||||
await run_pod_install("t1", tmp_path)
|
||||
|
||||
assert mock_exec.call_args_list[0].args == ("pod", "install")
|
||||
assert mock_exec.call_args_list[1].args == ("pod", "install", "--repo-update")
|
||||
|
||||
|
||||
async def test_run_pod_install_other_failure_not_retried(tmp_path, log_streamer):
|
||||
(tmp_path / "Podfile").write_text("pod 'SnapKit'")
|
||||
|
||||
with patch("asyncio.create_subprocess_exec", return_value=_make_mock_process(1, b"[!] Some error\n")) as mock_exec:
|
||||
with pytest.raises(Exception, match="pod install 失败"):
|
||||
await run_pod_install("t1", tmp_path)
|
||||
|
||||
assert mock_exec.call_count == 1
|
||||
|
||||
|
||||
async def test_build_project_passes_scheme_as_exec_argument(tmp_path, log_streamer):
|
||||
"""Scheme 中的 shell 特殊字符只能作为 xcodebuild 参数,不能被执行。"""
|
||||
build_dir = tmp_path / "build"
|
||||
|
||||
Reference in New Issue
Block a user