Skip to content

Commit 2c29049

Browse files
Merge pull request #304 from modelstudioai/fix/native-http-probe-path
test(runtime): keep native HTTP probe at a stable path
2 parents 21a17ab + 39f66ce commit 2c29049

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

‎packages/runtime/tests/http-bun.e2e.test.ts‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { execFile, spawnSync } from "node:child_process";
2-
import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
2+
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
33
import { createServer, request as forwardRequest, type Server } from "node:http";
44
import { createConnection, type AddressInfo, type Socket } from "node:net";
55
import { tmpdir } from "node:os";
@@ -142,7 +142,12 @@ describe("core HTTP across Node, native Bun and compiled binaries", () => {
142142
proxyUrl = `http://127.0.0.1:${(proxy.address() as AddressInfo).port}`;
143143
probeDirectory = mkdtempSync(join(tmpdir(), "bl-native-http-"));
144144
scriptPath = join(probeDirectory, "probe.mts");
145-
binaryPath = join(probeDirectory, process.platform === "win32" ? "probe.exe" : "probe");
145+
// Keep the executable at a stable path for local security approvals.
146+
binaryPath = join(
147+
repositoryRoot,
148+
"test/native-http-probe",
149+
process.platform === "win32" ? "probe.exe" : "probe",
150+
);
146151
writeFileSync(
147152
scriptPath,
148153
`
@@ -218,6 +223,7 @@ try {
218223
)("%s", (runtime) => {
219224
beforeAll(async () => {
220225
if (runtime !== "binary") return;
226+
mkdirSync(dirname(binaryPath), { recursive: true });
221227
const target = `bun-${process.platform === "win32" ? "windows" : process.platform}-${process.arch}`;
222228
await execFileAsync(
223229
bun,

0 commit comments

Comments
 (0)