Public | Automated Build

Last pushed: 2 years ago
Short Description
Short description is empty for this repo.
Full Description

pg-prove pgtap test runner container

A Docker image that execute pg_prove to test a
folder of pgTAP tests within a specific database.

How to use

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'.

Running Tests

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.

License

Just MIT, Copyright (c) 2014 DreamItGetIT, read LICENSE file for more
information.

Docker Pull Command
Owner
digit
Source Repository