# Dev Containers Test This directory contains test configurations and scripts for Docker containers used in development for testing. ## SeaweedFS (S3-compatible file storage) `docker-compose.seaweedfs.yml` starts SeaweedFS with its S3 API on `localhost:8333` and creates two buckets: `taskview` for local development and `taskview-test` for the files integration tests (`src/tv-modules/files/__tests__/*.integration.spec.ts`). Those tests expect it to be up: ```bash docker compose -f docker-compose.seaweedfs.yml up -d --wait ``` To point a dev API at it: `FILE_STORAGE_PROVIDER=s3`, `FILE_STORAGE_S3_BUCKET=taskview`, `FILE_STORAGE_S3_ENDPOINT=http://localhost:8333`, `FILE_STORAGE_S3_REGION=us-east-1`, `FILE_STORAGE_S3_ACCESS_KEY=taskview`, `FILE_STORAGE_S3_SECRET_KEY=taskview-secret`, `FILE_STORAGE_S3_FORCE_PATH_STYLE=true`. ## Redis `docker-compose.redis.yml` starts Redis on `localhost:6380`. The rate limit integration tests (`src/core/rate-limit/__tests__/*.integration.spec.ts`) expect it to be up: ```bash docker compose -f docker-compose.redis.yml up -d --wait ``` To point a dev API at it: `REDIS_URL=redis://localhost:6380`. ## Database of the API specs `npx vitest run` works against its own PostgreSQL in docker (`docker-compose.test-db.yml`, `localhost:15433`), never against a local dev database. Vitest starts it by itself through `test-db.sh`: the script brings the container up, builds the migrations of the current source into an image, applies them and adds the account the specs sign in as (`test-db-seed.sql`). When nothing changed in `src/migrations`, a run only checks that the database answers. ```bash bash dev-containers-test/test-db.sh # start and migrate, as vitest does bash dev-containers-test/test-db.sh reset # drop the data and start over ``` The SE API specs have a database of their own with the SE migrations on top: `se/api/test-db/`, `localhost:15434`.