launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #17014
[Merge] lp:~wgrant/launchpad/no-getBuildCookie into lp:launchpad
William Grant has proposed merging lp:~wgrant/launchpad/no-getBuildCookie into lp:launchpad with lp:~wgrant/launchpad/dispatchBuildToSlave-log-betterer as a prerequisite.
Commit message:
Move build cookie generation from BuildInteractor to IBuildFarmJob.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~wgrant/launchpad/no-getBuildCookie/+merge/224567
The build cookie is used to identify builds in logs and upload queues, so it's not just a property of the build while it's queued. This branch moves the generation from BuilderInteractor.getBuildCookie() to BuildFarmJobMixin.build_cookie, where it can be more cleanly used by code that has an IBuildQueue or an IBuildFarmJob. This is going to be helpful for adding consistency to logging through buildd-manager.
--
https://code.launchpad.net/~wgrant/launchpad/no-getBuildCookie/+merge/224567
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wgrant/launchpad/no-getBuildCookie into lp:launchpad.
=== modified file 'lib/lp/archiveuploader/tests/test_uploadprocessor.py'
--- lib/lp/archiveuploader/tests/test_uploadprocessor.py 2014-01-30 15:04:06 +0000
+++ lib/lp/archiveuploader/tests/test_uploadprocessor.py 2014-06-26 08:47:28 +0000
@@ -2096,7 +2096,7 @@
# Commit so the build cookie has the right ids.
self.layer.txn.commit()
behaviour = IBuildFarmJobBehaviour(build)
- leaf_name = behaviour.getUploadDirLeaf(behaviour.getBuildCookie())
+ leaf_name = behaviour.getUploadDirLeaf(build.build_cookie)
os.mkdir(os.path.join(self.incoming_folder, leaf_name))
self.options.context = 'buildd'
self.options.builds = True
@@ -2139,7 +2139,7 @@
# Commit so the build cookie has the right ids.
self.layer.txn.commit()
behaviour = IBuildFarmJobBehaviour(build)
- leaf_name = behaviour.getUploadDirLeaf(behaviour.getBuildCookie())
+ leaf_name = behaviour.getUploadDirLeaf(build.build_cookie)
upload_dir = self.queueUpload("bar_1.0-1_binary",
queue_entry=leaf_name)
self.options.context = 'buildd'
@@ -2167,7 +2167,7 @@
# Commit so the build cookie has the right ids.
self.layer.txn.commit()
behaviour = IBuildFarmJobBehaviour(build)
- leaf_name = behaviour.getUploadDirLeaf(behaviour.getBuildCookie())
+ leaf_name = behaviour.getUploadDirLeaf(build.build_cookie)
relative_path = "~%s/%s/%s/%s" % (
archive.owner.name, archive.name, self.breezy.distribution.name,
self.breezy.name)
@@ -2213,7 +2213,7 @@
# Commit so the build cookie has the right ids.
Store.of(build).flush()
behaviour = IBuildFarmJobBehaviour(build)
- leaf_name = behaviour.getUploadDirLeaf(behaviour.getBuildCookie())
+ leaf_name = behaviour.getUploadDirLeaf(build.build_cookie)
os.mkdir(os.path.join(self.incoming_folder, leaf_name))
self.options.context = 'buildd'
self.options.builds = True
@@ -2257,7 +2257,7 @@
# Commit so the build cookie has the right ids.
Store.of(build).flush()
behaviour = IBuildFarmJobBehaviour(build)
- leaf_name = behaviour.getUploadDirLeaf(behaviour.getBuildCookie())
+ leaf_name = behaviour.getUploadDirLeaf(build.build_cookie)
os.mkdir(os.path.join(self.incoming_folder, leaf_name))
self.options.context = 'buildd'
self.options.builds = True
@@ -2305,7 +2305,7 @@
# Commit so the build cookie has the right ids.
self.layer.txn.commit()
behaviour = IBuildFarmJobBehaviour(build)
- leaf_name = behaviour.getUploadDirLeaf(behaviour.getBuildCookie())
+ leaf_name = behaviour.getUploadDirLeaf(build.build_cookie)
upload_dir = self.queueUpload(
"bar_1.0-1_binary", queue_entry=leaf_name)
self.options.context = 'buildd'
=== modified file 'lib/lp/buildmaster/interfaces/buildfarmjob.py'
--- lib/lp/buildmaster/interfaces/buildfarmjob.py 2014-06-20 06:49:03 +0000
+++ lib/lp/buildmaster/interfaces/buildfarmjob.py 2014-06-26 08:47:28 +0000
@@ -168,6 +168,9 @@
vocabulary=BuildFarmJobType,
description=_("The specific type of job."))
+ build_cookie = Attribute(
+ "A string which uniquely identifies the job in the build farm.")
+
failure_count = Int(
title=_("Failure Count"), required=False, readonly=True,
default=0,
=== modified file 'lib/lp/buildmaster/interfaces/buildfarmjobbehaviour.py'
--- lib/lp/buildmaster/interfaces/buildfarmjobbehaviour.py 2014-06-26 08:47:27 +0000
+++ lib/lp/buildmaster/interfaces/buildfarmjobbehaviour.py 2014-06-26 08:47:28 +0000
@@ -38,9 +38,6 @@
:param logger: A logger to be used to log diagnostic information.
"""
- def getBuildCookie():
- """Return a string which uniquely identifies the job."""
-
def verifySuccessfulBuild():
"""Check that we are allowed to collect this successful build."""
=== modified file 'lib/lp/buildmaster/interfaces/buildqueue.py'
--- lib/lp/buildmaster/interfaces/buildqueue.py 2014-06-20 06:14:09 +0000
+++ lib/lp/buildmaster/interfaces/buildqueue.py 2014-06-26 08:47:28 +0000
@@ -109,6 +109,9 @@
IBuildFarmJob, title=_("Build farm job"),
description=_("Concrete build farm job object."))
+ build_cookie = Attribute(
+ "A string which uniquely identifies the job in the build farm.")
+
date_started = Datetime(
title=_('Start time'),
description=_('Time when the job started.'))
=== modified file 'lib/lp/buildmaster/manager.py'
--- lib/lp/buildmaster/manager.py 2014-06-24 09:46:36 +0000
+++ lib/lp/buildmaster/manager.py 2014-06-26 08:47:28 +0000
@@ -387,10 +387,7 @@
"""
if vitals.build_queue != self._cached_build_queue:
if vitals.build_queue is not None:
- behaviour = self.behaviour_factory(
- vitals.build_queue, self.builder_factory[vitals.name],
- None)
- self._cached_build_cookie = behaviour.getBuildCookie()
+ self._cached_build_cookie = vitals.build_queue.build_cookie
else:
self._cached_build_cookie = None
self._cached_build_queue = vitals.build_queue
@@ -440,8 +437,8 @@
# requeue the job. The next scan cycle will clean up the
# slave if appropriate.
self.logger.warn(
- "%s. Resetting BuildQueue %d.", lost_reason,
- vitals.build_queue.id)
+ "%s. Resetting job %s.", lost_reason,
+ vitals.build_queue.build_cookie)
vitals.build_queue.reset()
transaction.commit()
return
=== modified file 'lib/lp/buildmaster/model/buildfarmjob.py'
--- lib/lp/buildmaster/model/buildfarmjob.py 2013-11-28 05:13:37 +0000
+++ lib/lp/buildmaster/model/buildfarmjob.py 2014-06-26 08:47:28 +0000
@@ -147,6 +147,11 @@
BuildStatus.UPLOADING,
BuildStatus.SUPERSEDED]
+ @property
+ def build_cookie(self):
+ """See `IBuildFarmJob`."""
+ return '%s-%s' % (self.job_type.name, self.id)
+
def setLog(self, log):
"""See `IBuildFarmJob`."""
self.log = log
=== modified file 'lib/lp/buildmaster/model/buildfarmjobbehaviour.py'
--- lib/lp/buildmaster/model/buildfarmjobbehaviour.py 2014-06-26 08:47:27 +0000
+++ lib/lp/buildmaster/model/buildfarmjobbehaviour.py 2014-06-26 08:47:28 +0000
@@ -66,14 +66,10 @@
"""The default behaviour is a no-op."""
pass
- def getBuildCookie(self):
- """See `IPackageBuild`."""
- return '%s-%s' % (self.build.job_type.name, self.build.id)
-
@defer.inlineCallbacks
def dispatchBuildToSlave(self, logger):
"""See `IBuildFarmJobBehaviour`."""
- cookie = self.getBuildCookie()
+ cookie = self.build.build_cookie
logger.info(
"Preparing job %s (%s) on %s."
% (cookie, self.build.title, self._builder.url))
@@ -216,7 +212,7 @@
return
logger.info(
'Processing finished %s build %s (%s) from builder %s'
- % (status, self.getBuildCookie(),
+ % (status, self.build.build_cookie,
self.build.buildqueue_record.specific_build.title,
self.build.buildqueue_record.builder.name))
d = method(slave_status, logger, notify)
@@ -249,7 +245,7 @@
root = os.path.abspath(config.builddmaster.root)
# Create a single directory to store build result files.
- upload_leaf = self.getUploadDirLeaf(self.getBuildCookie())
+ upload_leaf = self.getUploadDirLeaf(self.build.build_cookie)
grab_dir = os.path.join(root, "grabbing", upload_leaf)
logger.debug("Storing build result at '%s'" % grab_dir)
=== modified file 'lib/lp/buildmaster/model/buildqueue.py'
--- lib/lp/buildmaster/model/buildqueue.py 2014-06-23 10:07:18 +0000
+++ lib/lp/buildmaster/model/buildqueue.py 2014-06-26 08:47:28 +0000
@@ -39,9 +39,7 @@
BuildQueueStatus,
BuildStatus,
)
-from lp.buildmaster.interfaces.buildfarmjob import (
- ISpecificBuildFarmJobSource,
- )
+from lp.buildmaster.interfaces.buildfarmjob import ISpecificBuildFarmJobSource
from lp.buildmaster.interfaces.buildqueue import (
IBuildQueue,
IBuildQueueSet,
@@ -117,6 +115,11 @@
specific_source = specific_build_farm_job_sources()[bfj.job_type]
return specific_source.getByBuildFarmJob(bfj)
+ @property
+ def build_cookie(self):
+ """See `IBuildQueue`."""
+ return self.specific_build.build_cookie
+
def _clear_specific_build_cache(self):
del get_property_cache(self).specific_build
=== modified file 'lib/lp/buildmaster/tests/mock_slaves.py'
--- lib/lp/buildmaster/tests/mock_slaves.py 2014-06-26 08:47:27 +0000
+++ lib/lp/buildmaster/tests/mock_slaves.py 2014-06-26 08:47:28 +0000
@@ -259,9 +259,7 @@
class TrivialBehaviour:
-
- def getBuildCookie(self):
- return 'trivial'
+ pass
class DeadProxy(xmlrpc.Proxy):
=== modified file 'lib/lp/buildmaster/tests/test_buildfarmjobbehaviour.py'
--- lib/lp/buildmaster/tests/test_buildfarmjobbehaviour.py 2014-06-26 08:47:27 +0000
+++ lib/lp/buildmaster/tests/test_buildfarmjobbehaviour.py 2014-06-26 08:47:28 +0000
@@ -17,10 +17,7 @@
from zope.security.proxy import removeSecurityProxy
from lp.archiveuploader.uploadprocessor import parse_build_upload_leaf_name
-from lp.buildmaster.enums import (
- BuildFarmJobType,
- BuildStatus,
- )
+from lp.buildmaster.enums import BuildStatus
from lp.buildmaster.interactor import BuilderInteractor
from lp.buildmaster.interfaces.buildfarmjobbehaviour import (
IBuildFarmJobBehaviour,
@@ -53,8 +50,7 @@
class FakeBuildFarmJob:
"""Dummy BuildFarmJob."""
- id = 1
- job_type = BuildFarmJobType.PACKAGEBUILD
+ build_cookie = 'PACKAGEBUILD-1'
title = 'some job for something'
@@ -106,13 +102,6 @@
return spr.createBuild(
distroarchseries=distroarchseries, pocket=pocket, archive=archive)
- def test_getBuildCookie(self):
- build = self.factory.makeTranslationTemplatesBuild()
- behaviour = self._makeBehaviour(build)
- self.assertEqual(
- '%s-%s' % (build.job_type.name, build.id),
- behaviour.getBuildCookie())
-
def test_getUploadDirLeaf(self):
# getUploadDirLeaf returns the current time, followed by the build
# cookie.
@@ -194,8 +183,7 @@
def test_getUploadDirLeafCookie_parseable(self):
# getUploadDirLeaf should return a directory name
# that is parseable by the upload processor.
- upload_leaf = self.behaviour.getUploadDirLeaf(
- self.behaviour.getBuildCookie())
+ upload_leaf = self.behaviour.getUploadDirLeaf(self.build.build_cookie)
(job_type, job_id) = parse_build_upload_leaf_name(upload_leaf)
self.assertEqual(
(self.build.job_type.name, self.build.id), (job_type, job_id))
=== modified file 'lib/lp/buildmaster/tests/test_interactor.py'
--- lib/lp/buildmaster/tests/test_interactor.py 2014-06-26 08:47:27 +0000
+++ lib/lp/buildmaster/tests/test_interactor.py 2014-06-26 08:47:28 +0000
@@ -72,8 +72,8 @@
class FakeBuildQueue:
- def __init__(self):
- self.id = 1
+ def __init__(self, cookie='PACKAGEBUILD-1'):
+ self.build_cookie = cookie
self.reset = FakeMethod()
self.status = BuildQueueStatus.RUNNING
=== modified file 'lib/lp/buildmaster/tests/test_manager.py'
--- lib/lp/buildmaster/tests/test_manager.py 2014-06-24 09:46:36 +0000
+++ lib/lp/buildmaster/tests/test_manager.py 2014-06-26 08:47:28 +0000
@@ -40,9 +40,6 @@
BuildSlaveFailure,
IBuilderSet,
)
-from lp.buildmaster.interfaces.buildfarmjobbehaviour import (
- IBuildFarmJobBehaviour,
- )
from lp.buildmaster.interfaces.buildqueue import IBuildQueueSet
from lp.buildmaster.manager import (
BuilddManager,
@@ -530,8 +527,7 @@
transaction.commit()
login(ANONYMOUS)
buildqueue = builder.currentjob
- behaviour = IBuildFarmJobBehaviour(buildqueue.specific_build)
- slave.build_id = behaviour.getBuildCookie()
+ slave.build_id = buildqueue.build_cookie
self.assertBuildingJob(buildqueue, builder)
# Now set the build to CANCELLING.
@@ -621,8 +617,7 @@
# build() has been called, so switch in a BUILDING slave.
# Scans will now just do a status() each, as the logtail is
# updated.
- get_slave.result = BuildingSlave(
- IBuildFarmJobBehaviour(build).getBuildCookie())
+ get_slave.result = BuildingSlave(build.build_cookie)
yield scanner.scan()
self.assertEqual("This is a build log: 0", bq.logtail)
yield scanner.scan()
@@ -637,8 +632,7 @@
# _handleStatus_OK doesn't do anything special, but there'd
# usually be file retrievals in the middle. The builder remains
# dirty afterward.
- get_slave.result = WaitingSlave(
- build_id=IBuildFarmJobBehaviour(build).getBuildCookie())
+ get_slave.result = WaitingSlave(build_id=build.build_cookie)
yield scanner.scan()
self.assertEqual(['status', 'clean'], get_slave.result.method_log)
self.assertIs(None, builder.currentjob)
@@ -769,7 +763,7 @@
def test_scan_with_job(self):
# SlaveScanner.scan calls updateBuild() when a job is building.
slave = BuildingSlave('trivial')
- bq = FakeBuildQueue()
+ bq = FakeBuildQueue('trivial')
scanner = self.getScanner(
builder_factory=MockBuilderFactory(MockBuilder(), bq),
slave=slave)
@@ -785,7 +779,7 @@
# SlaveScanner.scan identifies slaves that aren't building what
# they should be, resets the jobs, and then aborts the slaves.
slave = BuildingSlave('nontrivial')
- bq = FakeBuildQueue()
+ bq = FakeBuildQueue('trivial')
builder = MockBuilder(virtualized=False)
scanner = self.getScanner(
builder_factory=MockBuilderFactory(builder, bq),
@@ -848,41 +842,31 @@
self.assertEqual(['status'], slave.call_log)
def test_getExpectedCookie_caches(self):
- bf = MockBuilderFactory(MockBuilder(), FakeBuildQueue())
+ bq = FakeBuildQueue('trivial')
+ bf = MockBuilderFactory(MockBuilder(), bq)
scanner = SlaveScanner(
'mock', bf, BufferLogger(), interactor_factory=FakeMethod(None),
slave_factory=FakeMethod(None),
behaviour_factory=FakeMethod(TrivialBehaviour()))
- def assertCounts(expected):
- self.assertEqual(
- expected,
- (scanner.interactor_factory.call_count,
- scanner.behaviour_factory.call_count,
- scanner.builder_factory.get_call_count))
-
- # The first call will get a Builder and a BuildFarmJobBehaviour.
- assertCounts((0, 0, 0))
+ # The first call retrieves the cookie from the BuildQueue.
cookie1 = scanner.getExpectedCookie(bf.getVitals('foo'))
self.assertEqual('trivial', cookie1)
- assertCounts((0, 1, 1))
- # A second call with the same BuildQueue will not reretrieve them.
+ # A second call with the same BuildQueue will not reretrieve it.
+ bq.build_cookie = 'nontrivial'
cookie2 = scanner.getExpectedCookie(bf.getVitals('foo'))
- self.assertEqual(cookie1, cookie2)
- assertCounts((0, 1, 1))
+ self.assertEqual('trivial', cookie2)
# But a call with a new BuildQueue will regrab.
- bf.updateTestData(bf._builder, FakeBuildQueue())
+ bf.updateTestData(bf._builder, FakeBuildQueue('complicated'))
cookie3 = scanner.getExpectedCookie(bf.getVitals('foo'))
- self.assertEqual(cookie1, cookie3)
- assertCounts((0, 2, 2))
+ self.assertEqual('complicated', cookie3)
# And unsetting the BuildQueue returns None again.
bf.updateTestData(bf._builder, None)
cookie4 = scanner.getExpectedCookie(bf.getVitals('foo'))
self.assertIs(None, cookie4)
- assertCounts((0, 2, 2))
class TestJudgeFailure(TestCase):
=== modified file 'lib/lp/code/model/tests/test_recipebuilder.py'
--- lib/lp/code/model/tests/test_recipebuilder.py 2014-06-26 08:47:27 +0000
+++ lib/lp/code/model/tests/test_recipebuilder.py 2014-06-26 08:47:28 +0000
@@ -124,15 +124,6 @@
AssertionError, job.verifyBuildRequest, BufferLogger())
self.assertIn('invalid pocket due to the series status of', str(e))
- def test_getBuildCookie(self):
- # A build cookie is made up of the job type and record id.
- # The uploadprocessor relies on this format.
- build = self.factory.makeSourcePackageRecipeBuild()
- job = IBuildFarmJobBehaviour(build)
- cookie = removeSecurityProxy(job).getBuildCookie()
- expected_cookie = "RECIPEBRANCHBUILD-%d" % build.id
- self.assertEquals(expected_cookie, cookie)
-
def _setBuilderConfig(self):
"""Setup a temporary builder config."""
self.pushConfig(
=== modified file 'lib/lp/code/model/tests/test_sourcepackagerecipebuild.py'
--- lib/lp/code/model/tests/test_sourcepackagerecipebuild.py 2013-11-21 03:42:38 +0000
+++ lib/lp/code/model/tests/test_sourcepackagerecipebuild.py 2014-06-26 08:47:28 +0000
@@ -177,6 +177,11 @@
date_finished=cur_date + timedelta(minutes=minutes))
self.assertEqual(timedelta(minutes=5), spb.estimateDuration())
+ def test_build_cookie(self):
+ build = self.factory.makeSourcePackageRecipeBuild()
+ self.assertEqual(
+ 'RECIPEBRANCHBUILD-%d' % build.id, build.build_cookie)
+
def test_getFileByName(self):
"""getFileByName returns the logs when requested by name."""
spb = self.factory.makeSourcePackageRecipeBuild()
=== modified file 'lib/lp/soyuz/tests/test_binarypackagebuild.py'
--- lib/lp/soyuz/tests/test_binarypackagebuild.py 2013-12-04 07:07:04 +0000
+++ lib/lp/soyuz/tests/test_binarypackagebuild.py 2014-06-26 08:47:28 +0000
@@ -104,6 +104,10 @@
self.create_previous_build(335)
self.assertEqual(335, self.build.estimateDuration().seconds)
+ def test_build_cookie(self):
+ build = self.factory.makeBinaryPackageBuild()
+ self.assertEqual('PACKAGEBUILD-%d' % build.id, build.build_cookie)
+
def addFakeBuildLog(self, build):
build.setLog(self.factory.makeLibraryFileAlias('mybuildlog.txt'))
=== modified file 'lib/lp/soyuz/tests/test_binarypackagebuildbehaviour.py'
--- lib/lp/soyuz/tests/test_binarypackagebuildbehaviour.py 2014-06-26 08:47:27 +0000
+++ lib/lp/soyuz/tests/test_binarypackagebuildbehaviour.py 2014-06-26 08:47:28 +0000
@@ -104,7 +104,6 @@
in order to trick the slave into building correctly.
:return: A list of the calls we expect to be made.
"""
- cookie = IBuildFarmJobBehaviour(build).getBuildCookie()
ds_name = build.distro_arch_series.distroseries.name
suite = ds_name + pocketsuffix[build.pocket]
archives = get_sources_list_for_building(
@@ -133,8 +132,8 @@
'suite': suite,
}
build_log = [
- ('build', cookie, 'binarypackage', chroot.content.sha1,
- filemap_names, extra_args)]
+ ('build', build.build_cookie, 'binarypackage',
+ chroot.content.sha1, filemap_names, extra_args)]
result = upload_logs + build_log
return result
@@ -317,15 +316,6 @@
CannotBuild, behaviour.verifyBuildRequest, BufferLogger())
self.assertIn("Missing CHROOT", str(e))
- def test_getBuildCookie(self):
- # A build cookie is made up of the job type and record id.
- # The uploadprocessor relies on this format.
- build = self.factory.makeBinaryPackageBuild()
- behaviour = IBuildFarmJobBehaviour(build)
- cookie = removeSecurityProxy(behaviour).getBuildCookie()
- expected_cookie = "PACKAGEBUILD-%d" % build.id
- self.assertEqual(expected_cookie, cookie)
-
class TestBinaryBuildPackageBehaviourBuildCollection(TestCaseWithFactory):
"""Tests for the BinaryPackageBuildBehaviour.
=== modified file 'lib/lp/soyuz/tests/test_livefsbuild.py'
--- lib/lp/soyuz/tests/test_livefsbuild.py 2014-06-17 11:01:51 +0000
+++ lib/lp/soyuz/tests/test_livefsbuild.py 2014-06-26 08:47:28 +0000
@@ -186,6 +186,10 @@
duration=timedelta(seconds=20))
self.assertEqual(335, self.build.estimateDuration().seconds)
+ def test_build_cookie(self):
+ build = self.factory.makeLiveFSBuild()
+ self.assertEqual('LIVEFSBUILD-%d' % build.id, build.build_cookie)
+
def test_getFileByName_logs(self):
# getFileByName returns the logs when requested by name.
self.build.setLog(
=== modified file 'lib/lp/soyuz/tests/test_livefsbuildbehaviour.py'
--- lib/lp/soyuz/tests/test_livefsbuildbehaviour.py 2014-06-26 08:47:27 +0000
+++ lib/lp/soyuz/tests/test_livefsbuildbehaviour.py 2014-06-26 08:47:28 +0000
@@ -160,13 +160,6 @@
e = self.assertRaises(CannotBuild, job.verifyBuildRequest, logger)
self.assertIn("Missing chroot", str(e))
- def test_getBuildCookie(self):
- # A build cookie is made up of the job type and record id. The
- # uploadprocessor relies on this format.
- job = self.makeJob()
- cookie = removeSecurityProxy(job).getBuildCookie()
- self.assertEqual("LIVEFSBUILD-%s" % job.build.id, cookie)
-
def test_extraBuildArgs(self):
# _extraBuildArgs returns a reasonable set of additional arguments.
job = self.makeJob(
=== modified file 'lib/lp/translations/model/translationtemplatesbuildbehaviour.py'
--- lib/lp/translations/model/translationtemplatesbuildbehaviour.py 2014-06-26 08:47:27 +0000
+++ lib/lp/translations/model/translationtemplatesbuildbehaviour.py 2014-06-26 08:47:28 +0000
@@ -104,7 +104,7 @@
logger = logging.getLogger(BUILDD_MANAGER_LOG_NAME)
logger.info(
"Processing finished %s build %s (%s) from builder %s" % (
- status, self.getBuildCookie(),
+ status, self.build.build_cookie,
queue_item.specific_build.branch.bzr_identity,
queue_item.builder.name))
=== modified file 'lib/lp/translations/tests/test_translationtemplatesbuild.py'
--- lib/lp/translations/tests/test_translationtemplatesbuild.py 2014-01-30 15:04:06 +0000
+++ lib/lp/translations/tests/test_translationtemplatesbuild.py 2014-06-26 08:47:28 +0000
@@ -131,6 +131,11 @@
build = self.factory.makeTranslationTemplatesBuild()
self.assertEqual(2510, build.calculateScore())
+ def test_build_cookie(self):
+ build = self.factory.makeTranslationTemplatesBuild()
+ self.assertEqual(
+ 'TRANSLATIONTEMPLATESBUILD-%d' % build.id, build.build_cookie)
+
def test_generatesTemplates(self):
# A branch "generates templates" if it is a translation branch
# for a productseries that imports templates from it; is not
Follow ups