test: add unraid docker test harness

This commit is contained in:
openclaw 2026-03-04 21:13:12 +00:00
parent d2ed667f0c
commit f8bd8e0ef0
5 changed files with 31 additions and 5 deletions

10
Dockerfile.test Normal file
View file

@ -0,0 +1,10 @@
FROM node:22-bookworm
WORKDIR /app/backend
COPY backend/package*.json ./
RUN npm ci
COPY backend/ ./
CMD ["npm", "test"]

View file

@ -11,6 +11,12 @@ Erster funktionaler Backend-Stand für die Vision:
- Kontaktdatenaustausch nach Deal (`/contacts/request`, `/contacts/respond`, `/contacts/deal/:dealId`) - Kontaktdatenaustausch nach Deal (`/contacts/request`, `/contacts/respond`, `/contacts/deal/:dealId`)
- Serverseitige AES-256-GCM-Verschlüsselung für Adresse/Telefon (`DATA_ENCRYPTION_KEY`) - Serverseitige AES-256-GCM-Verschlüsselung für Adresse/Telefon (`DATA_ENCRYPTION_KEY`)
## Docker-Test (Unraid Host)
```bash
./scripts/test-in-docker.sh
```
## Start ## Start
```bash ```bash

View file

@ -17,11 +17,7 @@ Stabile, sichere Releases durch standardisierte Tests in Docker auf dem Unraid-H
Im Repo-Root ausführen: Im Repo-Root ausführen:
```bash ```bash
docker run --rm -t \ ./scripts/test-in-docker.sh
-v "$PWD":/app \
-w /app/backend \
node:22-bookworm \
bash -lc "npm ci && npm test"
``` ```
## Mindest-Testumfang ## Mindest-Testumfang

7
docker-compose.test.yml Normal file
View file

@ -0,0 +1,7 @@
services:
backend-test:
build:
context: .
dockerfile: Dockerfile.test
working_dir: /app/backend
command: npm test

7
scripts/test-in-docker.sh Executable file
View file

@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")/.."
docker compose -f docker-compose.test.yml build --no-cache backend-test
docker compose -f docker-compose.test.yml run --rm backend-test