launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #23319
[Merge] lp:~cjwatson/launchpad-buildd/rename-fakeslave into lp:launchpad-buildd
Colin Watson has proposed merging lp:~cjwatson/launchpad-buildd/rename-fakeslave into lp:launchpad-buildd with lp:~cjwatson/launchpad-buildd/rename-slave-classes as a prerequisite.
Commit message:
Rename FakeSlave to FakeBuilder.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad-buildd/rename-fakeslave/+merge/363048
--
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad-buildd/rename-fakeslave into lp:launchpad-buildd.
=== modified file 'debian/changelog'
--- debian/changelog 2019-02-12 10:42:04 +0000
+++ debian/changelog 2019-02-12 10:42:04 +0000
@@ -7,6 +7,7 @@
* Move /usr/share/launchpad-buildd/slavebin to
/usr/share/launchpad-buildd/bin.
* Rename BuildDSlave to Builder and XMLRPCBuildDSlave to XMLRPCBuilder.
+ * Rename FakeSlave to FakeBuilder.
-- Colin Watson <cjwatson@xxxxxxxxxx> Fri, 08 Feb 2019 15:09:35 +0000
=== modified file 'lpbuildd/pottery/tests/test_intltool.py'
--- lpbuildd/pottery/tests/test_intltool.py 2017-11-10 20:41:59 +0000
+++ lpbuildd/pottery/tests/test_intltool.py 2019-02-12 10:42:04 +0000
@@ -25,7 +25,7 @@
generate_pots,
get_translation_domain,
)
-from lpbuildd.tests.fakeslave import (
+from lpbuildd.tests.fakebuilder import (
FakeMethod,
UncontainedBackend,
)
=== modified file 'lpbuildd/target/backend.py'
--- lpbuildd/target/backend.py 2019-01-10 18:14:55 +0000
+++ lpbuildd/target/backend.py 2019-02-12 10:42:04 +0000
@@ -188,11 +188,11 @@
backend_factory = LXD
elif name == "fake":
# Only for use in tests.
- from lpbuildd.tests.fakeslave import FakeBackend
+ from lpbuildd.tests.fakebuilder import FakeBackend
backend_factory = FakeBackend
elif name == "uncontained":
# Only for use in tests.
- from lpbuildd.tests.fakeslave import UncontainedBackend
+ from lpbuildd.tests.fakebuilder import UncontainedBackend
backend_factory = UncontainedBackend
else:
raise KeyError("Unknown backend: %s" % name)
=== modified file 'lpbuildd/target/tests/test_apt.py'
--- lpbuildd/target/tests/test_apt.py 2017-08-22 15:55:44 +0000
+++ lpbuildd/target/tests/test_apt.py 2019-02-12 10:42:04 +0000
@@ -20,7 +20,7 @@
)
from lpbuildd.target.cli import parse_args
-from lpbuildd.tests.fakeslave import FakeMethod
+from lpbuildd.tests.fakebuilder import FakeMethod
class MockCopyIn(FakeMethod):
=== modified file 'lpbuildd/target/tests/test_build_livefs.py'
--- lpbuildd/target/tests/test_build_livefs.py 2018-01-12 20:01:24 +0000
+++ lpbuildd/target/tests/test_build_livefs.py 2019-02-12 10:42:04 +0000
@@ -21,7 +21,7 @@
RETCODE_FAILURE_INSTALL,
)
from lpbuildd.target.cli import parse_args
-from lpbuildd.tests.fakeslave import FakeMethod
+from lpbuildd.tests.fakebuilder import FakeMethod
class RanCommand(MatchesListwise):
=== modified file 'lpbuildd/target/tests/test_build_snap.py'
--- lpbuildd/target/tests/test_build_snap.py 2019-02-11 12:22:42 +0000
+++ lpbuildd/target/tests/test_build_snap.py 2019-02-12 10:42:04 +0000
@@ -28,7 +28,7 @@
RETCODE_FAILURE_INSTALL,
)
from lpbuildd.target.cli import parse_args
-from lpbuildd.tests.fakeslave import FakeMethod
+from lpbuildd.tests.fakebuilder import FakeMethod
class RanCommand(MatchesListwise):
=== modified file 'lpbuildd/target/tests/test_generate_translation_templates.py'
--- lpbuildd/target/tests/test_generate_translation_templates.py 2017-10-27 08:08:49 +0000
+++ lpbuildd/target/tests/test_generate_translation_templates.py 2019-02-12 10:42:04 +0000
@@ -22,7 +22,7 @@
)
from lpbuildd.target.cli import parse_args
-from lpbuildd.tests.fakeslave import FakeMethod
+from lpbuildd.tests.fakebuilder import FakeMethod
class MatchesCall(MatchesListwise):
=== renamed file 'lpbuildd/tests/fakeslave.py' => 'lpbuildd/tests/fakebuilder.py'
--- lpbuildd/tests/fakeslave.py 2017-11-10 20:55:33 +0000
+++ lpbuildd/tests/fakebuilder.py 2019-02-12 10:42:04 +0000
@@ -4,8 +4,8 @@
__metaclass__ = type
__all__ = [
'FakeBackend',
+ 'FakeBuilder',
'FakeMethod',
- 'FakeSlave',
'UncontainedBackend',
]
@@ -82,7 +82,7 @@
return key
-class FakeSlave:
+class FakeBuilder:
def __init__(self, tempdir):
self._cachepath = tempdir
self._config = FakeConfig()
=== modified file 'lpbuildd/tests/matchers.py'
--- lpbuildd/tests/matchers.py 2017-08-04 17:31:19 +0000
+++ lpbuildd/tests/matchers.py 2019-02-12 10:42:04 +0000
@@ -11,7 +11,7 @@
class HasWaitingFiles(Matcher):
- """Match files that have been added using `slave.addWaitingFile`."""
+ """Match files that have been added using `builder.addWaitingFile`."""
def __init__(self, files):
self.files = files
@@ -21,9 +21,10 @@
return cls(
{name: Equals(contents) for name, contents in files.items()})
- def match(self, slave):
+ def match(self, builder):
waiting_file_contents = {}
- for name in slave.waitingfiles:
- with open(slave.cachePath(slave.waitingfiles[name]), "rb") as f:
+ for name in builder.waitingfiles:
+ cache_path = builder.cachePath(builder.waitingfiles[name])
+ with open(cache_path, "rb") as f:
waiting_file_contents[name] = f.read()
return MatchesDict(self.files).match(waiting_file_contents)
=== modified file 'lpbuildd/tests/test_binarypackage.py'
--- lpbuildd/tests/test_binarypackage.py 2019-02-11 12:22:42 +0000
+++ lpbuildd/tests/test_binarypackage.py 2019-02-12 10:42:04 +0000
@@ -30,9 +30,9 @@
BinaryPackageBuildState,
SBuildExitCodes,
)
-from lpbuildd.tests.fakeslave import (
+from lpbuildd.tests.fakebuilder import (
+ FakeBuilder,
FakeMethod,
- FakeSlave,
)
from lpbuildd.tests.matchers import HasWaitingFiles
@@ -95,17 +95,17 @@
self.useFixture(DisableSudo())
self.working_dir = tempfile.mkdtemp()
self.addCleanup(lambda: shutil.rmtree(self.working_dir))
- slave_dir = os.path.join(self.working_dir, 'slave')
+ builder_dir = os.path.join(self.working_dir, 'builder')
home_dir = os.path.join(self.working_dir, 'home')
- for dir in (slave_dir, home_dir):
+ for dir in (builder_dir, home_dir):
os.mkdir(dir)
- self.slave = FakeSlave(slave_dir)
+ self.builder = FakeBuilder(builder_dir)
self.buildid = '123'
self.clock = Clock()
self.buildmanager = MockBuildManager(
- self.slave, self.buildid, reactor=self.clock)
+ self.builder, self.buildid, reactor=self.clock)
self.buildmanager.home = home_dir
- self.buildmanager._cachepath = self.slave._cachepath
+ self.buildmanager._cachepath = self.builder._cachepath
self.chrootdir = os.path.join(
home_dir, 'build-%s' % self.buildid, 'chroot-autobuild')
@@ -139,7 +139,7 @@
'--arch=i386', '--dist=warty', '--nolog',
'foo_1.dsc',
], final=True)
- self.assertFalse(self.slave.wasCalled('chrootFail'))
+ self.assertFalse(self.builder.wasCalled('chrootFail'))
def assertState(self, state, command, env_matcher=None, final=False):
self.assertEqual(state, self.getState())
@@ -186,14 +186,14 @@
# After building the package, reap processes.
yield self.assertScansSanely(SBuildExitCodes.OK)
- self.assertFalse(self.slave.wasCalled('buildFail'))
- self.assertThat(self.slave, HasWaitingFiles.byEquality({
+ self.assertFalse(self.builder.wasCalled('buildFail'))
+ self.assertThat(self.builder, HasWaitingFiles.byEquality({
'foo_1_i386.changes': b'I am a changes file.',
}))
# Control returns to the DebianBuildManager in the UMOUNT state.
self.assertUnmountsSanely()
- self.assertFalse(self.slave.wasCalled('buildFail'))
+ self.assertFalse(self.builder.wasCalled('buildFail'))
@defer.inlineCallbacks
def test_with_debug_symbols(self):
@@ -215,7 +215,7 @@
'--arch=i386', '--dist=warty', '--nolog',
'foo_1.dsc'],
env_matcher=Not(Contains('DEB_BUILD_OPTIONS')), final=True)
- self.assertFalse(self.slave.wasCalled('chrootFail'))
+ self.assertFalse(self.builder.wasCalled('chrootFail'))
with open(os.path.join(self.chrootdir, 'CurrentlyBuilding')) as cb:
self.assertEqual(dedent("""\
Package: foo
@@ -247,7 +247,7 @@
env_matcher=ContainsDict(
{'DEB_BUILD_OPTIONS': Equals('noautodbgsym')}),
final=True)
- self.assertFalse(self.slave.wasCalled('chrootFail'))
+ self.assertFalse(self.builder.wasCalled('chrootFail'))
with open(os.path.join(self.chrootdir, 'CurrentlyBuilding')) as cb:
self.assertEqual(dedent("""\
Package: foo
@@ -268,12 +268,12 @@
['sharepath/bin/in-target', 'in-target', 'scan-for-processes',
'--backend=chroot', '--series=warty', '--arch=i386',
self.buildid], final=False)
- self.assertFalse(self.slave.wasCalled('buildFail'))
+ self.assertFalse(self.builder.wasCalled('buildFail'))
# If reaping completes successfully, the build manager returns
# control to the DebianBuildManager in the UMOUNT state.
self.assertUnmountsSanely()
- self.assertFalse(self.slave.wasCalled('buildFail'))
+ self.assertFalse(self.builder.wasCalled('buildFail'))
@defer.inlineCallbacks
def test_abort_sbuild_fail(self):
@@ -289,13 +289,13 @@
['sharepath/bin/in-target', 'in-target', 'scan-for-processes',
'--backend=chroot', '--series=warty', '--arch=i386',
self.buildid], final=False)
- self.assertFalse(self.slave.wasCalled('builderFail'))
+ self.assertFalse(self.builder.wasCalled('builderFail'))
reap_subprocess = self.buildmanager._subprocess
# If reaping fails, the builder is failed, sbuild is killed, and the
# reaper is disconnected.
self.clock.advance(120)
- self.assertTrue(self.slave.wasCalled('builderFail'))
+ self.assertTrue(self.builder.wasCalled('builderFail'))
self.assertEqual(
[(('KILL',), {})], sbuild_subprocess.transport.signalProcess.calls)
self.assertNotEqual(
@@ -338,7 +338,7 @@
'--backend=chroot', '--series=warty', '--arch=i386',
self.buildid],
final=True)
- self.assertFalse(self.slave.wasCalled('builderFail'))
+ self.assertFalse(self.builder.wasCalled('builderFail'))
@defer.inlineCallbacks
def test_missing_changes(self):
@@ -356,12 +356,12 @@
# After building the package, reap processes.
yield self.assertScansSanely(SBuildExitCodes.OK)
- self.assertTrue(self.slave.wasCalled('buildFail'))
- self.assertThat(self.slave, HasWaitingFiles({}))
+ self.assertTrue(self.builder.wasCalled('buildFail'))
+ self.assertThat(self.builder, HasWaitingFiles({}))
# Control returns to the DebianBuildManager in the UMOUNT state.
self.assertUnmountsSanely()
- self.assertTrue(self.slave.wasCalled('buildFail'))
+ self.assertTrue(self.builder.wasCalled('buildFail'))
def test_getAvailablePackages(self):
# getAvailablePackages scans the correct set of files and returns
@@ -588,11 +588,11 @@
yield self.assertScansSanely(SBuildExitCodes.GIVENBACK)
self.assertUnmountsSanely()
if dep is not None:
- self.assertFalse(self.slave.wasCalled('buildFail'))
- self.assertEqual([((dep,), {})], self.slave.depFail.calls)
+ self.assertFalse(self.builder.wasCalled('buildFail'))
+ self.assertEqual([((dep,), {})], self.builder.depFail.calls)
else:
- self.assertFalse(self.slave.wasCalled('depFail'))
- self.assertTrue(self.slave.wasCalled('buildFail'))
+ self.assertFalse(self.builder.wasCalled('depFail'))
+ self.assertTrue(self.builder.wasCalled('buildFail'))
@defer.inlineCallbacks
def test_detects_depfail(self):
@@ -645,8 +645,8 @@
"""))
yield self.assertScansSanely(SBuildExitCodes.GIVENBACK)
self.assertUnmountsSanely()
- self.assertFalse(self.slave.wasCalled('depFail'))
- self.assertTrue(self.slave.wasCalled('buildFail'))
+ self.assertFalse(self.builder.wasCalled('depFail'))
+ self.assertTrue(self.builder.wasCalled('buildFail'))
@defer.inlineCallbacks
def test_uninstallable_deps_analysis_depfail(self):
@@ -673,8 +673,9 @@
"""))
yield self.assertScansSanely(SBuildExitCodes.GIVENBACK)
self.assertUnmountsSanely()
- self.assertFalse(self.slave.wasCalled('buildFail'))
- self.assertEqual([(("ebadver (>= 2)",), {})], self.slave.depFail.calls)
+ self.assertFalse(self.builder.wasCalled('buildFail'))
+ self.assertEqual(
+ [(("ebadver (>= 2)",), {})], self.builder.depFail.calls)
@defer.inlineCallbacks
def test_uninstallable_deps_analysis_mixed_depfail(self):
@@ -712,8 +713,9 @@
"""))
yield self.assertScansSanely(SBuildExitCodes.GIVENBACK)
self.assertUnmountsSanely()
- self.assertFalse(self.slave.wasCalled('buildFail'))
- self.assertEqual([(("ebadver (>= 2)",), {})], self.slave.depFail.calls)
+ self.assertFalse(self.builder.wasCalled('buildFail'))
+ self.assertEqual(
+ [(("ebadver (>= 2)",), {})], self.builder.depFail.calls)
@defer.inlineCallbacks
def test_depfail_with_unknown_error_converted_to_packagefail(self):
@@ -725,5 +727,5 @@
"E: Everything is broken.\n")
yield self.assertScansSanely(SBuildExitCodes.GIVENBACK)
- self.assertTrue(self.slave.wasCalled('buildFail'))
- self.assertFalse(self.slave.wasCalled('depFail'))
+ self.assertTrue(self.builder.wasCalled('buildFail'))
+ self.assertFalse(self.builder.wasCalled('depFail'))
=== modified file 'lpbuildd/tests/test_debian.py'
--- lpbuildd/tests/test_debian.py 2019-02-11 12:22:42 +0000
+++ lpbuildd/tests/test_debian.py 2019-02-12 10:42:04 +0000
@@ -15,7 +15,7 @@
DebianBuildManager,
DebianBuildState,
)
-from lpbuildd.tests.fakeslave import FakeSlave
+from lpbuildd.tests.fakebuilder import FakeBuilder
class MockBuildState(DebianBuildState):
@@ -46,7 +46,7 @@
def iterate_MAIN(self, success):
if success != 0:
if not self.alreadyfailed:
- self._slave.buildFail()
+ self._builder.buildFail()
self.alreadyfailed = True
self.doReapProcesses(self._state)
@@ -62,17 +62,17 @@
super(TestDebianBuildManagerIteration, self).setUp()
self.working_dir = tempfile.mkdtemp()
self.addCleanup(lambda: shutil.rmtree(self.working_dir))
- slave_dir = os.path.join(self.working_dir, 'slave')
+ builder_dir = os.path.join(self.working_dir, 'builder')
home_dir = os.path.join(self.working_dir, 'home')
- for dir in (slave_dir, home_dir):
+ for dir in (builder_dir, home_dir):
os.mkdir(dir)
- self.slave = FakeSlave(slave_dir)
+ self.builder = FakeBuilder(builder_dir)
self.buildid = '123'
self.clock = Clock()
self.buildmanager = MockBuildManager(
- self.slave, self.buildid, reactor=self.clock)
+ self.builder, self.buildid, reactor=self.clock)
self.buildmanager.home = home_dir
- self.buildmanager._cachepath = self.slave._cachepath
+ self.buildmanager._cachepath = self.builder._cachepath
self.chrootdir = os.path.join(
home_dir, 'build-%s' % self.buildid, 'chroot-autobuild')
@@ -190,12 +190,12 @@
self.buildmanager.iterate, self.buildmanager.iterators[-1])
self.buildmanager.iterate(0)
- self.assertFalse(self.slave.wasCalled('builderFail'))
- self.assertFalse(self.slave.wasCalled('chrootFail'))
- self.assertFalse(self.slave.wasCalled('buildFail'))
- self.assertFalse(self.slave.wasCalled('depFail'))
- self.assertTrue(self.slave.wasCalled('buildOK'))
- self.assertTrue(self.slave.wasCalled('buildComplete'))
+ self.assertFalse(self.builder.wasCalled('builderFail'))
+ self.assertFalse(self.builder.wasCalled('chrootFail'))
+ self.assertFalse(self.builder.wasCalled('buildFail'))
+ self.assertFalse(self.builder.wasCalled('depFail'))
+ self.assertTrue(self.builder.wasCalled('buildOK'))
+ self.assertTrue(self.builder.wasCalled('buildComplete'))
def test_iterate_trusted_keys(self):
# The build manager iterates a build with trusted keys from start to
@@ -309,12 +309,12 @@
self.buildmanager.iterate, self.buildmanager.iterators[-1])
self.buildmanager.iterate(0)
- self.assertFalse(self.slave.wasCalled('builderFail'))
- self.assertFalse(self.slave.wasCalled('chrootFail'))
- self.assertFalse(self.slave.wasCalled('buildFail'))
- self.assertFalse(self.slave.wasCalled('depFail'))
- self.assertTrue(self.slave.wasCalled('buildOK'))
- self.assertTrue(self.slave.wasCalled('buildComplete'))
+ self.assertFalse(self.builder.wasCalled('builderFail'))
+ self.assertFalse(self.builder.wasCalled('chrootFail'))
+ self.assertFalse(self.builder.wasCalled('buildFail'))
+ self.assertFalse(self.builder.wasCalled('depFail'))
+ self.assertTrue(self.builder.wasCalled('buildOK'))
+ self.assertTrue(self.builder.wasCalled('buildComplete'))
def test_iterate_fast_cleanup(self):
# The build manager can be told that it doesn't need to do the final
@@ -397,12 +397,12 @@
self.buildmanager.iterate, self.buildmanager.iterators[-1])
self.buildmanager.iterateReap(self.getState(), 0)
- self.assertFalse(self.slave.wasCalled('builderFail'))
- self.assertFalse(self.slave.wasCalled('chrootFail'))
- self.assertFalse(self.slave.wasCalled('buildFail'))
- self.assertFalse(self.slave.wasCalled('depFail'))
- self.assertTrue(self.slave.wasCalled('buildOK'))
- self.assertTrue(self.slave.wasCalled('buildComplete'))
+ self.assertFalse(self.builder.wasCalled('builderFail'))
+ self.assertFalse(self.builder.wasCalled('chrootFail'))
+ self.assertFalse(self.builder.wasCalled('buildFail'))
+ self.assertFalse(self.builder.wasCalled('depFail'))
+ self.assertTrue(self.builder.wasCalled('buildOK'))
+ self.assertTrue(self.builder.wasCalled('buildComplete'))
def test_iterate_lxd(self):
# The build manager passes the image_type argument through to
=== modified file 'lpbuildd/tests/test_livefs.py'
--- lpbuildd/tests/test_livefs.py 2019-02-11 12:22:42 +0000
+++ lpbuildd/tests/test_livefs.py 2019-02-12 10:42:04 +0000
@@ -17,7 +17,7 @@
LiveFilesystemBuildManager,
LiveFilesystemBuildState,
)
-from lpbuildd.tests.fakeslave import FakeSlave
+from lpbuildd.tests.fakebuilder import FakeBuilder
from lpbuildd.tests.matchers import HasWaitingFiles
@@ -43,15 +43,15 @@
def setUp(self):
super(TestLiveFilesystemBuildManagerIteration, self).setUp()
self.working_dir = self.useFixture(TempDir()).path
- slave_dir = os.path.join(self.working_dir, "slave")
+ builder_dir = os.path.join(self.working_dir, "builder")
home_dir = os.path.join(self.working_dir, "home")
- for dir in (slave_dir, home_dir):
+ for dir in (builder_dir, home_dir):
os.mkdir(dir)
self.useFixture(EnvironmentVariable("HOME", home_dir))
- self.slave = FakeSlave(slave_dir)
+ self.builder = FakeBuilder(builder_dir)
self.buildid = "123"
- self.buildmanager = MockBuildManager(self.slave, self.buildid)
- self.buildmanager._cachepath = self.slave._cachepath
+ self.buildmanager = MockBuildManager(self.builder, self.buildid)
+ self.buildmanager._cachepath = self.builder._cachepath
def getState(self):
"""Retrieve build manager's state."""
@@ -76,7 +76,7 @@
# directly before BUILD_LIVEFS.
self.buildmanager._state = LiveFilesystemBuildState.UPDATE
- # BUILD_LIVEFS: Run the slave's payload to build the live filesystem.
+ # BUILD_LIVEFS: Run the builder's payload to build the live filesystem.
yield self.buildmanager.iterate(0)
self.assertEqual(
LiveFilesystemBuildState.BUILD_LIVEFS, self.getState())
@@ -88,7 +88,7 @@
self.assertEqual(expected_command, self.buildmanager.commands[-1])
self.assertEqual(
self.buildmanager.iterate, self.buildmanager.iterators[-1])
- self.assertFalse(self.slave.wasCalled("chrootFail"))
+ self.assertFalse(self.builder.wasCalled("chrootFail"))
@defer.inlineCallbacks
def test_iterate(self):
@@ -113,8 +113,8 @@
self.assertEqual(expected_command, self.buildmanager.commands[-1])
self.assertNotEqual(
self.buildmanager.iterate, self.buildmanager.iterators[-1])
- self.assertFalse(self.slave.wasCalled("buildFail"))
- self.assertThat(self.slave, HasWaitingFiles.byEquality({
+ self.assertFalse(self.builder.wasCalled("buildFail"))
+ self.assertThat(self.builder, HasWaitingFiles.byEquality({
"livecd.ubuntu.manifest": b"I am a manifest file.",
}))
@@ -128,7 +128,7 @@
self.assertEqual(expected_command, self.buildmanager.commands[-1])
self.assertEqual(
self.buildmanager.iterate, self.buildmanager.iterators[-1])
- self.assertFalse(self.slave.wasCalled("buildFail"))
+ self.assertFalse(self.builder.wasCalled("buildFail"))
@defer.inlineCallbacks
def test_omits_symlinks(self):
@@ -145,6 +145,6 @@
"/build/livecd.ubuntu.kernel", "livefs.ubuntu.kernel-generic")
yield self.buildmanager.iterate(0)
- self.assertThat(self.slave, HasWaitingFiles.byEquality({
+ self.assertThat(self.builder, HasWaitingFiles.byEquality({
"livecd.ubuntu.kernel-generic": b"I am a kernel.",
}))
=== modified file 'lpbuildd/tests/test_snap.py'
--- lpbuildd/tests/test_snap.py 2019-02-11 12:22:42 +0000
+++ lpbuildd/tests/test_snap.py 2019-02-12 10:42:04 +0000
@@ -30,7 +30,7 @@
SnapBuildState,
SnapProxyFactory,
)
-from lpbuildd.tests.fakeslave import FakeSlave
+from lpbuildd.tests.fakebuilder import FakeBuilder
from lpbuildd.tests.matchers import HasWaitingFiles
@@ -56,15 +56,15 @@
def setUp(self):
super(TestSnapBuildManagerIteration, self).setUp()
self.working_dir = self.useFixture(TempDir()).path
- slave_dir = os.path.join(self.working_dir, "slave")
+ builder_dir = os.path.join(self.working_dir, "builder")
home_dir = os.path.join(self.working_dir, "home")
- for dir in (slave_dir, home_dir):
+ for dir in (builder_dir, home_dir):
os.mkdir(dir)
self.useFixture(EnvironmentVariable("HOME", home_dir))
- self.slave = FakeSlave(slave_dir)
+ self.builder = FakeBuilder(builder_dir)
self.buildid = "123"
- self.buildmanager = MockBuildManager(self.slave, self.buildid)
- self.buildmanager._cachepath = self.slave._cachepath
+ self.buildmanager = MockBuildManager(self.builder, self.buildid)
+ self.buildmanager._cachepath = self.builder._cachepath
def getState(self):
"""Retrieve build manager's state."""
@@ -92,7 +92,7 @@
# directly before BUILD_SNAP.
self.buildmanager._state = SnapBuildState.UPDATE
- # BUILD_SNAP: Run the slave's payload to build the snap package.
+ # BUILD_SNAP: Run the builder's payload to build the snap package.
yield self.buildmanager.iterate(0)
self.assertEqual(SnapBuildState.BUILD_SNAP, self.getState())
expected_command = [
@@ -107,7 +107,7 @@
self.assertEqual(expected_command, self.buildmanager.commands[-1])
self.assertEqual(
self.buildmanager.iterate, self.buildmanager.iterators[-1])
- self.assertFalse(self.slave.wasCalled("chrootFail"))
+ self.assertFalse(self.builder.wasCalled("chrootFail"))
def test_status(self):
# The build manager returns saved status information on request.
@@ -141,8 +141,8 @@
self.assertEqual(expected_command, self.buildmanager.commands[-1])
self.assertNotEqual(
self.buildmanager.iterate, self.buildmanager.iterators[-1])
- self.assertFalse(self.slave.wasCalled("buildFail"))
- self.assertThat(self.slave, HasWaitingFiles.byEquality({
+ self.assertFalse(self.builder.wasCalled("buildFail"))
+ self.assertThat(self.builder, HasWaitingFiles.byEquality({
"test-snap_0_all.snap": b"I am a snap package.",
}))
@@ -156,7 +156,7 @@
self.assertEqual(expected_command, self.buildmanager.commands[-1])
self.assertEqual(
self.buildmanager.iterate, self.buildmanager.iterators[-1])
- self.assertFalse(self.slave.wasCalled("buildFail"))
+ self.assertFalse(self.builder.wasCalled("buildFail"))
@defer.inlineCallbacks
def test_iterate_with_manifest(self):
@@ -183,8 +183,8 @@
self.assertEqual(expected_command, self.buildmanager.commands[-1])
self.assertNotEqual(
self.buildmanager.iterate, self.buildmanager.iterators[-1])
- self.assertFalse(self.slave.wasCalled("buildFail"))
- self.assertThat(self.slave, HasWaitingFiles.byEquality({
+ self.assertFalse(self.builder.wasCalled("buildFail"))
+ self.assertThat(self.builder, HasWaitingFiles.byEquality({
"test-snap_0_all.manifest": b"I am a manifest.",
"test-snap_0_all.snap": b"I am a snap package.",
}))
@@ -199,7 +199,7 @@
self.assertEqual(expected_command, self.buildmanager.commands[-1])
self.assertEqual(
self.buildmanager.iterate, self.buildmanager.iterators[-1])
- self.assertFalse(self.slave.wasCalled("buildFail"))
+ self.assertFalse(self.builder.wasCalled("buildFail"))
@defer.inlineCallbacks
def test_iterate_with_build_source_tarball(self):
@@ -227,8 +227,8 @@
self.assertEqual(expected_command, self.buildmanager.commands[-1])
self.assertNotEqual(
self.buildmanager.iterate, self.buildmanager.iterators[-1])
- self.assertFalse(self.slave.wasCalled("buildFail"))
- self.assertThat(self.slave, HasWaitingFiles.byEquality({
+ self.assertFalse(self.builder.wasCalled("buildFail"))
+ self.assertThat(self.builder, HasWaitingFiles.byEquality({
"test-snap_0_all.snap": b"I am a snap package.",
"test-snap.tar.gz": b"I am a source tarball.",
}))
@@ -243,7 +243,7 @@
self.assertEqual(expected_command, self.buildmanager.commands[-1])
self.assertEqual(
self.buildmanager.iterate, self.buildmanager.iterators[-1])
- self.assertFalse(self.slave.wasCalled("buildFail"))
+ self.assertFalse(self.builder.wasCalled("buildFail"))
def getListenerURL(self, listener):
port = listener.getHost().port
=== modified file 'lpbuildd/tests/test_sourcepackagerecipe.py'
--- lpbuildd/tests/test_sourcepackagerecipe.py 2019-02-11 12:22:42 +0000
+++ lpbuildd/tests/test_sourcepackagerecipe.py 2019-02-12 10:42:04 +0000
@@ -17,7 +17,7 @@
SourcePackageRecipeBuildManager,
SourcePackageRecipeBuildState,
)
-from lpbuildd.tests.fakeslave import FakeSlave
+from lpbuildd.tests.fakebuilder import FakeBuilder
from lpbuildd.tests.matchers import HasWaitingFiles
@@ -44,15 +44,15 @@
super(TestSourcePackageRecipeBuildManagerIteration, self).setUp()
self.working_dir = tempfile.mkdtemp()
self.addCleanup(lambda: shutil.rmtree(self.working_dir))
- slave_dir = os.path.join(self.working_dir, 'slave')
+ builder_dir = os.path.join(self.working_dir, 'builder')
home_dir = os.path.join(self.working_dir, 'home')
- for dir in (slave_dir, home_dir):
+ for dir in (builder_dir, home_dir):
os.mkdir(dir)
- self.slave = FakeSlave(slave_dir)
+ self.builder = FakeBuilder(builder_dir)
self.buildid = '123'
- self.buildmanager = MockBuildManager(self.slave, self.buildid)
+ self.buildmanager = MockBuildManager(self.builder, self.buildid)
self.buildmanager.home = home_dir
- self.buildmanager._cachepath = self.slave._cachepath
+ self.buildmanager._cachepath = self.builder._cachepath
self.chrootdir = os.path.join(
home_dir, 'build-%s' % self.buildid, 'chroot-autobuild')
@@ -89,7 +89,7 @@
# directly before BUILD_RECIPE.
self.buildmanager._state = SourcePackageRecipeBuildState.UPDATE
- # BUILD_RECIPE: Run the slave's payload to build the source package.
+ # BUILD_RECIPE: Run the builder's payload to build the source package.
yield self.buildmanager.iterate(0)
self.assertEqual(
SourcePackageRecipeBuildState.BUILD_RECIPE, self.getState())
@@ -104,7 +104,7 @@
self.assertEqual(expected_command, self.buildmanager.commands[-1])
self.assertEqual(
self.buildmanager.iterate, self.buildmanager.iterators[-1])
- self.assertFalse(self.slave.wasCalled('chrootFail'))
+ self.assertFalse(self.builder.wasCalled('chrootFail'))
@defer.inlineCallbacks
def test_iterate(self):
@@ -138,8 +138,8 @@
self.assertEqual(expected_command, self.buildmanager.commands[-1])
self.assertNotEqual(
self.buildmanager.iterate, self.buildmanager.iterators[-1])
- self.assertFalse(self.slave.wasCalled('buildFail'))
- self.assertThat(self.slave, HasWaitingFiles.byEquality({
+ self.assertFalse(self.builder.wasCalled('buildFail'))
+ self.assertThat(self.builder, HasWaitingFiles.byEquality({
'foo_1_source.changes': b'I am a changes file.',
'manifest': b'I am a manifest file.',
}))
@@ -155,7 +155,7 @@
self.assertEqual(expected_command, self.buildmanager.commands[-1])
self.assertEqual(
self.buildmanager.iterate, self.buildmanager.iterators[-1])
- self.assertFalse(self.slave.wasCalled('buildFail'))
+ self.assertFalse(self.builder.wasCalled('buildFail'))
@defer.inlineCallbacks
def test_iterate_BUILD_RECIPE_install_build_deps_depfail(self):
@@ -182,9 +182,9 @@
self.assertEqual(expected_command, self.buildmanager.commands[-1])
self.assertNotEqual(
self.buildmanager.iterate, self.buildmanager.iterators[-1])
- self.assertFalse(self.slave.wasCalled('buildFail'))
+ self.assertFalse(self.builder.wasCalled('buildFail'))
self.assertEqual(
- [(("base-files (>= 1000)",), {})], self.slave.depFail.calls)
+ [(("base-files (>= 1000)",), {})], self.builder.depFail.calls)
# Control returns to the DebianBuildManager in the UMOUNT state.
self.buildmanager.iterateReap(self.getState(), 0)
@@ -197,7 +197,7 @@
self.assertEqual(expected_command, self.buildmanager.commands[-1])
self.assertEqual(
self.buildmanager.iterate, self.buildmanager.iterators[-1])
- self.assertFalse(self.slave.wasCalled('buildFail'))
+ self.assertFalse(self.builder.wasCalled('buildFail'))
@defer.inlineCallbacks
def test_iterate_BUILD_RECIPE_install_build_deps_buildfail(self):
@@ -221,8 +221,8 @@
self.assertEqual(expected_command, self.buildmanager.commands[-1])
self.assertNotEqual(
self.buildmanager.iterate, self.buildmanager.iterators[-1])
- self.assertTrue(self.slave.wasCalled('buildFail'))
- self.assertFalse(self.slave.wasCalled('depFail'))
+ self.assertTrue(self.builder.wasCalled('buildFail'))
+ self.assertFalse(self.builder.wasCalled('depFail'))
# Control returns to the DebianBuildManager in the UMOUNT state.
self.buildmanager.iterateReap(self.getState(), 0)
=== modified file 'lpbuildd/tests/test_translationtemplatesbuildmanager.py'
--- lpbuildd/tests/test_translationtemplatesbuildmanager.py 2019-02-11 12:22:42 +0000
+++ lpbuildd/tests/test_translationtemplatesbuildmanager.py 2019-02-12 10:42:04 +0000
@@ -17,7 +17,7 @@
RETCODE_FAILURE_BUILD,
RETCODE_FAILURE_INSTALL,
)
-from lpbuildd.tests.fakeslave import FakeSlave
+from lpbuildd.tests.fakebuilder import FakeBuilder
from lpbuildd.tests.matchers import HasWaitingFiles
from lpbuildd.translationtemplates import (
TranslationTemplatesBuildManager,
@@ -47,14 +47,14 @@
def setUp(self):
super(TestTranslationTemplatesBuildManagerIteration, self).setUp()
self.working_dir = self.useFixture(TempDir()).path
- slave_dir = os.path.join(self.working_dir, 'slave')
+ builder_dir = os.path.join(self.working_dir, 'builder')
home_dir = os.path.join(self.working_dir, 'home')
- for dir in (slave_dir, home_dir):
+ for dir in (builder_dir, home_dir):
os.mkdir(dir)
self.useFixture(EnvironmentVariable("HOME", home_dir))
- self.slave = FakeSlave(slave_dir)
+ self.builder = FakeBuilder(builder_dir)
self.buildid = '123'
- self.buildmanager = MockBuildManager(self.slave, self.buildid)
+ self.buildmanager = MockBuildManager(self.builder, self.buildid)
self.chrootdir = os.path.join(
home_dir, 'build-%s' % self.buildid, 'chroot-autobuild')
@@ -78,7 +78,7 @@
# directly before GENERATE.
self.buildmanager._state = TranslationTemplatesBuildState.UPDATE
- # GENERATE: Run the slave's payload, the script that generates
+ # GENERATE: Run the builder's payload, the script that generates
# templates.
yield self.buildmanager.iterate(0)
self.assertEqual(
@@ -93,7 +93,7 @@
self.assertEqual(expected_command, self.buildmanager.commands[-1])
self.assertEqual(
self.buildmanager.iterate, self.buildmanager.iterators[-1])
- self.assertFalse(self.slave.wasCalled('chrootFail'))
+ self.assertFalse(self.builder.wasCalled('chrootFail'))
outfile_path = os.path.join(
self.buildmanager.home, self.buildmanager._resultname)
@@ -112,8 +112,8 @@
self.assertEqual(expected_command, self.buildmanager.commands[-1])
self.assertNotEqual(
self.buildmanager.iterate, self.buildmanager.iterators[-1])
- self.assertFalse(self.slave.wasCalled('buildFail'))
- self.assertThat(self.slave, HasWaitingFiles.byEquality({
+ self.assertFalse(self.builder.wasCalled('buildFail'))
+ self.assertThat(self.builder, HasWaitingFiles.byEquality({
self.buildmanager._resultname: (
b'I am a template tarball. Seriously.'),
}))
@@ -130,7 +130,7 @@
self.assertEqual(expected_command, self.buildmanager.commands[-1])
self.assertEqual(
self.buildmanager.iterate, self.buildmanager.iterators[-1])
- self.assertFalse(self.slave.wasCalled('buildFail'))
+ self.assertFalse(self.builder.wasCalled('buildFail'))
@defer.inlineCallbacks
def test_iterate_fail_GENERATE_install(self):
@@ -157,7 +157,7 @@
self.assertEqual(expected_command, self.buildmanager.commands[-1])
self.assertNotEqual(
self.buildmanager.iterate, self.buildmanager.iterators[-1])
- self.assertTrue(self.slave.wasCalled('chrootFail'))
+ self.assertTrue(self.builder.wasCalled('chrootFail'))
# The buildmanager iterates to the UMOUNT state.
self.buildmanager.iterateReap(self.getState(), 0)
@@ -197,7 +197,7 @@
self.assertEqual(expected_command, self.buildmanager.commands[-1])
self.assertNotEqual(
self.buildmanager.iterate, self.buildmanager.iterators[-1])
- self.assertTrue(self.slave.wasCalled('buildFail'))
+ self.assertTrue(self.builder.wasCalled('buildFail'))
# The buildmanager iterates to the UMOUNT state.
self.buildmanager.iterateReap(self.getState(), 0)