summaryrefslogtreecommitdiff
path: root/releasenotes
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2016-08-04 17:18:50 -0400
committerRoman Podoliaka <rpodolyaka@mirantis.com>2016-11-04 17:50:01 +0200
commit2ad571c8d7a7e1d8d18f7c5e97c564509fd34816 (patch)
tree8f5a7358b2aafbd3cc8780e494c90b4632872b18 /releasenotes
parent3a6d159808bf241ed06d93a608ba006d9ca230e5 (diff)
downloadoslo-db-2ad571c8d7a7e1d8d18f7c5e97c564509fd34816.tar.gz
Enhanced fixtures for enginefacade-based provisioning
The original idea of enginefacade was that applications would call upon the global _TransactionContextManager given in oslo_db.sqlalchemy.enginefacade. However, as it turns out, virtually no Openstack projects seem to be using that technique, and instead, everyone is creating their own ad-hoc _TransactionContextManager objects and usually establishing it as a module-level global. Nova has two of them. Additionally, projects add configuration to these enginefacades (which IS part of the original idea), and this configuration in some cases is necessary to be present for tests that run as well, a key example being the sqlite_fks flag. The original DbFixture integration provided no way of reusing this configuration. Finally, projects very much tend to use custom fixtures in order to define their database communication. Test classes themselves don't really make use of oslo_db's DbTestCase anymore. This patch introduces a modernized fixture system which, in conjunction with the recent provisioning patch, addresses these use cases. Applications will typically create their own subclasses of these fixtures up front to suit the various testing cases they have, including SQLite fixed, SQLite ad-hoc, and opportunistic. In order to accommodate the fixture-based flow along with the use of testresources for opportunistic database provisioning, a mixin class OpportunisticDbTestMixin is still needed when a test needs to use "opportunistic" testing in order to provide the .resources attribute. The calculation of .resources is moved into the fixture system, but because this attribute is consulted before setUp(), the "opportunistic" fixture must be created early and stored. Closes-Bug: #1548960 Change-Id: I0163e637ffef6d45d2573ebe29b5438911d01fce
Diffstat (limited to 'releasenotes')
-rw-r--r--releasenotes/notes/new-db-fixtures-58223e3926122413.yaml5
1 files changed, 5 insertions, 0 deletions
diff --git a/releasenotes/notes/new-db-fixtures-58223e3926122413.yaml b/releasenotes/notes/new-db-fixtures-58223e3926122413.yaml
new file mode 100644
index 0000000..474f505
--- /dev/null
+++ b/releasenotes/notes/new-db-fixtures-58223e3926122413.yaml
@@ -0,0 +1,5 @@
+---
+deprecations:
+ - base test classes from ``oslo_db.sqlalchemy.test_base`` are deprecated in
+ favor of new fixtures introduced in ``oslo_db.sqlalchemy.test_fixtures``
+ module