Skip to content

Commit 93efd51

Browse files
committed
test: Docker-isolated integration test runner (#287)
CLI integration tests (contracts, content, version) now run in a Docker container with GIT_MIND_DISABLE_UPGRADE_CHECK=1 set at the image level. npm test runs unit tests only; npm run test:integration runs Docker.
1 parent b402c8c commit 93efd51

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

test/Dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FROM node:22-slim
2+
3+
RUN apt-get update && apt-get install -y git python3 make g++ && rm -rf /var/lib/apt/lists/*
4+
5+
# Disable upgrade check — no network egress in test container
6+
ENV GIT_MIND_DISABLE_UPGRADE_CHECK=1
7+
ENV NO_COLOR=1
8+
9+
WORKDIR /app
10+
11+
# Install deps first (layer cache)
12+
COPY package.json package-lock.json ./
13+
RUN npm ci
14+
15+
# Copy source
16+
COPY bin/ bin/
17+
COPY src/ src/
18+
COPY test/ test/
19+
COPY docs/contracts/ docs/contracts/
20+
COPY extensions/ extensions/
21+
22+
# Git identity for tests that init repos
23+
RUN git config --global user.email "test@test.com" && \
24+
git config --global user.name "Test"
25+
26+
# Run only integration tests (files that spawn bin/git-mind.js)
27+
CMD ["npx", "vitest", "run", "test/contracts.integration.test.js", "test/content.test.js", "test/version.test.js"]

0 commit comments

Comments
 (0)