launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #21838
[Merge] lp:~cjwatson/launchpad/buildd-148-compat into lp:launchpad
Colin Watson has proposed merging lp:~cjwatson/launchpad/buildd-148-compat into lp:launchpad.
Commit message:
Prepare for launchpad-buildd >= 148. The test harness now runs on a different port, and we need to pass 'series' in test buildd arguments.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/buildd-148-compat/+merge/330661
--
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/buildd-148-compat into lp:launchpad.
=== modified file 'lib/lp/buildmaster/tests/mock_slaves.py'
--- lib/lp/buildmaster/tests/mock_slaves.py 2016-05-26 13:45:24 +0000
+++ lib/lp/buildmaster/tests/mock_slaves.py 2017-09-13 09:31:21 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009-2016 Canonical Ltd. This software is licensed under the
+# Copyright 2009-2017 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Mock Build objects for tests soyuz buildd-system."""
@@ -279,8 +279,10 @@
class SlaveTestHelpers(fixtures.Fixture):
- # The URL for the XML-RPC service set up by `BuilddSlaveTestSetup`.
- BASE_URL = 'http://localhost:8221'
+ @property
+ def base_url(self):
+ """The URL for the XML-RPC service set up by `BuilddSlaveTestSetup`."""
+ return 'http://localhost:%d' % BuilddSlaveTestSetup().daemon_port
def getServerSlave(self):
"""Set up a test build slave server.
@@ -301,7 +303,7 @@
Points to a fixed URL that is also used by `BuilddSlaveTestSetup`.
"""
return BuilderSlave.makeBuilderSlave(
- self.BASE_URL, 'vmhost', config.builddmaster.socket_timeout,
+ self.base_url, 'vmhost', config.builddmaster.socket_timeout,
reactor=reactor, proxy=proxy, pool=pool)
def makeCacheFile(self, tachandler, filename):
@@ -336,6 +338,7 @@
self.makeCacheFile(tachandler, dsc_file)
extra_args = {
'distribution': 'ubuntu',
+ 'series': 'precise',
'suite': 'precise',
'ogrecomponent': 'main',
}
=== modified file 'lib/lp/buildmaster/tests/test_interactor.py'
--- lib/lp/buildmaster/tests/test_interactor.py 2016-05-26 12:55:26 +0000
+++ lib/lp/buildmaster/tests/test_interactor.py 2017-09-13 09:31:21 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009-2016 Canonical Ltd. This software is licensed under the
+# Copyright 2009-2017 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Test BuilderInteractor features."""
@@ -14,6 +14,7 @@
import xmlrpclib
from lpbuildd.slave import BuilderStatus
+from lpbuildd.tests.harness import BuilddSlaveTestSetup
from testtools.deferredruntest import (
assert_fails_with,
AsynchronousDeferredRunTest,
@@ -769,7 +770,7 @@
'HelloWorld.txt', content=content)
self.layer.txn.commit()
expected_url = '%s/filecache/%s' % (
- self.slave_helper.BASE_URL, lf.content.sha1)
+ self.slave_helper.base_url, lf.content.sha1)
self.slave_helper.getServerSlave()
slave = self.slave_helper.getClientSlave()
d = slave.ensurepresent(lf.content.sha1, lf.http_url, "", "")
@@ -839,9 +840,10 @@
with open(local_file) as f:
self.assertEqual(content_map[sha1], f.read())
# Only two connections were used.
+ port = BuilddSlaveTestSetup().daemon_port
self.assertThat(
slave.pool._connections,
- MatchesDict({("http", "localhost", 8221): HasLength(2)}))
+ MatchesDict({("http", "localhost", port): HasLength(2)}))
return slave.pool.closeCachedConnections()
def finished_uploading(ignored):
Follow ups