[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Data base sanity checks

Our sanity checks right now are limited to the tests in t/43-dbtest.t and defined in the files of sql/modules/test/

These tests are not comprehensive.  We don't test to make sure that every table is created, etc, but generally if you are missing a table you are going to get errors somewhere, since the stored procedures are tested and they have pretty good coverage of tables.

The script I use (the password is not real of course) is tools/pre-release-tests.sh.  This script will actually run the db sanity checks and Perl-level API checks (with a db commit filter) and this is safe to run on production databases since every transaction eventually rolls back.

If you would like to add more sanity checks feel free to put them in sql/modules/test/System.sql.  Currently the sanity checks there are limited to function overload and very basic permissions checks.

Best Wishes,
Chris Travers

On Sat, Dec 1, 2012 at 8:50 AM, Berend Tober <..hidden..> wrote:
I know there was a discussion about incorporating pg-tap into
LedgerSMB, but I imagine that will require some longer-term effort.

I am wondering if in the mean time there would be a good way to
perform some basic automated sanity checks indicating the
prepare-database has done everything it is intended ... like
maybe count the number of tables, functions, domains, and etc.

When testing trunk, oftentimes errors and rollbacks occur, and I
can recognize that when only two tables end up being created that
something went wrong, but how would I know that 124 or 157 or
whatever tables is the right number? I know I can redirect the
output of the script to a file and grep for ERROR, which I do,
but there are some inconsequential "errors" like objects already
existing. I was thinking about some built-in automated
correctness checking so the script can tell me directly if it
completed all tasks.

Keep yourself connected to Go Parallel:
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
Ledger-smb-devel mailing list