- Clone the repository
- Run the databases. This will run
docker-compose up
under the hood, and set up 2 masters and 2 slaves:
make up master=1 slave=1 # can set different numbers to scale
- Run the tests in
db_test.go
. The databases will log SQL queries it executes, so to see the logs, run any of these:
docker-compose logs -f pg-demo-postgresql-master-users-1
docker-compose logs -f pg-demo-postgresql-master-games-1
docker-compose logs -f pg-demo-postgresql-slave-users-1
docker-compose logs -f pg-demo-postgresql-slave-games-1
Read the comments in the test file to understand what each test does.
- When you're done:
make clean # remove containers and volumes