Skip to content

A tool that runs a folder of pgtap tests using pg_prove to a specific database.

Notifications You must be signed in to change notification settings

DreamItGetIT/docker-pg-prove

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A tool that runs a folder of pgtap tests using pg_prove to a specific database.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages