← Back to team overview

launchpad-dev team mailing list archive

Re: Archaeology questions

 

On Mon, Feb 21, 2011 at 9:10 AM, Stuart Bishop
<stuart.bishop@xxxxxxxxxxxxx> wrote:
> On Sat, Feb 19, 2011 at 9:12 PM, Jonathan Lange <jml@xxxxxxxxxxxxx> wrote:
>
>> 2. I don't really understand why canonical.ftests.pgsql (soon to be
>> lp.testing.pgsql) is needed. Could someone explain? There are some
>> mysterious comments about "until we've switched to storm"
>> (test_mockdb) – have we? If so, what opportunities do we have for
>> clean up? Also, I saw some tests using it directly, surely there's
>> something they should be using instead?
>>
>> (I hope to delete canonical.testing.pgsql)
>
> When running tests, we wrap the connection object so we can sniff
> certain operations. In particular, if we don't see a commit happen we
> assume we can just issue a rollback() to reset the database, saving
> lots of time.
>

Thanks for the explanation. I'll try to put that into the code.

> The mockdb is an ongoing project I hope to revisit soon, which should
> be simpler now we have switched to Storm (as indicated by the
> comments). Tests will replay from a recording instead of querying the
> real db for hopefully massive speed improvements.
>

Sounds like a good idea. Should it be in the tree before it's actually usable?

> This is also where the testsuite's database test fixture lives, which
> is strangely enough rather necessary :)
>

I can bring myself to believe that. Hmm, actually. Are you talking
about pgsql or mockdb here?

>> 3. canonical.lp is "deprecated", but it doesn't say what it's
>> deprecated in favour of. Lots of code uses initZopeless from that
>> module, so I'd guess that it's in favour of
>> c.database.sqlbase.ZopelessTransactionManager. Bug 484033 doesn't
>> really add much more information.
>
> I think the module is deprecated in favor of putting things in a
> better location...
>

Ahh I see. Not that "you ought to use something else", but rather "you
should not put new stuff in here"?

Thanks again,
jml



Follow ups

References