Files
SnapOtter/docker/docker-compose.test.yml
T
Siddharth Kumar Sah 80e536bcf8 chore: remove dead code, add test infrastructure, update docs
- Delete 3 dead files: use-batch-processor.ts, use-i18n.ts, smart-crop.ts (AI package)
- Remove dead getJobProgress function and unused runPythonScript wrapper
- Remove 6 unused imports across API and web apps
- Remove unused shared types (ImageFormat, AppConfig, ApiError, HealthResponse, JobProgress)
  and constants (SUPPORTED_INPUT_FORMATS/OUTPUT_FORMATS, DEFAULT_OUTPUT_FORMAT)
- Remove unused store method (setOriginalBlobUrl) and clean AI package re-exports
- Add test infrastructure: vitest config, unit/integration/e2e tests, fixtures, screenshots
- Add Docker test infrastructure: Dockerfile.test, docker-compose.test.yml
- Add download_models.py for pre-baking AI model weights in Docker
- Add filename sanitization utility (apps/api/src/lib/filename.ts)
- Update .gitignore to exclude coverage/, *.tsbuildinfo, .superpowers/, test artifacts
- Update .dockerignore to exclude test/coverage/IDE artifacts from builds
- Update docs: remove smart crop from AI docs (uses Sharp directly), update bridge docs
2026-03-23 11:46:45 +08:00

49 lines
1.7 KiB
YAML

###############################################################################
# Test infrastructure - run with:
# docker compose -f docker/docker-compose.test.yml up --build --abort-on-container-exit
###############################################################################
services:
# ── Unit + Integration tests ─────────────────────────────────────────────
test-unit:
build:
context: ..
dockerfile: docker/Dockerfile.test
container_name: stirling-test-unit
command: ["pnpm", "test:ci"]
environment:
- NODE_ENV=test
- AUTH_ENABLED=true
- DEFAULT_USERNAME=admin
- DEFAULT_PASSWORD=admin
- DB_PATH=/tmp/test-stirling.db
- WORKSPACE_PATH=/tmp/test-workspace
- MAX_MEGAPIXELS=100
- RATE_LIMIT_PER_MIN=1000
tmpfs:
- /tmp/test-workspace
- /tmp
# ── E2E tests (Playwright against full app) ─────────────────────────────
test-e2e:
build:
context: ..
dockerfile: docker/Dockerfile.test
container_name: stirling-test-e2e
command: ["sh", "-c", "npx playwright install --with-deps chromium && pnpm test:e2e"]
environment:
- NODE_ENV=test
- AUTH_ENABLED=true
- DEFAULT_USERNAME=admin
- DEFAULT_PASSWORD=admin
- DB_PATH=/tmp/test-stirling.db
- WORKSPACE_PATH=/tmp/test-workspace
- MAX_MEGAPIXELS=100
- RATE_LIMIT_PER_MIN=1000
- CI=true
tmpfs:
- /tmp/test-workspace
- /tmp
depends_on:
test-unit:
condition: service_completed_successfully