Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/codev-sandbox/image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential pkg-config \
&& rm -rf /var/lib/apt/lists/*
ARG TARGETARCH
ARG NODE_VERSION=v22.15.0
# Track the Node major Electron embeds (Electron 42 = Node 24): the guest runs
# the same server bundle as the desktop sidecar, and the bundle uses node:sqlite
# APIs (StatementSync.setReturnArrays) that Node 22 does not have — under 22
# every DB-touching route fails while /global/health still passes.
ARG NODE_VERSION=v24.19.0
RUN set -eux; \
case "$TARGETARCH" in amd64) NODE_ARCH=x64 ;; arm64) NODE_ARCH=arm64 ;; *) echo "unsupported arch: $TARGETARCH" >&2; exit 1 ;; esac; \
curl -fsSL "https://nodejs.org/dist/${NODE_VERSION}/node-${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz" \
Expand Down
14 changes: 13 additions & 1 deletion packages/codev-sandbox/script/e2e-vz.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,18 @@ console.log(`server: ${sandbox.url} (user ${sandbox.username})`)
const healthy = await checkSandboxHealth(sandbox.url, { username: sandbox.username ?? "", password: sandbox.password })
console.log(`health: ${healthy ? "OK" : "FAILED"}`)

// /global/health never touches the instance store; /path boots it, so this is
// the probe that catches a guest runtime the bundle cannot actually run on
// (e.g. a node:sqlite too old for the bundle's prepared statements).
const pathsOk = await fetch(`${sandbox.url}/path`, {
headers: {
authorization: `Basic ${Buffer.from(`${sandbox.username ?? ""}:${sandbox.password}`).toString("base64")}`,
},
})
.then((response) => response.ok)
.catch(() => false)
console.log(`path api: ${pathsOk ? "OK" : "FAILED"}`)

if (hold) {
console.log("holding the VM up; Ctrl-C to stop")
await new Promise(() => {})
Expand All @@ -69,7 +81,7 @@ await Promise.race([exited, new Promise((resolve) => setTimeout(resolve, 10_000)
await provider.destroy(config)
server.stop(true)
await rm(work, { recursive: true, force: true })
if (!healthy) process.exit(1)
if (!healthy || !pathsOk) process.exit(1)
console.log("e2e OK")
process.exit(0)

Expand Down
14 changes: 13 additions & 1 deletion packages/codev-sandbox/script/e2e-wsl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,18 @@ console.log(`server: ${sandbox.url} (user ${sandbox.username})`)
const healthy = await checkSandboxHealth(sandbox.url, { username: sandbox.username ?? "", password: sandbox.password })
console.log(`health: ${healthy ? "OK" : "FAILED"}`)

// /global/health never touches the instance store; /path boots it, so this is
// the probe that catches a guest runtime the bundle cannot actually run on
// (e.g. a node:sqlite too old for the bundle's prepared statements).
const pathsOk = await fetch(`${sandbox.url}/path`, {
headers: {
authorization: `Basic ${Buffer.from(`${sandbox.username ?? ""}:${sandbox.password}`).toString("base64")}`,
},
})
.then((response) => response.ok)
.catch(() => false)
console.log(`path api: ${pathsOk ? "OK" : "FAILED"}`)

if (hold) {
console.log("holding the distribution up; Ctrl-C to stop")
await new Promise(() => {})
Expand All @@ -85,7 +97,7 @@ await Promise.race([exited, new Promise((resolve) => setTimeout(resolve, 10_000)
if (keep) console.log(`keeping the distribution; remove it with: wsl --unregister codev-${config.name}`)
if (!keep) await provider.destroy(config)
await cleanup()
if (!healthy) process.exit(1)
if (!healthy || !pathsOk) process.exit(1)
console.log("e2e OK")
process.exit(0)

Expand Down
Loading