placement/tools
EdLeafe c8ab9ff906 Added alembic environment
Added alembic, and created an initial database revision.

For the sake of testing with real databases, tools/test-setup.sh is added
so that CI can start up a mysql and/or postgresql database on which to
test migrations. The OpportunisticDBMixin from oslo_db was originally
used for this, but because of the way placement configures the database
this proved hard to debug and get correct, so we've used something
that leverages the available oslo_db tools, but with more visibility.

Because these tests mix sqlite, mysql and postgresql settings in the
potentially the same process we need a way to insure that global
settings for databases do not leak into other tests. This is done with
a reset() on the placement db fixture, called by the msyql and
postgresql tests before and after they run. We also need careful
management of that cleanup when these tests are skipped (because db
server or database is not there).

Those tests will confirm that the models match the migrations so we also
need to remove model files that no longer matter.

Since we no longer need to distinguish among multiple database files, we
can simplify the naming of these files.

Co-Authored-By: Chris Dent <cdent@anticdent.org>
Change-Id: I51ed1e4e7dbb76a3eab23af7d0d106f716059112
2018-11-14 15:26:13 +00:00
..
flake8wrap.sh tox: make it possible to run pep8 on current patch only 2015-07-24 16:15:38 +01:00
mysql-migrate-db.sh Add nova database migration script 2018-09-21 11:30:55 -07:00
postgresql-migrate-db.sh Add nova database migration script for postgresql 2018-10-17 11:17:19 -04:00
test-setup.sh Added alembic environment 2018-11-14 15:26:13 +00:00