| Commit message (Collapse) | Author | Age | Files | Lines |
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
With Fixture objects and test cases it is important to upcall first
rather than later to allow base classes to configure their internal
test tracking state. Failing to do so allows bugs like this one to
occur - when failure occurs early, the state required to gather
environmental details about the failure is not prepared, and the
test machinery will raise secondary exceptions as it tries to do that.
This may even obscure the original error.
I've taken a fairly minimal approach here - I think it would be
possible and likely even desirable to get rid of the test classes
altogether - this module appears to have very little, if any, actual
test code - its all glue for managing the test database connections.
However I know zzzeek is working on a fairly large reorg in this
area and I don't want to conceptually clash with that - we can do
further cleanups later.
Co-Authored-By: Robert Collins <rbtcollins@hp.com>
Change-Id: Ic9f24aa2352d097a10be8420b701fa9f588b21b0
Closes-Bug: #1330763
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
When we intercept SQLite transactions for BEGIN, check
a marker that we place there to indicate BEGIN has
already been called, which we then remove on commit or
rollback. This is to resolve the issue of the fact
that we currently use the StaticPool implementation
with SQLite, which shares a single SQLite connection
for all requests; any API method which makes use
of multiple sessions at once (not a good idea, but
this is prevalent throughout nova, neutron) will
therefore share the same SQLite connection with
multiple SQLAlchemy Connection wrappers that are not
aware of the existing state. While this practice
should be corrected, for now the marker, which is
local to the SQLite connection as stored by the
pool, will track when BEGIN is safe to call, or
has already been called.
Change-Id: I70d44104412bd99d8c7713eb6cd9ff0f80c5da34
Closes-Bug: #1367354
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | | |
Change-Id: Ia959fbf504268aa13e077cb2637fc14367deb247
|
|\ \ \ \ |
|
| |/ / /
| | | |
| | | |
| | | | |
Change-Id: Idb877c59f277ccda8068d83445e43550da235038
|
|\ \ \ \
| |/ / /
|/| | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Switch to manually generated rst files for the API documentation so we
do not expose private parts of the library.
Fix formatting of usage.rst
Convert bullet list to section headers to fix rendering issues and make
the docs more readable.
Fix formatting of docstrings in classes exposed in the docs to eliminate
warnings/errors from Sphinx.
Add history.rst
Change-Id: I6f500775f801558f7c0c29f180b60f83a7150e02
|
|\ \ \ \
| |_|_|/
|/| | | |
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
It turns out the test was wrong as the error message used was not a good
one. Real world tests showed that, so I've updated the test and the code
to work.
Refactored tests to use real backends, fix error message for SQLite.
Co-Authored-By: Victor Sergeyev <vsergeyev@mirantis.com>
Change-Id: Ifa64478a9ac9ed0a3c317a8974615b770c85f313
|
|\ \ \
| |_|/
|/| | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
double quotes would cause failure when mysql running on ANSI sql_mode.
Change-Id: I891b61035ecb90b91a9ccdbec14dd567c575299b
Closes-Bug:1365019
|
|\ \ \ |
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Rename _walk_versions(), _migrate_up(), _migrate_down()
and mark them deprecated as they will be removed in few
releases. These functions will be the part of public API
as this class will be used for migrations in other
OpenStack projects, so there is no need to make them
'private'.
Change-Id: Ic9358445e60a0dd43a5900e8bda7b12f2bebf679
|
|\ \ \ |
|
| |/ /
| | |
| | |
| | |
| | | |
Change-Id: I64ae9191863564e278a35d42ec9cd743a233028e
Addresses-Bug: #1365061
|
| |/
|/|
| |
| |
| |
| |
| |
| |
| |
| | |
This instruction to set up a move in six for the mox module conflicts
with the one in oslotest. We are trying to use mox3 everywhere, so
remove this instruction and let oslotest handle it.
Imported from the incubator change with the same ID.
Change-Id: I59d5799283233f8411044ddb15c8abfc8850014c
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This test showed an error with alembic 0.6.6:
For MySQL Integer server_default value is compared incorrectly.
For example, when model has DefaultClause('0', for_update=False)
alembic finds it different from server variant "'0'".
For PostgreSQL Sting server_default value is compared incorrectly.
For example, when model has DefaultClause('', for_update=False)
alembic finds it different from server variant "''::character varying".
Such error appear in implementation of ModelsMigrationsSync to Neutron
https://review.openstack.org/76520.
Change-Id: I9730da1c0790a88f81570c51c36cc0cbe0651a5a
|
|\ |
|
| |
| |
| |
| | |
Change-Id: Ic7d77a737d3e16f4f781baebe8ce57d04db04832
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | | |
Check reStructuredText documents for common style issues.
Change-Id: I10e61742e86d2d4781c5a00532c8e17d38a7d4b4
|
| |/
|/|
| |
| | |
Change-Id: Ic2108aab91b04e337f6a68e0275ec2806dc1a3e8
|
|\ \ |
|
| |/
| |
| |
| |
| |
| |
| | |
Module `gettextutils` from common code was graduated to oslo.i18n, so it
would be great if we reuse this library.
Change-Id: Ie5836b82723fc80c1d54e5e65eac8565cf905c5a
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch applies the events discussed in
SQLAlchemy documentation at
http://docs.sqlalchemy.org/en/rel_0_9/dialects/sqlite.html#serializable-isolation-savepoints-transactional-ddl
which correct for pysqlite's modifications to SQLite's transactional
cycle. We turn off pysqlite's automatic emit of BEGIN
as well as COMMIT before any DDL, and instead emit our own
BEGIN at the point where SQLAlchemy knows a transaction is to start.
A proof of concept is added to illustrate SAVEPOINT working
completely.
SAVEPOINT support will be needed in order to support
transactional testing with rollbacks inside of tests.
Change-Id: Ie39bd2287173327903523b66160653608d9e8652
|
|
|
|
| |
Change-Id: I9f1761a5332ad3c4a8f0b76c6f46fc687fd61aa5
|
|\ |
|
| |
| |
| |
| | |
Change-Id: I834ba5e6a6d583370099b5c87d28680a67a802c1
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
As we are continuing to add functionality to create_engine()
which in some cases means that backend-specific SQL is
emitted on connect, the practice of repurposing a
SQLite or other engine to act like another one for the
purposes of a test is becoming less feasible. Here,
TestsExceptionFilter is altered to not rely upon the full
session.create_engine() process for unit tests, instead
calling upon just those listeners being tested.
Change-Id: I0ece42f956c59eab7a6cb86419d8d359250d5e71
|
|\ \ \
| |/ /
| | /
| |/
|/| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This patch refactors the SQLite and MySQL event listener
setup in session.py to occur inline within the
new _init_events() hooks for each of these backends. This
is to improve code readability and reduce unneeded boilerplate.
In particular, _mysql_set_mode_callback() was implemented using
four functions, all private to session.py, unused anywhere
else and also not consistently prefixed with "_mysql".
These functions have been consolidated into a single event
listen plus a quick check of SQL mode. In particular,
the system now emits the logging check for "sql_mode"
in all cases.
On the SQLite side, three functions, again not all prefixed
with _sqlite, are consolidated into a single event listening
function wihtin _init_events().
The test suite is altered in several ways. The tests
for connect arguments no longer inject a sqlite engine
into session.create_engine(); now that MySQL does a particular
statement every time, this was no longer feasible, and in general
other setup functions might emit SQL also, so the
CreateEngineTest tests now test directly into session._init_connection_args.
The tests for MySQL modes and SQLite connection settings
move into being plain round-trip tests, reducing lots of
mocking logic and ultimately doing a more complete test against
a real backend.
Change-Id: I04ca3fbb1f46a64ed6552496ae995f77aa0b2315
|
|\ \
| |/
|/| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The projects that are using oslo.db in tests need to explicitly
include oslotest in their test-requirements.
Closes-bug: 1356425
Change-Id: I0ed01e141221d19af5593857c13a656f32d0f3cf
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This patch makes use of the new DialectFunctionDispatcher
to remove all conditional logic from within session.create_engine().
The flags that result in various engine connect arguments as well
as subsequent event listeners now fall under the realm of dispatched
functions keyed to their target dialects. Additionally, this
modernizes the SQLite foreign keys listener to use events.
A test suite is added which via mocks asserts that arguments
expected to be present as well as non-present for a variety of url situations
is added.
Change-Id: Iba5e77e1396eda46ac2c6d6cbca159cbfadf4d04
|
| |
| |
| |
| |
| |
| |
| |
| | |
Add a helper function to utils for detection of tables which aren't
using InnoDB storage engine in MySQL (something we want to enforce in
consuming projects).
Change-Id: I22889e23b025fc32fe76e4086cd3cd3d5bd0b771
|
|\ \
| |/
|/| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
A new utility feature dispatch_for_dialect() is added, which
is intended to provide a single solution for the issue of many
areas within oslo.db where conditional per-database and/or
per-driver behavior is needed, such as that of setting up
special event listeners, connection options, or invoking
special features. The dispatch_for_dialect() function is
essentially a decorator, which when invoked provides subsequent
"builder" decorators in the style of the Python @property
object and others, so that any number of functions can be
registered against database/driver matcher strings. The system
supports "single" or "multiple" function call modes, wildcards
for both database and driver independently of each other,
support for URL strings, URL objects, Engine and Connection
objects as lead targets, and additional arguments and
return values for single mode.
The agenda of this feature is to provide the basis for the
removal of all remaining "if db.name == 'MYDB'" conditionals
throughout oslo.db and elsewhere.
Change-Id: I75201487c1481ffc83329a2eaaaa07acf5aac76e
|
|\ \
| |/
|/| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
With the DB2 sqlalchemy driver (ibm_db_sa), boolean columns are stored
as SmallInteger rather than Boolean (or TINYINT for mysql). This change
updates the two tests that were changing the deleted column to boolean
and then checking the type based on the backing engine so they work for
ibm_db_sa.
Also changes the assertion from assertTrue to assertIsInstance since it
will provide a clearer failure message.
Closes-Bug: #1312423
Change-Id: I42975119ecacaac89e7225f57f9f6b52c455ab6a
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
`oslo.db` uses several modules(`importutils` and `timeutils`) from
`oslo-incubator`. This modules are already incubated and we should use them
from `oslo.utils`.
Change-Id: I09881ea3e115ca95bbd06ff5d1c0d5e253ed7640
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
migration.py includes a non-ASCII character in the top source
comments, so a "coding" directive is needed. Additionally,
the word "coding" is now used in test_sqlalchemy.py instead
of "encoding".
Change-Id: Ic977b564c5de9261686503506f4edec4a8d8682d
|
|\ \ \
| |_|/
|/| | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
This warning was generated in exc_filters during exception conversions.
Fix it by removing access to deprecated attribute
Closes-Bug: #1257530
Change-Id: I8ff8b974946ecab13f12a70b315dd94c3453197e
|
| | |
| | |
| | |
| | | |
Change-Id: Idbb2bbdd071ff54e8c250ffbd32273c41aeb0b39
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Fixes comments to pass E265 check.
Removes E265 from ignore setting in tox.ini.
Change-Id: I2e83c037a920a06b24695d6daea70ded179e3ebe
|