1 # docker compose up
2 # connect with psql postgresql://postgres:password@localhost:5434
3 # TEST_DATABASE_URI="postgresql://postgres:password@localhost:5434" go test -timeout 30s -run ^TestHandleMultiPayInvoiceEvent_IsolatedApp_ConcurrentPayments$ github.com/getAlby/hub/nip47/controllers
4 # or
5 # TEST_DATABASE_URI="postgresql://postgres:password@localhost:5434" go test -timeout 30s -run ^TestHandleMultiPayKeysendEvent_IsolatedApp_ConcurrentPayments$ github.com/getAlby/hub/nip47/controllers
6 version: "3.6"
7 services:
8 pgtestdb:
9 image: postgres:15
10 environment:
11 POSTGRES_PASSWORD: password
12 restart: unless-stopped
13 volumes:
14 # Uses a tmpfs volume to make tests extremely fast. The data in test
15 # databases is not persisted across restarts, nor does it need to be.
16 - type: tmpfs
17 target: /var/lib/postgresql/data/
18 command:
19 - "postgres"
20 - "-c" # turn off fsync for speed
21 - "fsync=off"
22 - "-c" # log everything for debugging
23 - "log_statement=all"
24 ports:
25 # Entirely up to you what port you want to use while testing.
26 - "5434:5432"
27