Merge lp:~cjwatson/launchpad/buildd-148-compat into lp:launchpad

Proposed by Colin Watson
Status: Merged
Merged at revision: 18456
Proposed branch: lp:~cjwatson/launchpad/buildd-148-compat
Merge into: lp:launchpad
Diff against target: 78 lines (+12/-7)
2 files modified
lib/lp/buildmaster/tests/mock_slaves.py (+7/-4)
lib/lp/buildmaster/tests/test_interactor.py (+5/-3)
To merge this branch: bzr merge lp:~cjwatson/launchpad/buildd-148-compat
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+330661@code.launchpad.net

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.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/buildmaster/tests/mock_slaves.py'
2--- lib/lp/buildmaster/tests/mock_slaves.py 2016-05-26 13:45:24 +0000
3+++ lib/lp/buildmaster/tests/mock_slaves.py 2017-09-13 09:31:21 +0000
4@@ -1,4 +1,4 @@
5-# Copyright 2009-2016 Canonical Ltd. This software is licensed under the
6+# Copyright 2009-2017 Canonical Ltd. This software is licensed under the
7 # GNU Affero General Public License version 3 (see the file LICENSE).
8
9 """Mock Build objects for tests soyuz buildd-system."""
10@@ -279,8 +279,10 @@
11
12 class SlaveTestHelpers(fixtures.Fixture):
13
14- # The URL for the XML-RPC service set up by `BuilddSlaveTestSetup`.
15- BASE_URL = 'http://localhost:8221'
16+ @property
17+ def base_url(self):
18+ """The URL for the XML-RPC service set up by `BuilddSlaveTestSetup`."""
19+ return 'http://localhost:%d' % BuilddSlaveTestSetup().daemon_port
20
21 def getServerSlave(self):
22 """Set up a test build slave server.
23@@ -301,7 +303,7 @@
24 Points to a fixed URL that is also used by `BuilddSlaveTestSetup`.
25 """
26 return BuilderSlave.makeBuilderSlave(
27- self.BASE_URL, 'vmhost', config.builddmaster.socket_timeout,
28+ self.base_url, 'vmhost', config.builddmaster.socket_timeout,
29 reactor=reactor, proxy=proxy, pool=pool)
30
31 def makeCacheFile(self, tachandler, filename):
32@@ -336,6 +338,7 @@
33 self.makeCacheFile(tachandler, dsc_file)
34 extra_args = {
35 'distribution': 'ubuntu',
36+ 'series': 'precise',
37 'suite': 'precise',
38 'ogrecomponent': 'main',
39 }
40
41=== modified file 'lib/lp/buildmaster/tests/test_interactor.py'
42--- lib/lp/buildmaster/tests/test_interactor.py 2016-05-26 12:55:26 +0000
43+++ lib/lp/buildmaster/tests/test_interactor.py 2017-09-13 09:31:21 +0000
44@@ -1,4 +1,4 @@
45-# Copyright 2009-2016 Canonical Ltd. This software is licensed under the
46+# Copyright 2009-2017 Canonical Ltd. This software is licensed under the
47 # GNU Affero General Public License version 3 (see the file LICENSE).
48
49 """Test BuilderInteractor features."""
50@@ -14,6 +14,7 @@
51 import xmlrpclib
52
53 from lpbuildd.slave import BuilderStatus
54+from lpbuildd.tests.harness import BuilddSlaveTestSetup
55 from testtools.deferredruntest import (
56 assert_fails_with,
57 AsynchronousDeferredRunTest,
58@@ -769,7 +770,7 @@
59 'HelloWorld.txt', content=content)
60 self.layer.txn.commit()
61 expected_url = '%s/filecache/%s' % (
62- self.slave_helper.BASE_URL, lf.content.sha1)
63+ self.slave_helper.base_url, lf.content.sha1)
64 self.slave_helper.getServerSlave()
65 slave = self.slave_helper.getClientSlave()
66 d = slave.ensurepresent(lf.content.sha1, lf.http_url, "", "")
67@@ -839,9 +840,10 @@
68 with open(local_file) as f:
69 self.assertEqual(content_map[sha1], f.read())
70 # Only two connections were used.
71+ port = BuilddSlaveTestSetup().daemon_port
72 self.assertThat(
73 slave.pool._connections,
74- MatchesDict({("http", "localhost", 8221): HasLength(2)}))
75+ MatchesDict({("http", "localhost", port): HasLength(2)}))
76 return slave.pool.closeCachedConnections()
77
78 def finished_uploading(ignored):