This commit introduces a proper integration test environment for the frontend: - Creates a test environment option in the frontend installer - Uses the real backend in Docker containers - Binds frontend to 127.0.0.1 for local testing only - Adds automatic verification testing of backend-frontend communication - Provides scripts to easily start and stop the test environment 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
45 lines
991 B
YAML
45 lines
991 B
YAML
version: '3.8'
|
|
|
|
services:
|
|
# Backend for testing
|
|
backend:
|
|
build:
|
|
context: ../../backend
|
|
dockerfile: Dockerfile
|
|
container_name: myp-backend-test
|
|
ports:
|
|
- "5000:5000"
|
|
environment:
|
|
- SECRET_KEY=testsecretkey123456789
|
|
- DATABASE_URL=sqlite:///myp.db
|
|
- FLASK_ENV=development
|
|
- TESTING=true
|
|
volumes:
|
|
- backend-test-data:/app/instance
|
|
networks:
|
|
- test-network
|
|
|
|
# Frontend for testing - bound to loopback address
|
|
frontend-test:
|
|
build:
|
|
context: ..
|
|
dockerfile: Dockerfile
|
|
container_name: myp-frontend-test
|
|
environment:
|
|
- NODE_ENV=development
|
|
- AUTH_TRUST_HOST=true
|
|
- AUTH_SECRET=test-secret-key-for-testing-only-do-not-use-in-production
|
|
- NEXT_PUBLIC_BACKEND_URL=http://backend:5000
|
|
ports:
|
|
- "127.0.0.1:3000:3000"
|
|
depends_on:
|
|
- backend
|
|
networks:
|
|
- test-network
|
|
|
|
networks:
|
|
test-network:
|
|
driver: bridge
|
|
|
|
volumes:
|
|
backend-test-data: |