更新
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
PROJECT_ROOT = Path(__file__).resolve().parents[1]
|
||||
|
||||
|
||||
def read(relative_path: str) -> str:
|
||||
return (PROJECT_ROOT / relative_path).read_text(encoding="utf-8")
|
||||
|
||||
|
||||
def test_windows_one_click_entrypoints_and_release_pipeline() -> None:
|
||||
for name in (
|
||||
"Run_DoctorWorkstation.bat",
|
||||
"Build_DoctorWorkstation.bat",
|
||||
"一键运行_医生工作站.bat",
|
||||
"一键打包_医生工作站.bat",
|
||||
):
|
||||
assert (PROJECT_ROOT / name).is_file()
|
||||
|
||||
run_script = read("scripts/run_windows.ps1")
|
||||
package_script = read("scripts/package_windows.ps1")
|
||||
release_launcher = read("packaging/windows/start_release.bat")
|
||||
|
||||
assert run_script.index("$FrozenExecutable") < run_script.index("Find-Uv")
|
||||
assert "& $Uv sync --frozen" in run_script
|
||||
assert "& $Uv sync --frozen --extra build" in package_script
|
||||
assert "& $Npm ci --prefix" in package_script
|
||||
assert "build_windows.ps1" in package_script
|
||||
assert "DoctorWorkstation-Windows-x64-$ProjectVersion.zip" in package_script
|
||||
assert "Get-FileHash" in package_script
|
||||
assert "Start_DoctorWorkstation.bat" in package_script
|
||||
assert "DoctorWorkstation\\DoctorWorkstation.exe" in release_launcher
|
||||
assert "explorer.exe" in read("Build_DoctorWorkstation.bat")
|
||||
|
||||
|
||||
def test_macos_one_click_entrypoints_and_release_pipeline() -> None:
|
||||
for name in (
|
||||
"run_macos.command",
|
||||
"package_macos.command",
|
||||
"一键运行.command",
|
||||
"一键打包.command",
|
||||
):
|
||||
assert (PROJECT_ROOT / name).is_file()
|
||||
|
||||
run_script = read("scripts/run_macos.sh")
|
||||
package_script = read("scripts/package_macos.sh")
|
||||
|
||||
assert run_script.index('/usr/bin/open "$artifact"') < run_script.index("macos_ensure_uv")
|
||||
assert "sync --locked" in run_script
|
||||
assert "sync --locked --extra build" in package_script
|
||||
assert 'ci --prefix "$project_root/video_companion"' in package_script
|
||||
assert "/usr/bin/ditto -c -k --sequesterRsrc --keepParent" in package_script
|
||||
assert "/usr/bin/shasum -a 256" in package_script
|
||||
assert "DoctorWorkstation-macOS-$release_arch-$project_version.zip" in package_script
|
||||
Reference in New Issue
Block a user