Skip to content

Commit 29eb766

Browse files
committed
update
1 parent 96638e3 commit 29eb766

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

tests/integration/framework/config.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,48 @@ class PathManager:
4747
_INTEGRATION_DIR = Path(__file__).resolve().parents[1]
4848
_PROJECT_ROOT = _INTEGRATION_DIR.parents[1]
4949

50+
@classmethod
51+
def get_target_dir(cls) -> Path:
52+
"""Return the integration-test workspace root (tests/integration/target)."""
53+
return cls._INTEGRATION_DIR / "target"
54+
55+
@classmethod
56+
def get_binary_path(cls) -> Path:
57+
"""Locate the compiled function-stream binary under the project target dir."""
58+
import platform
59+
import struct
60+
61+
system = platform.system()
62+
machine = platform.machine().lower()
63+
arch_map = {"arm64": "aarch64", "amd64": "x86_64"}
64+
arch = arch_map.get(machine, machine)
65+
66+
if system == "Linux":
67+
triple = f"{arch}-unknown-linux-gnu"
68+
elif system == "Darwin":
69+
triple = f"{arch}-apple-darwin"
70+
elif system == "Windows":
71+
triple = f"{arch}-pc-windows-msvc"
72+
else:
73+
triple = f"{arch}-unknown-linux-gnu"
74+
75+
binary_name = "function-stream.exe" if system == "Windows" else "function-stream"
76+
candidate = cls._PROJECT_ROOT / "target" / triple / "release" / binary_name
77+
78+
if candidate.is_file():
79+
return candidate
80+
81+
fallback = cls._PROJECT_ROOT / "target" / "release" / binary_name
82+
if fallback.is_file():
83+
return fallback
84+
85+
raise FileNotFoundError(
86+
f"Cannot find function-stream binary. Checked:\n"
87+
f" - {candidate}\n"
88+
f" - {fallback}\n"
89+
f"Build first with: make build (or make build-lite)"
90+
)
91+
5092
@classmethod
5193
def get_shared_cache_dir(cls) -> Path:
5294
return cls._INTEGRATION_DIR / "target" / ".shared_cache"

0 commit comments

Comments
 (0)