Merge lp:~jml/launchpad/no-testing-on-prod-bug-559128-devel into lp:launchpad

Proposed by Jonathan Lange
Status: Merged
Approved by: Данило Шеган
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~jml/launchpad/no-testing-on-prod-bug-559128-devel
Merge into: lp:launchpad
Diff against target: 38 lines (+4/-3)
1 file modified
utilities/create-lp-wadl-and-apidoc.py (+4/-3)
To merge this branch: bzr merge lp:~jml/launchpad/no-testing-on-prod-bug-559128-devel
Reviewer Review Type Date Requested Status
Данило Шеган (community) code Approve
Review via email: mp+23655@code.launchpad.net

Commit message

Import login code from libraries, rather than testing code. Allows staging and edge to be deployed again.

Description of the change

In https://code.edge.launchpad.net/~flacoste/launchpad/bug-559128/+merge/23504, flacoste mostly fixed bug 559128 by splitting out the non-testing behaviour of login etc. into a non-testing module.

This branch finishes the job by fixing a script that flacoste didn't change.

Raises the question, how do we prevent this from happening again? Here, a developer depended on lp.testing / canonical.launchpad.ftests in code that's only used in the build process. It's a natural enough thing to do.

To post a comment you must log in.
Revision history for this message
Данило Шеган (danilo) wrote :

Looks good.

review: Approve (code)
Revision history for this message
Данило Шеган (danilo) wrote :

I was also wondering if we could have a buildbot to run 'make build' in production env, but then jml mentioned some 'edge' thing.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'utilities/create-lp-wadl-and-apidoc.py'
2--- utilities/create-lp-wadl-and-apidoc.py 2010-03-25 18:06:39 +0000
3+++ utilities/create-lp-wadl-and-apidoc.py 2010-04-19 10:09:17 +0000
4@@ -12,7 +12,6 @@
5
6 import _pythonpath
7
8-from cStringIO import StringIO
9 import os
10 import pkg_resources
11 import subprocess
12@@ -22,14 +21,16 @@
13 from zope.component import getUtility
14 from zope.pagetemplate.pagetemplatefile import PageTemplateFile
15
16-from canonical.launchpad.ftests import login, ANONYMOUS
17 from canonical.launchpad.scripts import execute_zcml_for_scripts
18+from canonical.launchpad.webapp.interaction import (
19+ ANONYMOUS, setupInteractionByEmail)
20 from canonical.launchpad.webapp.servers import (
21 WebServicePublication, WebServiceTestRequest)
22 from canonical.launchpad.webapp.vhosts import allvhosts
23 from canonical.launchpad.systemhomes import WebServiceApplication
24 from lazr.restful.interfaces import IWebServiceConfiguration
25
26+
27 def main(path_template):
28 WebServiceApplication.cached_wadl = None # do not use cached file version
29 execute_zcml_for_scripts()
30@@ -61,7 +62,7 @@
31 # publisher) and then calling the root resource - retrieved through
32 # getApplication().
33 request.setPublication(WebServicePublication(None))
34- login(ANONYMOUS, request)
35+ setupInteractionByEmail(ANONYMOUS, request)
36 filename = path_template % {'version' : version}
37 print "Writing WADL for version %s to %s." % (version, filename)
38 f = open(filename, 'w')