oslo.db test suite is too rigidly hardcoded to a small number of potential database backends
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
oslo.db |
Fix Released
|
Medium
|
Mike Bayer |
Bug Description
I would like to propose improvements to the oslo.db test suite regarding alternate backends.
Right now, tests are hardcoded to a specific backend, which at the moment is usually SQLite, and in the case of a so-called "opportunistic" test, either MySQL or Postgresql.
When an "opportunistic" test runs, the system is hardcoded to a URL that is: "<driver>
The approach has the following limitations:
1. it is not possible to write a test that itself can run against multiple backends - OpportunisticFi
2. It is not possible to test against backends that don't use a hostname-based configuration. This includes Oracle, IBM DB2, as well as any system that uses an ODBC driver of any kind.
3. for backends that are hostname-based, they must be present on "localhost". It is not possible to run the tests against a test database, such as an Oracle, DB2 or other backend that is on a remote host.
4. it is not possible to run the tests on even a local workstation without the inconvenient necessity of creating a database name/user/password named "openstack_citest".
Note that the current system as it runs on CI servers is *entirely fine*, I am not proposing any change to any default behavior. I'm putting up this bug report as a TODO for myself to write a blueprint for a more open-ended system.
Changed in oslo: | |
assignee: | nobody → Mike Bayer (zzzeek) |
Changed in oslo: | |
status: | New → Triaged |
importance: | Undecided → Medium |
tags: | added: db |
Changed in oslo: | |
status: | Triaged → In Progress |
Changed in oslo: | |
milestone: | none → juno-3 |
affects: | oslo-incubator → oslo.db |
Changed in oslo.db: | |
milestone: | juno-3 → none |
milestone: | none → next-juno |
Changed in oslo.db: | |
milestone: | next-juno → next-kilo |
Changed in oslo.db: | |
milestone: | 1.1.0 → next-kilo |
milestone: | 1.4.0 → next-kilo |
Changed in oslo.db: | |
milestone: | 1.5.0 → next-kilo |
Changed in oslo.db: | |
status: | In Progress → Fix Committed |
status: | Fix Committed → Fix Released |
notes: "Every test run in its temporary database, citest credentials is just an entry point". Ok this is interesting in that the openstack_citest user needs "CREATE DATABASE" privs. Running on a "big iron" system like a DB2 or Oracle, this might not be feasible. We should look into provision.py ->create_database and work on abstracting this out. A test suite should be able to arbitrarily provision a "test bed", and the system should be able to choose different strategies: 1. the existing "make a random schema" system, 2. choose between a pool of existing schemas, when all are "checked out" then block additional concurrent tests until complete (or raise an error that the pool needs to be bigger) 3. tests must be serialized (pool size of one).