Merge lp:~wgrant/launchpad/buildd-virtualenv into lp:launchpad

Proposed by William Grant
Status: Merged
Merged at revision: 18650
Proposed branch: lp:~wgrant/launchpad/buildd-virtualenv
Merge into: lp:launchpad
Diff against target: 50 lines (+13/-2)
1 file modified
lib/lp/buildmaster/tests/mock_slaves.py (+13/-2)
To merge this branch: bzr merge lp:~wgrant/launchpad/buildd-virtualenv
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+345501@code.launchpad.net

Commit message

Fix the test suite to run buildd-slave.tac in its virtualenv.

Description of the change

Broke when launchpad-developer-dependencies stopped pulling in python-twisted-core via python-lpbuildd.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/buildmaster/tests/mock_slaves.py'
--- lib/lp/buildmaster/tests/mock_slaves.py 2018-01-26 13:47:51 +0000
+++ lib/lp/buildmaster/tests/mock_slaves.py 2018-05-14 09:02:33 +0000
@@ -20,6 +20,7 @@
20 ]20 ]
2121
22import os22import os
23import sys
23import types24import types
24import xmlrpclib25import xmlrpclib
2526
@@ -37,6 +38,7 @@
37from lp.buildmaster.interactor import BuilderSlave38from lp.buildmaster.interactor import BuilderSlave
38from lp.buildmaster.interfaces.builder import CannotFetchFile39from lp.buildmaster.interfaces.builder import CannotFetchFile
39from lp.services.config import config40from lp.services.config import config
41from lp.services.daemons.tachandler import twistd_script
40from lp.services.webapp import urlappend42from lp.services.webapp import urlappend
41from lp.testing.sampledata import I386_ARCHITECTURE_NAME43from lp.testing.sampledata import I386_ARCHITECTURE_NAME
4244
@@ -274,19 +276,28 @@
274 return defer.Deferred()276 return defer.Deferred()
275277
276278
279class LPBuilddSlaveTestSetup(BuilddSlaveTestSetup):
280 """A BuilddSlaveTestSetup that uses the LP virtualenv."""
281
282 def setUp(self):
283 super(LPBuilddSlaveTestSetup, self).setUp(
284 python_path=sys.executable,
285 twistd_script=twistd_script)
286
287
277class SlaveTestHelpers(fixtures.Fixture):288class SlaveTestHelpers(fixtures.Fixture):
278289
279 @property290 @property
280 def base_url(self):291 def base_url(self):
281 """The URL for the XML-RPC service set up by `BuilddSlaveTestSetup`."""292 """The URL for the XML-RPC service set up by `BuilddSlaveTestSetup`."""
282 return 'http://localhost:%d' % BuilddSlaveTestSetup().daemon_port293 return 'http://localhost:%d' % LPBuilddSlaveTestSetup().daemon_port
283294
284 def getServerSlave(self):295 def getServerSlave(self):
285 """Set up a test build slave server.296 """Set up a test build slave server.
286297
287 :return: A `BuilddSlaveTestSetup` object.298 :return: A `BuilddSlaveTestSetup` object.
288 """299 """
289 tachandler = self.useFixture(BuilddSlaveTestSetup())300 tachandler = self.useFixture(LPBuilddSlaveTestSetup())
290 self.addDetail(301 self.addDetail(
291 'xmlrpc-log-file',302 'xmlrpc-log-file',
292 Content(303 Content(