Hi all, In the recent days, we decided to improve the testing possibilities for our database. The previous relied on tables we maintained in the database and lacked an easy integration with the Perl testing tool we use for BDD tests. After discussion with Erik, we deciced to move to pgTAP (http://pgtap.org/). As documented on their site, "pgTAP is a suite of database functions that make it easy to write TAP-emitting unit tests in psql scripts or xUnit-style test functions. The TAP output is suitable for harvesting, analysis, and reporting by a TAP harness, such as those used in Perl applications." The installation is well documented. For us, the only added requirement was TAP::Parser::SourceHandler::pgTAP, a source handler for pgTAP *.pg files. We moved all database tests to the new framework. That involved converting sql/modules/test/*.sql to xt/42-*.pg and removing xt/43-dbtests.t This added a total of 321 new tests, splitted like this:
prove --source Perl --ext=.t --ext=.pg --source pgTAP --pgtap-option dbname=lsmb13installtest --pgtap-option username=postgres --pgtap-option suffix=.pg t/ xt/Or you can use pg_prove, providing the proper access for the database. Enjoy, Yves Lavoie, LedgerSMB develoment team member
|
------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________ Ledger-smb-devel mailing list ..hidden.. https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel