Christian Boos wrote:
[...]
> 
> So what about the status of the MySQL support?
> 

For those who are curious, my latest patch (attached to #986) fixes all
known bugs, and works w/ mysql4.1 and 5.0.  I've got some coworkers
playing with it (w/ mysql5.0), as well; they haven't turned up
additional bugs yet.

In the meantime, I've been working on making the databases that the unit
tests use as a configurable option.  The goal is to have the unit tests
use a mysql database, and pass them all; at that point, I'll be
satisfied that the mysql patch is completely Bug Free ;).  When running
test.py, setting the environment variable TESTDB to some database string
(ie, mysql://[EMAIL PROTECTED]/test, or sqlite://foo.sql) will cause it to
use that database for unit tests instead of the default sqlite::memory:.

The changes required for this include:
 - Making DatabaseManager's _get_connector() method public, as the
comment says it should be.
 - Having EnvironmentStub be smart enough to deal w/ $TESTDB, and making
its is_component_enabled() special-case IDatabaseConnector (otherwise
unit tests that specify what components to enable end up ignoring db
components, and thus the tests fail).
 - Making unit tests subclass TracUnitTest(unittest.TestCase), which
provides a default setUp() and tearDown() for each set of unit tests.
That means we don't have to manually call EnvironmentStub() for each
test class, and handles destruction of the test database when it's
finished with it.
 - Along w/ init_db, database backends need to have a destroy_db that
gets rid of the database.  For a database like mysql (where we probably
don't have db dropping privileges), this empties all tables from the
database.  For sqlite it removes the database file (if it exists).

If anyone has any suggestions/comments on how things should be done, I'm
all ears; otherwise, I'll go ahead w/ what I've listed here.  I fully
expect that once I have this finished, I will find a lot of
mysql-specific bugs.
_______________________________________________
Trac-dev mailing list
[email protected]
http://lists.edgewall.com/mailman/listinfo/trac-dev

Reply via email to