A Docker image that execute pg_prove to test a folder of pgTAP tests within a specific database.
Run your database in a container. This might be changed in the future to work on local databases.
docker run --rm -v /database/test/:/test --link database-container:db digit/pg-prove -h db -p 5432 -u username -w password -d database -t '/test/*.sql'
We use the following docker's run parameters:
--rm to remove the container when it stops. No reason for it to stick around
-v to map the Docker tests into the container
so it can run the tests
--link to link the database that you are testing to be locally available to
the container as 'db'.
When the container begins it will install pgTAP into the target database.
After running the tests it will uninstall pgTAP, leaving the database squeaky clean.
It is advisable to have tests run in a transaction (BEGIN and ROLLBACK block) however you do not
need to load the pgtap.sql file, as this is taken care of by the test.sh script.
Just MIT, Copyright (c) 2014 DreamItGetIT, read LICENSE file for more information.