Mercurial > p > roundup > code
diff test/test_mysql.py @ 4472:34dce76bb202
Multilink fixes and optimizations:
- Optimisation: Late evaluation of Multilinks (only in rdbms backends):
previously we materialized each multilink in a Node -- this creates an
SQL query for each multilink (e.g. 'files' and 'messages' for each
line in the issue index display) -- even if the multilinks aren't
displayed. Now we compute multilinks only if they're accessed (and
keep them cached).
- Add a filter_iter similar to the existing filter call. This feature is
considered experimental. This is currently not used in the
web-interface but passes all tests for the filter call except sorting
by Multilinks (which isn't supported by SQL and isn't a sane concept
anyway). When using filter_iter instead of filter this saves a *lot*
of SQL queries: Filter returns only the IDs of Nodes in the database,
the additional content of a Node has to be fetched in a separate SQL
call. The new filter_iter also returns the IDs of Nodes (one by one,
it's an iterator) but pre-seeds the cache with the content of the
Node. The information needed for seeding the cache is retrieved in the
same SQL query as the ids.
| author | Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net> |
|---|---|
| date | Mon, 21 Mar 2011 20:44:39 +0000 |
| parents | 2784c239e6c8 |
| children | 6e3e4f24c753 |
line wrap: on
line diff
--- a/test/test_mysql.py Wed Mar 16 11:26:50 2011 +0000 +++ b/test/test_mysql.py Mon Mar 21 20:44:39 2011 +0000 @@ -23,7 +23,7 @@ from roundup.backends import get_backend, have_backend from db_test_base import DBTest, ROTest, config, SchemaTest, ClassicInitTest -from db_test_base import ConcurrentDBTest +from db_test_base import ConcurrentDBTest, FilterCacheTest class mysqlOpener: @@ -68,9 +68,18 @@ backend = 'mysql' def setUp(self): mysqlOpener.setUp(self) - ClassicInitTest.setUp(self) + ConcurrentDBTest.setUp(self) def tearDown(self): - ClassicInitTest.tearDown(self) + ConcurrentDBTest.tearDown(self) + self.nuke_database() + +class mysqlFilterCacheTest(mysqlOpener, FilterCacheTest): + backend = 'mysql' + def setUp(self): + mysqlOpener.setUp(self) + FilterCacheTest.setUp(self) + def tearDown(self): + FilterCacheTest.tearDown(self) self.nuke_database() from session_common import RDBMSTest @@ -103,6 +112,7 @@ suite.addTest(unittest.makeSuite(mysqlClassicInitTest)) suite.addTest(unittest.makeSuite(mysqlSessionTest)) suite.addTest(unittest.makeSuite(mysqlConcurrencyTest)) + suite.addTest(unittest.makeSuite(mysqlFilterCacheTest)) return suite if __name__ == '__main__':
