File tree Expand file tree Collapse file tree 5 files changed +46
-0
lines changed
Expand file tree Collapse file tree 5 files changed +46
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,8 @@ Revision history for pgTAP
2828 for the report (#277).
2929* Added `isnt_member_of()` (#38, #204). Thanks to Wolfgang Walther for the
3030 pull request (#249).
31+ * Added docker files for local test environment. Thanks to Wolfgang Walther for
32+ the pull request (#250).
3133
32341.1.0 2019-11-25T19:05:38Z
3335--------------------------
Original file line number Diff line number Diff line change @@ -152,6 +152,19 @@ You can use it to run the test suite as a database super user like so:
152152
153153 make test PGUSER=postgres
154154
155+ To run the tests in a local docker environment for development, run:
156+
157+ cd test
158+ docker-compose build test
159+ # start the postgres server in a docker container in the background
160+ docker-compose up -d test
161+ # run the regression tests
162+ docker-compose exec test make install installcheck
163+ # run the tests with pg_proove
164+ # "run" builds and installs pgTAP, runs "CREATE EXTENSION"
165+ # and then runs make test
166+ docker-compose exec test run
167+
155168Adding pgTAP to a Database
156169--------------------------
157170
Original file line number Diff line number Diff line change 1+ FROM postgres:13.0-alpine
2+ ENV POSTGRES_HOST_AUTH_METHOD trust
3+
4+ RUN apk --no-cache add make perl-dev patch \
5+ && cpan TAP::Parser::SourceHandler::pgTAP
6+ ENV PGUSER postgres
7+
8+ WORKDIR /pgtap
9+ ENV PATH /pgtap/test:$PATH
Original file line number Diff line number Diff line change 1+ version : " 3"
2+
3+ services :
4+ test :
5+ build : .
6+ volumes :
7+ - ../:/pgtap
8+ - postgres:/var/lib/postgresql/data
9+
10+ volumes :
11+ postgres :
12+ driver_opts :
13+ type : tmpfs
14+ device : tmpfs
15+
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env sh
2+
3+ set -e -u -o pipefail
4+
5+ make install
6+ psql -Ec ' DROP EXTENSION IF EXISTS pgtap; CREATE EXTENSION pgtap;'
7+ make test
You can’t perform that action at this time.
0 commit comments