pgTAP examples

These specific ones do not assume stock test data such as the concerto bibs, and
I think such tests should go elsewhere.  You need to install pgTAP.  I did the
following for my test environment:

    git clone git://github.com/theory/pgtap.git
    cd pgtap
    make
    make installcheck
    sudo make install

Then in my Evergreen database with psql, I did:

    CREATE EXTENSION pgtap;

I also installed a CPAN module to get pg_prove:

    sudo cpan TAP::Parser::SourceHandler::pgTAP

You can use psql to run a given test like so:

opensrf@dev141:~/git/Evergreen/Open-ILS/src/sql/Pg/t (pgtap)$ psql -d evergreen -f 0799.state_field_required_toggle.s
1..4
ok 1 - actor.usr_address.state does not have the NOT NULL constraint
ok 2 - ui.patron.edit.au.state.require exists
ok 3 - ui.patron.edit.au.state.show exists
ok 4 - ui.patron.edit.au.state.suggest exists

Or you can use pg_prove on all or some of them:

opensrf@dev141:~/git/Evergreen/Open-ILS/src/sql/Pg/t (pgtap)$ pg_prove -d evergreen *.s
0799.state_field_required_toggle.s .. ok
dewey.s ............................. 1/6
 # Failed (TODO) test 6: "testing prefix plus decimal"
 #     'YR_DVD_800_100000000000000'
 #         <
 #     'YR_000000000000000_DVD_900'
dewey.s ............................. ok
schema.s ............................ ok
versions.s .......................... ok
All tests successful.
Files=4, Tests=39,  0 wallclock secs ( 0.05 usr  0.03 sys +  0.13 cusr  0.07 csys =  0.28 CPU)
Result: PASS

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
start adding pgTAP test cases

pgTAP is a PostgreSQL unit testing framework; about which
more can be found at http://pgtap.org/

This commit introduces the first pgTAP test case, which exercises
the NACO normalization functions.

To run the tests, install pgTAP, create an Evergreen database that
contains (for now) just the seed data, and from the top of the
source tree run

pg_prove -vr -U evergreen Open-ILS/src/sql/Pg/t/*

Replace '-U evergreen' with the psql command-line switches
needed to access your database.

To install pgTAP on a Debian Wheezy system, you can do:

Then, to load the pgTAP extension into the database, run

psql> CREATE EXTENSION pgtap;

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
use .pg extension for pgTAP test cases

That way, pg_prove --recurse t/ will DWIM.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
add regression test for LP#1155329

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Use the .pg extension

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>