simplemultiproject

32 views
Skip to first unread message

Jeffrey Ratcliffe

unread,
Nov 11, 2016, 4:00:28 PM11/11/16
to trac...@googlegroups.com
I'm writing a plugin that adds to the functionality in the
simplemultiproject plugin and I'm struggling to run the tests in smp.

python setup.py test

and similar don't find any tests.

python -m unittest discover

finds them, but produces a load of errors about the smp tables not existing.

How do I run the unit tests in smp?

Regards

Jeff

RjOllos

unread,
Nov 11, 2016, 4:39:35 PM11/11/16
to Trac Development


On Friday, November 11, 2016 at 4:00:28 PM UTC-5, Jeffrey Ratcliffe wrote:
I'm writing a plugin that adds to the functionality in the
simplemultiproject plugin and I'm struggling to run the tests in smp.

python setup.py test

It should work after [15952]


However, many tests are failing. It looks like the environment upgrade isn't properly implemented in setUp.

Jeffrey Ratcliffe

unread,
Nov 14, 2016, 2:34:38 PM11/14/16
to Trac Development


On Friday, 11 November 2016 22:39:35 UTC+1, RjOllos wrote:

It should work after [15952]


Certainly the tests are now found correctly. Thanks.
 
However, many tests are failing. It looks like the environment upgrade isn't properly implemented in setUp.

I've been doing some hacking around, and the EnvironmentStub class in trac does not seem to deal well with an environment upgrade.

In trac/env.py, the database manager shuts down all connections after an upgrade. The sqlite db for tests is in memory, is it not? Perhaps shutting it down also kills the db, and when the connection is reopened, it is empty?

If I comment out the DatabaseManager(self).
shutdown() line, the results of the upgrade are there.

So to me, this looks like a bug in trac.

RjOllos

unread,
Nov 15, 2016, 1:48:30 AM11/15/16
to Trac Development


On Monday, November 14, 2016 at 2:34:38 PM UTC-5, Jeffrey Ratcliffe wrote:


On Friday, 11 November 2016 22:39:35 UTC+1, RjOllos wrote:

It should work after [15952]


Certainly the tests are now found correctly. Thanks.

Tests are passing with in-memory SQLite database after r15965.
I haven't tested with other databases.
 
However, many tests are failing. It looks like the environment upgrade isn't properly implemented in setUp.

I've been doing some hacking around, and the EnvironmentStub class in trac does not seem to deal well with an environment upgrade.

In trac/env.py, the database manager shuts down all connections after an upgrade. The sqlite db for tests is in memory, is it not? Perhaps shutting it down also kills the db, and when the connection is reopened, it is empty?

If I comment out the DatabaseManager(self).
shutdown() line, the results of the upgrade are there.

So to me, this looks like a bug in trac.

That should probably be fixed.  I created a ticket for the issue:

- Ryan

Jeffrey Ratcliffe

unread,
Nov 15, 2016, 12:44:34 PM11/15/16
to trac...@googlegroups.com
On 15 November 2016 at 07:48, RjOllos <rjo...@gmail.com> wrote:
> Tests are passing with in-memory SQLite database after r15965.
> https://trac-hacks.org/changeset/15965

Confirmed. Thanks for that.

Regards

Jeff
Reply all
Reply to author
Forward
0 new messages