Sign inSign up

digit/docker-pg-prove

By digit

•Updated almost 11 years ago

Image
0

904

digit/docker-pg-prove repository overview

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

Tag summary

Content type

Image

Digest

sha256:e1783f52c…

Size

227.8 MB

Last updated

almost 11 years ago

docker pull digit/docker-pg-prove