Add basic docs for testing with pgTAP
authorDan Scott <dscott@laurentian.ca>
Thu, 14 Nov 2013 23:17:58 +0000 (18:17 -0500)
committerDan Scott <dscott@laurentian.ca>
Thu, 14 Nov 2013 23:17:58 +0000 (18:17 -0500)
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 <dscott@laurentian.ca>
docs/development/pgtap.txt [new file with mode: 0644]
docs/root.txt

diff --git a/docs/development/pgtap.txt b/docs/development/pgtap.txt
new file mode 100644 (file)
index 0000000..2e93926
--- /dev/null
@@ -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`
+
+
index 2168940..2108c6d 100644 (file)
@@ -391,6 +391,7 @@ communication protocols and standards used in Evergreen.
 // Push titles down one level.
 :leveloffset: 1
 
 // Push titles down one level.
 :leveloffset: 1
 
+include::development/pgtap.txt[]
 include::development/intro_opensrf.txt[]
 include::development/updating_translations_launchpad.txt[]
 
 include::development/intro_opensrf.txt[]
 include::development/updating_translations_launchpad.txt[]