]> git.evergreen-ils.org Git - Evergreen.git/blob - docs-antora/modules/development/pages/pgtap.adoc
LP#1848524: Docs: section fixes
[Evergreen.git] / docs-antora / modules / development / pages / pgtap.adoc
1 = Developing with pgTAP tests =
2 :toc:
3
4 == Setting up pgTAP on your development server ==
5
6 Currently, Evergreen pgTAP tests expect a version of pgTAP (0.93)
7 that is not yet available in the packages for most Linux distributions.
8 Therefore, you will have to install pgTAP from source as follows:
9
10 . Download, make, and install pgTAP on your database server. pgTAP can
11   be downloaded from http://pgxn.org/dist/pgtap/ and the instructions
12   for building and installing the extension are available from
13   http://pgtap.org/documentation.html
14
15 . Create the pgTAP extension in your Evergreen database. Using `psql`,
16   connect to your Evergreen database and then issue the command:
17 +
18 [source,sql]
19 ------------------------------------------------------------------------------
20 CREATE EXTENSION pgtap;
21 ------------------------------------------------------------------------------
22
23 == Running pgTAP tests ==
24 The pgTAP tests can be found in subdirectories of `Open-ILS/src/sql/Pg/`
25 as follows:
26
27 * `t`: contains pgTAP unit tests that can be run on a freshly installed
28   Evergreen database
29 * `live_t`: contains pgTAP unit tests meant to be run on an Evergreen
30   database that also has had the "concerto" sample data loaded on it
31
32 To run the pgTAP unit and regression tests, use the `pg_prove` command.
33 For example, from the Evergreen source directory, you can issue the
34 command:
35 `pg_prove -U evergreen Open-ILS/src/sql/Pg/t Open-ILS/src/sql/Pg/t/regress`
36
37