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

Proposed change for database installation



Hi;

Currently there are a couple different ways of installing the
database.  I am going to propose merging all of those together into
one approach which can both be considered better tested and provide
better assurances of getting everything correct.  This approach could
also be extended by addons to allow installation of portions through
this same workflow.

I just added a couple of scripts to test database creation routines.
However, I added some hooks that allow the database to remain around
after the tests have finished.   I would suggest we move
install_mycompany.sh to this framework as well as the initiate.pl

In this case, instead of just installing the database, we would go
through a bunch of other things, run tests on the database, and ensure
it is in a consistent state by the end of the installation.
Install_mycompany.sh and initiate,pl could both function as
light-weight wrappers around make test in this regard.

What do folks think?

For example, with latest svn, if you run (as one line):
LSMB_TEST_DB=1 LSMB_NEW_DB=lsmb13test
PG_CONTRIB_DIR=/usr/local/pgsql/share/contrib/ PGUSER=postgres
PGPASSWORD=secret make test

it will try to create a database (lsmb13test) using the postgres
account (and password of secret) run tests of Perl code and db logic,
and then remove the database.  If the database cannot be created, the
test script exits immediately so you don't have to worry about
accidently dropping a production db.

However if you set the LSMB_INSTALL_DB environment variable to a true
value, it will leave the db around afterwards.
LSMB_TEST_DB=1 LSMB_NEW_DB=lsmb13 LSMB_INSTALL_DB=1
PG_CONTRIB_DIR=/usr/local/pgsql/share/contrib/ PGUSER=postgres
PGPASSWORD=secret make test

All I have left to do is to add variables to handle the administrative
user creation.  After that point, it should be good to go.

This would not prevent the make test from being run against a
production db, but use PGDATABASE instead of LSMB_NEW_DB.

Best Wishes,
Chris Travers