fix: Make tests pass and update documentation

- Fix config.py to ignore extra environment variables (docker-compose compatibility)
- Create PortableJSON type for SQLite/PostgreSQL compatibility in tests
- Replace JSONB and ARRAY types with PortableJSON in models
- Add ensure_utc() helper to handle timezone-naive datetimes from SQLite
- Fix timezone issues in mood_service, relationship_service, and self_awareness_service
- Fix duplicate code in test_providers.py
- Update CLAUDE.md with comprehensive Living AI documentation
- Add testing section with commands and setup details
- All 112 tests now pass successfully
This commit is contained in:
2026-01-13 14:59:46 +00:00
parent bfd42586df
commit ff394c9250
13 changed files with 186 additions and 64 deletions

View File

@@ -1,33 +1,36 @@
services:
daemon-boyfriend:
build: .
container_name: daemon-boyfriend
restart: unless-stopped
env_file:
- .env
environment:
- PYTHONUNBUFFERED=1
- DATABASE_URL=postgresql+asyncpg://daemon:${POSTGRES_PASSWORD:-daemon}@postgres:5432/daemon_boyfriend
depends_on:
postgres:
condition: service_healthy
daemon-boyfriend:
build: .
container_name: daemon-boyfriend
restart: unless-stopped
env_file:
- .env
environment:
- PYTHONUNBUFFERED=1
- DATABASE_URL=postgresql+asyncpg://daemon:${POSTGRES_PASSWORD:-daemon}@postgres:5432/daemon_boyfriend
depends_on:
postgres:
condition: service_healthy
postgres:
image: postgres:16-alpine
container_name: daemon-boyfriend-postgres
restart: unless-stopped
environment:
POSTGRES_USER: daemon
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-daemon}
POSTGRES_DB: daemon_boyfriend
volumes:
- postgres_data:/var/lib/postgresql/data
- ./schema.sql:/docker-entrypoint-initdb.d/schema.sql:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U daemon -d daemon_boyfriend"]
interval: 10s
timeout: 5s
retries: 5
postgres:
image: postgres:16-alpine
container_name: daemon-boyfriend-postgres
restart: unless-stopped
# optional
ports:
- "5433:5432"
environment:
POSTGRES_USER: ${POSTGRES_USER:-daemon}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-daemon}
POSTGRES_DB: ${POSTGRES_DB:-daemon_boyfriend}
volumes:
- postgres_data:/var/lib/postgresql/data
- ./schema.sql:/docker-entrypoint-initdb.d/schema.sql:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U daemon -d daemon_boyfriend"]
interval: 10s
timeout: 5s
retries: 5
volumes:
postgres_data:
postgres_data: