-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.test.yml
More file actions
46 lines (45 loc) · 1.46 KB
/
docker-compose.test.yml
File metadata and controls
46 lines (45 loc) · 1.46 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
version: '3.8'
services:
test-db:
image: postgres:15
environment:
POSTGRES_USER: bridging_bot
POSTGRES_PASSWORD: bridging_bot
POSTGRES_DB: bridging_bot_test
ports:
- "5432:5432"
volumes:
- ./src/db/schema.sql:/docker-entrypoint-initdb.d/01-schema.sql
- ./src/db/migrations:/docker-entrypoint-initdb.d/migrations
- ./scripts/apply-migrations.sh:/docker-entrypoint-initdb.d/99-apply-migrations.sh
healthcheck:
test: ["CMD-SHELL", "pg_isready -U bridging_bot"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
test-runner:
build:
context: .
dockerfile: Dockerfile
command: bash -c "poetry run pytest -v -W ignore::pytest.PytestDeprecationWarning"
environment:
POSTGRES_HOST: test-db
POSTGRES_PORT: 5432
POSTGRES_USER: bridging_bot
POSTGRES_PASSWORD: bridging_bot
TEST_DATABASE: bridging_bot_test
DATABASE_URL: postgresql://bridging_bot:bridging_bot@test-db:5432/bridging_bot_test
# Dummy values for required env vars that aren't used in tests
REDDIT_CLIENT_ID: test_client_id
REDDIT_CLIENT_SECRET: test_client_secret
REDDIT_USER_AGENT: "python:bridging_bot:test"
GOOGLE_SHEETS_CREDS_PATH: /app/test_creds.json
GOOGLE_SHEETS_ID: test_sheet_id
GOOGLE_SHEETS_RANGE: test_range
LOG_LEVEL: INFO
volumes:
- .:/app
depends_on:
test-db:
condition: service_healthy