-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.test
More file actions
42 lines (30 loc) · 1.26 KB
/
Dockerfile.test
File metadata and controls
42 lines (30 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
FROM oven/bun:1-slim
WORKDIR /app
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
# Create fake home directory with OpenClaw structure
RUN mkdir -p /home/tps/.openclaw/workspace-test \
&& mkdir -p /home/tps/.openclaw/agents
ENV HOME=/home/tps
# Mock openclaw binary — returns canned JSON for common commands
RUN printf '#!/bin/sh\n\
case "$1" in\n\
status) echo '"'"'{"status":"running","version":"0.1.0"}'"'"';;\n\
"config") echo '"'"'{"agents":{"list":[]}}'"'"';;\n\
*) echo "mock openclaw: $@";;\n\
esac\n' > /usr/local/bin/openclaw \
&& chmod +x /usr/local/bin/openclaw
# Copy root workspace files
COPY package.json bun.lock* tsconfig*.json ./
# Copy package manifests first for layer caching
COPY packages/cli/package.json packages/cli/tsconfig.json ./packages/cli/
COPY packages/cli/scripts/ ./packages/cli/scripts/
COPY packages/agent/package.json packages/agent/tsconfig.json ./packages/agent/
RUN bun install --frozen-lockfile 2>/dev/null || bun install
# Copy all source
COPY . .
# Make test fakes executable
RUN chmod +x test/fakes/nono/bin/nono 2>/dev/null || true
RUN chmod +x packages/cli/test/fakes/nono/bin/nono 2>/dev/null || true
# Build TypeScript (monorepo workspaces)
RUN bun run build
CMD ["bun", "run", "test"]