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