From 20c04a98bcfd536341916c1d2dee1463cc5b6abc Mon Sep 17 00:00:00 2001 From: Arijit Das Date: Mon, 11 Oct 2021 22:12:05 +0530 Subject: [PATCH] Update DB name. --- docker-compose.yml | 6 +++--- pkg/eth/api_test.go | 2 +- pkg/graphql/graphql_test.go | 2 +- scripts/run_unit_test.sh | 5 ++++- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 139b0562..889a207f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,7 +8,7 @@ services: image: vulcanize/dapptools:v0.30.0-v1.10.9-statediff-0.0.27 environment: DB_USER: vdbm - DB_NAME: vulcanize_public + DB_NAME: vulcanize_testing DB_HOST: ipld-eth-db DB_PORT: 5432 DB_PASSWORD: password @@ -21,7 +21,7 @@ services: image: vulcanize/ipld-eth-db:v0.2.0 environment: POSTGRES_USER: "vdbm" - POSTGRES_DB: "vulcanize_public" + POSTGRES_DB: "vulcanize_testing" POSTGRES_PASSWORD: "password" volumes: - vdb_db_eth_server:/var/lib/postgresql/data @@ -44,7 +44,7 @@ services: ETH_SERVER_HTTPPATH: 0.0.0.0:8081 VDB_COMMAND: "serve" ETH_CHAIN_CONFIG: "/tmp/chain.json" - DATABASE_NAME: "vulcanize_public" + DATABASE_NAME: "vulcanize_testing" DATABASE_HOSTNAME: "ipld-eth-db" DATABASE_PORT: 5432 DATABASE_USER: "vdbm" diff --git a/pkg/eth/api_test.go b/pkg/eth/api_test.go index ceb5b22a..fa5025c2 100644 --- a/pkg/eth/api_test.go +++ b/pkg/eth/api_test.go @@ -188,7 +188,7 @@ func SetupDB() (*postgres.DB, error) { User: "vdbm", Password: "password", Hostname: "localhost", - Name: "vulcanize_public", + Name: "vulcanize_testing", Port: 8077, }) return postgres.NewDB(uri, postgres.ConnectionConfig{}, node.Info{}) diff --git a/pkg/graphql/graphql_test.go b/pkg/graphql/graphql_test.go index eda87382..68e394db 100644 --- a/pkg/graphql/graphql_test.go +++ b/pkg/graphql/graphql_test.go @@ -49,7 +49,7 @@ func SetupDB() (*postgres.DB, error) { User: "vdbm", Password: "password", Hostname: "localhost", - Name: "vulcanize_public", + Name: "vulcanize_testing", Port: 8077, }) return postgres.NewDB(uri, postgres.ConnectionConfig{}, node.Info{}) diff --git a/scripts/run_unit_test.sh b/scripts/run_unit_test.sh index 1e15f03b..703fcef8 100755 --- a/scripts/run_unit_test.sh +++ b/scripts/run_unit_test.sh @@ -1,2 +1,5 @@ -docker-compose -f docker-compose.test.yml -f docker-compose.yml up -d db +# Clear up existing docker images and volume. +docker-compose down --remove-orphans --volumes + +docker-compose -f docker-compose.test.yml -f docker-compose.yml up -d ipld-eth-db PGPASSWORD=password DATABASE_USER=vdbm DATABASE_PORT=8077 DATABASE_PASSWORD=password DATABASE_HOSTNAME=127.0.0.1 make test \ No newline at end of file