torrent-gateway/docker-compose.test.yml
enki b3204ea07a
Some checks are pending
CI Pipeline / Run Tests (push) Waiting to run
CI Pipeline / Lint Code (push) Waiting to run
CI Pipeline / Security Scan (push) Waiting to run
CI Pipeline / Build Docker Images (push) Blocked by required conditions
CI Pipeline / E2E Tests (push) Blocked by required conditions
first commit
2025-08-18 00:40:15 -07:00

75 lines
1.5 KiB
YAML

version: '3.8'
services:
gateway-test:
build:
context: .
dockerfile: Dockerfile.test
environment:
- GO_ENV=test
- CGO_ENABLED=1
- TEST_DATABASE_URL=sqlite3:///tmp/test.db
volumes:
- .:/app
- /tmp:/tmp
command: ["go", "test", "-v", "./test/...", "-timeout", "10m"]
depends_on:
- redis-test
- mock-nostr-relay
redis-test:
image: redis:7-alpine
command: redis-server --port 6380
ports:
- "6380:6380"
# Mock Nostr relay for testing
mock-nostr-relay:
image: scsibug/nostr-rs-relay:latest
ports:
- "7777:8080"
environment:
- RUST_LOG=warn
volumes:
- test_relay_data:/usr/src/app/db
# Test database
test-db:
image: sqlite:latest
volumes:
- test_db_data:/data
environment:
- SQLITE_DATABASE=/data/test.db
# Integration test runner
integration-tests:
build:
context: .
dockerfile: Dockerfile.test
environment:
- BASE_URL=http://gateway-test:9876
- TEST_TIMEOUT=300
volumes:
- ./test:/app/test
command: ["go", "test", "-v", "./test", "-tags=integration", "-timeout", "15m"]
depends_on:
- gateway-test
# E2E test runner
e2e-tests:
image: curlimages/curl:latest
volumes:
- ./test/e2e:/tests
environment:
- BASE_URL=http://gateway-test:9876
command: ["sh", "/tests/run_all_tests.sh"]
depends_on:
- gateway-test
volumes:
test_relay_data:
test_db_data:
networks:
default:
name: torrent-gateway-test