cleanup(build): collapse native runtime payloads

This commit is contained in:
Tianyi Cui
2026-07-30 01:09:54 +08:00
parent 0e53b7a8aa
commit 7118b4cfe1
4 changed files with 60 additions and 139 deletions
+3 -27
View File
@@ -68,7 +68,7 @@ def test_stage_runtime_rejects_missing_spawn_helper(tmp_path: Path) -> None:
executable.write_bytes(b"runtime")
executable.chmod(0o755)
with pytest.raises(FileNotFoundError, match="spawn helper"):
with pytest.raises(FileNotFoundError, match="spawn-helper"):
build_python_release.stage_runtime(
tmp_path / "staging",
"1.2.3",
@@ -77,32 +77,8 @@ def test_stage_runtime_rejects_missing_spawn_helper(tmp_path: Path) -> None:
)
def test_stage_runtime_rejects_unsupported_executable_name(tmp_path: Path) -> None:
executable = tmp_path / "custom-runtime"
executable.write_bytes(b"runtime")
executable.chmod(0o755)
with pytest.raises(
ValueError,
match=(
"unsupported runtime executable 'custom-runtime'; expected one of: "
"dsh-jsonrpc-agent-pkg-linux-arm64, dsh-jsonrpc-agent-pkg-linux-x64, "
"dsh-jsonrpc-agent-pkg-macos-arm64"
),
):
build_python_release.stage_runtime(
tmp_path / "staging",
"1.2.3",
executable,
executable.name,
)
@pytest.mark.parametrize("target", ["linux-x64", "linux-arm64"])
def test_stage_runtime_copies_linux_executable_without_spawn_helper(
tmp_path: Path, target: str
) -> None:
executable = tmp_path / f"dsh-jsonrpc-agent-pkg-{target}"
def test_stage_runtime_copies_linux_executable_without_spawn_helper(tmp_path: Path) -> None:
executable = tmp_path / "dsh-jsonrpc-agent-pkg-linux-x64"
executable.write_bytes(b"runtime")
executable.chmod(0o755)
destination = tmp_path / "staging"