Merge lp:~jml/launchpad/run-code-tests-in-db-layer into lp:launchpad

Proposed by Jonathan Lange
Status: Merged
Approved by: Graham Binns
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~jml/launchpad/run-code-tests-in-db-layer
Merge into: lp:launchpad
Diff against target: None lines
To merge this branch: bzr merge lp:~jml/launchpad/run-code-tests-in-db-layer
Reviewer Review Type Date Requested Status
Graham Binns (community) Approve
Review via email: mp+10962@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Jonathan Lange (jml) wrote :

This branch makes most of the code doc tests use the DatabaseFunctionalLayer, rather than the LaunchpadFunctionalLayer.

Revision history for this message
Robert Collins (lifeless) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jonathan Lange wrote:
> Jonathan Lange has proposed merging lp:~jml/launchpad/run-code-tests-in-db-layer into lp:launchpad/devel.
>
> Requested reviews:
> Canonical Launchpad Engineering (launchpad)
>
> This branch makes most of the code doc tests use the DatabaseFunctionalLayer, rather than the LaunchpadFunctionalLayer.

For my edification; how much faster is this?

- -Rob

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkqc324ACgkQ42zgmrPGrq7ORwCgpVrgt0jwwxEJKIfGWaUx5TET
6NEAoIdSxMynM5IMEEJUJUCX71LtNJqv
=d2l4
-----END PGP SIGNATURE-----

Revision history for this message
Graham Binns (gmb) :
review: Approve
Revision history for this message
Jonathan Lange (jml) wrote :

On Tue, Sep 1, 2009 at 6:48 PM, Robert Collins<email address hidden> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Jonathan Lange wrote:
>> Jonathan Lange has proposed merging lp:~jml/launchpad/run-code-tests-in-db-layer into lp:launchpad/devel.
>>
>> Requested reviews:
>>     Canonical Launchpad Engineering (launchpad)
>>
>> This branch makes most of the code doc tests use the DatabaseFunctionalLayer, rather than the LaunchpadFunctionalLayer.
>
> For my edification; how much faster is this?
>

For running the total suite, my tests say 2 minutes slower, but that
may be noise.

For running any particular lp.code doctest, 10 seconds faster.

jml

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/code/tests/test_doc.py'
2--- lib/lp/code/tests/test_doc.py 2009-06-30 16:56:07 +0000
3+++ lib/lp/code/tests/test_doc.py 2009-09-01 06:13:55 +0000
4@@ -10,12 +10,12 @@
5 from zope.security.management import setSecurityPolicy
6
7 from canonical.launchpad.testing.systemdocs import (
8- LayeredDocFileSuite, setGlobs, tearDown)
9+ LayeredDocFileSuite, setGlobs, setUp, tearDown)
10 from canonical.launchpad.ftests.test_system_documentation import (
11 branchscannerSetUp)
12 from canonical.launchpad.webapp.authorization import LaunchpadSecurityPolicy
13-from canonical.testing import LaunchpadZopelessLayer
14-
15+from canonical.testing import (
16+ DatabaseFunctionalLayer, LaunchpadFunctionalLayer, LaunchpadZopelessLayer)
17 from lp.services.testing import build_test_suite
18
19
20@@ -57,8 +57,16 @@
21 setUp=branchscannerSetUp, tearDown=tearDown,
22 layer=LaunchpadZopelessLayer
23 ),
24+ 'codeimport-result.txt': LayeredDocFileSuite(
25+ '../doc/codeimport-result.txt',
26+ setUp=setUp, tearDown=tearDown, layer=LaunchpadFunctionalLayer,
27+ ),
28+ 'branch-merge-proposal-notifications.txt': LayeredDocFileSuite(
29+ '../doc/branch-merge-proposal-notifications.txt',
30+ setUp=setUp, tearDown=tearDown, layer=LaunchpadFunctionalLayer,
31+ ),
32 }
33
34
35 def test_suite():
36- return build_test_suite(here, special)
37+ return build_test_suite(here, special, layer=DatabaseFunctionalLayer)