-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.test.yml
55 lines (52 loc) · 1.13 KB
/
docker-compose.test.yml
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
x-app: &app
build:
context: .
env_file:
- .env.test
services:
db:
restart: always
image: postgres:16.4
user: postgres
env_file:
- .env.test
environment:
POSTGRES_PASSWORD: password
PG_USER: postgres
POSTGRES_DB: ezsplit_test
POSTGRES_HOST_AUTH_METHOD: trust
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 2s
timeout: 5s
retries: 5
app:
<<: *app
# entrypoint commands takes precedence over command
entrypoint: ./entrypoint_test.sh
command: >
sh -c "atlas schema apply --env local --auto-approve &&
gotestsum -- -p=1 ./..."
volumes:
- .:/app
environment:
GO_ENV: "test"
# use github-actions format when debugging
GOTESTSUM_FORMAT: "dots-v2"
depends_on:
db:
condition: service_healthy
test-cli:
<<: *app
command: bash
volumes:
- .:/app
profiles:
- test-cli
environment:
GO_ENV: "test"
# use github-actions format when debugging
GOTESTSUM_FORMAT: "dots-v2"
depends_on:
db:
condition: service_healthy