-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
37 lines (30 loc) · 1.01 KB
/
Makefile
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
PSQL ?= psql
export PGPASSWORD="mysecretpassword"
.PHONY: test-postgres-pgx
test-postgres-pgx: clean-docker
docker run --name do_test_gaum -p 5469:5432 -e POSTGRES_PASSWORD=$(PGPASSWORD) -d postgres
sleep 3
PGPASSWORD=${PGPASSWORD} $(PSQL) -n -U postgres -h localhost -p 5469 -d postgres -w -f initial.sql
go test ./db/postgres/.
docker stop do_test_gaum
docker rm do_test_gaum
.PHONY: test-postgres-pq
test-postgres-pq: clean-docker
docker run --name do_test_gaum -p 5469:5432 -e POSTGRES_PASSWORD=$(PGPASSWORD) -d postgres
sleep 3
PGPASSWORD=${PGPASSWORD} $(PSQL) -n -U postgres -h localhost -p 5469 -d postgres -w -f initial.sql
go test ./db/postgrespq/.
docker stop do_test_gaum
docker rm do_test_gaum
.PHONY: clean-docker
clean-docker:
docker stop do_test_gaum || true
docker rm do_test_gaum || true
.PHONY: test-chain
test-chain:
go test ./db/chain/.
.PHONY: test-selectparse
test-selectparse:
go test ./selectparse/.
.PHONY: test-all
test-all: test-chain test-selectparse test-postgres-pgx test-postgres-pq