-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathcompose.player-e2e.yml
More file actions
147 lines (135 loc) · 4.19 KB
/
compose.player-e2e.yml
File metadata and controls
147 lines (135 loc) · 4.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# Docker Compose for Player E2E Integration Tests
#
# This runs the full stack with Flutter integration tests:
# - metadata-relay: Used by backend claim-code flow during pairing
# - mydia: Main application
# - test: Flutter Linux desktop integration test runner
#
# How it works:
# Tests run on native Linux (`flutter test -d linux`) under xvfb so the
# iroh P2P code path is exercised. This is intentionally not web/chrome.
#
# Performance optimizations:
# - BuildKit enabled for cache mounts (DOCKER_BUILDKIT=1)
# - Reduced service dependencies for faster parallel startup
# - Pre-build with: ./dev player e2e-build
#
# Usage:
# DOCKER_BUILDKIT=1 docker compose -f compose.player-e2e.yml build
# docker compose -f compose.player-e2e.yml up --abort-on-container-exit
# docker compose -f compose.player-e2e.yml down -v
services:
# ============================================
# Metadata Relay Service
# ============================================
relay:
build:
context: .
dockerfile: metadata-relay/Dockerfile
container_name: e2e_relay
environment:
PORT: "4001"
SQLITE_DB_PATH: /data/relay.db
LIBP2P_RENDEZVOUS_ENABLED: "true"
RENDEZVOUS_MASTER_PEPPER: "test-pepper-not-for-production"
# No API keys needed for E2E tests (not testing metadata fetching)
volumes:
- relay_data:/data
ports:
- "14001:4001"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:4001/health"]
interval: 2s
timeout: 2s
start_period: 5s
retries: 10
networks:
- e2e
# ============================================
# Mydia Main Application
# ============================================
mydia:
build:
context: .
dockerfile: Dockerfile.e2e
container_name: e2e_mydia
environment:
# Phoenix config
PHX_HOST: mydia
PHX_SERVER: "true"
PORT: "4000"
HTTPS_PORT: "4443"
SECRET_KEY_BASE: "E2ETestSecretKeyBase123456789012345678901234567890123456789012345"
GUARDIAN_SECRET_KEY: "E2ETestGuardianSecretKey12345678901234567890123456789012345678"
# Database
DATABASE_PATH: /config/mydia.db
MIX_ENV: prod
# Relay connection
METADATA_RELAY_URL: "http://relay:4001"
# E2E test mode - auto-enable remote access
E2E_MODE: "true"
ENABLE_REMOTE_ACCESS: "true"
E2E_ADMIN_EMAIL: "admin@test.local"
E2E_ADMIN_PASSWORD: "testpassword123"
# Disable HTTPS origin checks for E2E
PHX_CHECK_ORIGIN: "false"
# Direct URLs config for E2E testing
# Use HTTP instead of HTTPS for sslip.io URLs (required for E2E since we don't have certs)
EXTERNAL_PORT: "4000"
PUBLIC_IP_ENABLED: "false"
DIRECT_URLS_USE_HTTP: "true"
volumes:
- mydia_config:/config
- mydia_data:/data
ports:
- "14000:4000"
- "14443:4443"
depends_on:
relay:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:4000/health"]
interval: 2s
timeout: 2s
start_period: 15s
retries: 20
networks:
- e2e
# ============================================
# Flutter Integration Test Runner
# ============================================
# The test container includes Chrome and runs tests using
# `flutter test -d chrome`, which manages Chrome directly.
test:
build:
context: .
dockerfile: player/Dockerfile.test
container_name: e2e_test
environment:
# Backend service URLs (test container is on the e2e network)
MYDIA_URL: "http://mydia:4000"
RELAY_URL: "http://relay:4001"
# Test selection (set by ./dev player e2e --target/-- args)
E2E_TEST_TARGET: ${E2E_TEST_TARGET:-integration_test/pairing_flow_test.dart}
E2E_TEST_ARGS: ${E2E_TEST_ARGS:-}
# Test admin credentials
E2E_ADMIN_EMAIL: "admin@test.local"
E2E_ADMIN_PASSWORD: "testpassword123"
depends_on:
mydia:
condition: service_healthy
relay:
condition: service_healthy
networks:
- e2e
# Test runner exits when done
networks:
e2e:
driver: bridge
volumes:
relay_data:
driver: local
mydia_config:
driver: local
mydia_data:
driver: local