From 3c8631534f56944351076528b212b59fa390a542 Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Thu, 14 Nov 2013 18:17:58 -0500 Subject: [PATCH 1/1] Add basic docs for testing with pgTAP This can be expanded to describe how to create pgTAP tests later. For now, let's help people actually set up their environment and test. Signed-off-by: Dan Scott --- docs/development/pgtap.txt | 39 ++++++++++++++++++++++++++++++++++++++ docs/root.txt | 1 + 2 files changed, 40 insertions(+) create mode 100644 docs/development/pgtap.txt diff --git a/docs/development/pgtap.txt b/docs/development/pgtap.txt new file mode 100644 index 0000000000..2e93926de4 --- /dev/null +++ b/docs/development/pgtap.txt @@ -0,0 +1,39 @@ +Developing with pgTAP tests +=========================== + +Setting up pgTAP on your development server +------------------------------------------- + +Currently, Evergreen pgTAP tests expect a version of pgTAP (0.93) +that is not yet available in the packages for most Linux distributions. +Therefore, you will have to install pgTAP from source as follows: + +. Download, make, and install pgTAP on your database server. pgTAP can + be downloaded from http://pgxn.org/dist/pgtap/ and the instructions + for building and installing the extension are available from + http://pgtap.org/documentation.html + +. Create the pgTAP extension in your Evergreen database. Using `psql`, + connect to your Evergreen database and then issue the command: ++ +[source,sql] +------------------------------------------------------------------------------ +CREATE EXTENSION pgtap; +------------------------------------------------------------------------------ + +Running pgTAP tests +------------------- +The pgTAP tests can be found in subdirectories of `Open-ILS/src/sql/Pg/` +as follows: + +* `t`: contains pgTAP unit tests that can be run on a freshly installed + Evergreen database +* `live_t`: contains pgTAP unit tests meant to be run on an Evergreen + database that also has had the "concerto" sample data loaded on it + +To run the pgTAP unit and regression tests, use the `pg_prove` command. +For example, from the Evergreen source directory, you can issue the +command: +`pg_prove -U evergreen Open-ILS/src/sql/Pg/t Open-ILS/src/sql/Pg/t/regress` + + diff --git a/docs/root.txt b/docs/root.txt index 2168940898..2108c6df05 100644 --- a/docs/root.txt +++ b/docs/root.txt @@ -391,6 +391,7 @@ communication protocols and standards used in Evergreen. // Push titles down one level. :leveloffset: 1 +include::development/pgtap.txt[] include::development/intro_opensrf.txt[] include::development/updating_translations_launchpad.txt[] -- 2.43.2