summaryrefslogtreecommitdiff
path: root/taskflow/tests/unit/persistence/test_sql_persistence.py
Commit message (Collapse)AuthorAgeFilesLines
* Remove sixTakashi Kajinami2022-05-181-3/+2
| | | | | | | | This library no longer supports Python 2, thus usage of six can be removed. This also removes workaround about pickle library used in Python 2 only. Change-Id: I19d298cf0f402d65f0b142dea0bf35cf992332a9
* Fix currently broken and inactive mysql testsJoshua Harlow2015-12-221-4/+1
| | | | | | | | | | | | | | | | Commit 868dd8485456ce78a396b687ec7744dc365f06be added a migration script that caused there to be two heads (starting points) of migrations which would cause alembic to be unable to do the initial schema creation (and upgrade). So this fixes that by correctly making one head only and not skipping tests for a database if it can not be upgraded for whatever reason (which was silencing the test failures). Closes-bug: #1528683 Change-Id: Id571072eec1dc3b6cbb9e868854f6db0b271e5f8
* Remove testing using persistence sqlalchemy backend with 'mysqldb'Joshua Harlow2015-05-291-74/+37
| | | | | | | | | | It appears no longer recommended to test against and/or use mysqldb as a backend that is tested against (since it lacks real support and development) and it is now better to just test against pymysql which is under development (and has better eventlet integration and py3.x support). Change-Id: I08f7ea67fbeb2e8b2976aef442ed442e33c77e09
* Fix split on "+" for connection strings that specify dialectsJoshua Harlow2014-12-041-4/+12
| | | | | | Fixes bug 1399486 Change-Id: I3b7e6331751f25d9c4221393e8329934925791e7
* Switch to a custom NotImplementedError derivativeJoshua Harlow2014-10-081-2/+5
| | | | | | | | | | When a feature or method is not implemented it's useful to throw our own derivative of a NotImplementedError error so that we can distingush these types of errors vs actual usage of NotImplementedError which could be thrown from driver or user code. Change-Id: I8d5dfb56a254f315c5509dc600a078cfef2dde0b
* Remove db locks and use random db names for testsBrian Jarrett2014-08-121-57/+67
| | | | | | | | | | | | | | | | | | Removed database locks against the database openstack_citest and implemented random name generation for new databases created just for persistence testing. Once the locks were removed, using 'template1' as the initial db for postgres connections was problematic, because postgres refuses to create databases when there are multiple connections to 'template1'. Switched to using 'postgres' as an initial db to use. Changed _reset_database to _init_db since we are always working with a brand new database, and removed the 'drop database' before a 'create database. Added a _remove_db method to remove the database once testing was finished. Change-Id: Iaf1c101df9c268da48db7432bcbc0467f6486bcd Closes-Bug: 1327469
* Upgrade hacking version and fix some of the issuesJoshua Harlow2014-06-131-3/+1
| | | | | | | | | | | | | | | | | Update hacking to the new requirements version and fix about half of the new reported issues. The other hacking issues are for now ignored until fixed by adjusting our tox.ini file. This commit fixes the following new hacking errors: H405 - multi line docstring summary not separated with an empty line E265 - block comment should start with '# ' F402 - import 'endpoint' from line 21 shadowed by loop variable Change-Id: I6bae61591fb988cc17fa79e21cb5f1508d22781c
* Fix few spelling and grammar errorsIvan A. Melnikov2014-02-201-1/+1
| | | | Change-Id: I8e678a9f76cba3d90053d28baf4ff42d34b4e390
* Remove extraneous vim configuration commentsyangxurong2014-02-141-2/+0
| | | | | | | | | Remove line containing comment - # vim: tabstop=4 shiftwidth=4 softtabstop=4 Change-Id: I7581cc88b8de433d5609ed06c6570b0b45c13573 Closes-Bug:#1229324
* Be more resilent around import/detection/setup errorsJoshua Harlow2014-02-031-26/+45
| | | | | | | | | | | It appears that some of our current testr failures are due to this module not handling exception cases very well; this is making it hard to debug and hard to determine what the errors are, so handle more of the general exceptions better in more of the places where they are problematic. Change-Id: I7c71d3a68852c0093f27f3b16d6475cc0a8bf8ef
* Merge "Use addCleanup instead of tearDown in test_sql_persistence"Jenkins2014-01-301-9/+2
|\
| * Use addCleanup instead of tearDown in test_sql_persistenceIvan A. Melnikov2014-01-281-9/+2
| | | | | | | | | | | | | | | | | | TestCase.tearDown() is not called if setUp raises exception, but we have to close backend and release lock before executing other tests. The easiest way to do it is to use addCleanup instead of tearDown for freeing resources. Change-Id: I885bb7d491f4b3ee06a351f5d22087e23804e19b
* | Test fetching backends via entry pointsIvan A. Melnikov2014-01-291-0/+24
|/ | | | | | | | Default way of getting backend is expected to be via directly or indirectly using taskflow.persistence.backend.fetch(), so we should test that all our backends can be fetched correctly. Change-Id: I5ce41510c86598d449ee15da8d1279d3d35c9524
* Test using mysql + postgres if availableJoshua Harlow2014-01-251-7/+214
| | | | | | | | | | | | | | | If mysql is avaiable via the standard testing user 'openstack_citest' with password 'openstack_citest' then attempt to setup mysql or postgres and use those databases for the duration of the test. Adjust the tox template to include the two main mysql library variants [MySQL-python, PyMySQL] and the psycopg2 postgres library so that these new tests will find the appropriate library (sqlalchemy will attempt to find these when connecting). Change-Id: I90e59504663277d277d94e1f2a11031119bcedd6
* Add envs for different sqlalchemy versionsJoshua Harlow2014-01-091-1/+9
| | | | | | | | | | | | | Adjust tests to skip the sqlalchemy test if sqlalchemy is not installed. Adjust examples to fallback to a directory based backend if the sqlalchemy does not load or is not available. Include a updated tox.ini (generated from the toxgen.py script) that includes the new venv variations. Change-Id: I7686f09901a9b65d7c81b4e037b5bffc24aa7ef7
* Move toward using a backend+connection modelJoshua Harlow2013-09-121-14/+12
| | | | | | | | | | | | | | | | | | Instead of having a pretty restrictive module based api for saving logbook objects it is much more friendly and extensible to move toward a more ceilometer-influenced engine and connection based storage backend using stevedore to do the backend loading instead of a custom registration/fetching mechanism. This allows us to provide a base object oriented backend api that can be easily inherited from to allow for customized & pluggable backend storage modules. Implements blueprint stevedore-based-backends Implements blueprint ceilometer-influenced-backends Change-Id: Ib5868d3d9018b7aa1a3354858dcb90ca1a04055d
* Use the same root test class.Joshua Harlow2013-08-261-3/+2
| | | | | | | | | | | Instead of being strongly tied to unittest2 make it easier for taskflow to switch to another root class (testr?) by abstracting out the unittest2 usage. This also enables some useful functionality to exist in that root test class that other tasks can take advantage of. Change-Id: I381b6fb07e47f984b44cde439a17f39a1c1d32ac
* Rework the persistence layerJoshua Harlow2013-08-241-0/+51
1. Simplify the exposed api to reduce race conditions which could occur if we allowed flow details, task details and log books to be deleted at different times; reduce this down to just being able to save and delete from logbooks (and only save/update for flow and task details to) to reduce the problem cases. 2. Introduce a alembic migration with a proper schema so that the initial database can be created in the first place, adjust its exposed fields and relations to be defined by said schema. 3. Use oslo db models instead of our own. Change-Id: I78bbedf87d506d3f39157198638937c933235b7b