fix: 统一打包副本 Podfile 大小写
This commit is contained in:
@@ -44,7 +44,7 @@ def tmp_dirs(tmp_path):
|
||||
vendor_dir.mkdir(parents=True)
|
||||
(vendor_dir / "RDEpubReaderView.podspec").write_text("Pod::Spec.new do |s| end")
|
||||
(source_dir / "readoorTests").mkdir()
|
||||
(source_dir / "podfile").write_text("pod 'AFNetworking'")
|
||||
(source_dir / "Podfile").write_text("pod 'AFNetworking'")
|
||||
|
||||
build_dir = tmp_path / "build"
|
||||
return source_dir, build_dir
|
||||
@@ -154,12 +154,29 @@ async def test_copy_source_code(tmp_dirs, log_streamer):
|
||||
assert result.exists()
|
||||
assert (result / "readoor" / "AppDelegate.swift").exists()
|
||||
assert (result / "Pods").exists()
|
||||
assert (result / "Podfile").exists()
|
||||
assert not (result / "podfile").exists()
|
||||
assert (result / "Podfile.lock").exists()
|
||||
assert (result / "readoor.xcworkspace").exists()
|
||||
assert (result / "Vendor" / "RDEpubReaderView" / "RDEpubReaderView.podspec").exists()
|
||||
assert not (result / "AutoPacking").exists()
|
||||
|
||||
|
||||
async def test_copy_source_code_normalizes_lowercase_podfile(tmp_dirs, log_streamer):
|
||||
"""旧分支的 podfile 也必须复制为 Pods 工程引用的 Podfile。"""
|
||||
source_dir, build_dir_parent = tmp_dirs
|
||||
(source_dir / "Podfile").unlink()
|
||||
(source_dir / "podfile").write_text("pod 'AFNetworking'")
|
||||
task = MagicMock(branch="main")
|
||||
|
||||
with patch("backend.services.build_service.BUILD_BASE_DIR", build_dir_parent):
|
||||
result = await copy_source_code("t1", task, source_dir)
|
||||
|
||||
copied_names = {path.name for path in result.iterdir()}
|
||||
assert "Podfile" in copied_names
|
||||
assert "podfile" not in copied_names
|
||||
|
||||
|
||||
async def test_copy_source_code_excludes_git(tmp_dirs, log_streamer):
|
||||
"""拷贝时排除 .git 目录"""
|
||||
source_dir, build_dir_parent = tmp_dirs
|
||||
|
||||
Reference in New Issue
Block a user