From 3a1aa28f4fc713dab6f275b06c3e4243487a2ef1 Mon Sep 17 00:00:00 2001 From: Jonas Pommerening Date: Mon, 11 Aug 2014 12:41:57 +0200 Subject: [PATCH] Add missing codebase properties Also, sourcestamp['codebase'] is a string, not a dict. --- master/buildbot/schedulers/timed.py | 4 ++-- master/buildbot/test/unit/test_schedulers_timed_Nightly.py | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/master/buildbot/schedulers/timed.py b/master/buildbot/schedulers/timed.py index 5b62893c2a1..7fde2e203f2 100644 --- a/master/buildbot/schedulers/timed.py +++ b/master/buildbot/schedulers/timed.py @@ -270,7 +270,7 @@ def __init__(self, name, builderNames, minute=0, hour='*', codebases=base.BaseScheduler.DEFAULT_CODEBASES): if branch and branch is not Nightly.NoBranch: if codebases is base.BaseScheduler.DEFAULT_CODEBASES: - codebases = {'': {'repository': '', 'branch': branch}} + codebases = {'': {'repository': '', 'project': '', 'branch': branch, 'revision': ''}} else: config.error("Nightly(%s): 'codebases' and 'branch' are mutually exclusive" % name) NightlyBase.__init__(self, name=name, builderNames=builderNames, @@ -384,7 +384,7 @@ def startBuild(self): less_than=max_changeid + 1) else: # start a build of the latest revision, whatever that is - ss = {'codebase': self.getCodebaseDict('')} + ss = {'codebase': ''} yield self.addBuildsetForSourceStampsWithDefaults(reason=self.reason, sourcestamps=[ss]) diff --git a/master/buildbot/test/unit/test_schedulers_timed_Nightly.py b/master/buildbot/test/unit/test_schedulers_timed_Nightly.py index c08f4bd7d34..909f54ab21a 100644 --- a/master/buildbot/test/unit/test_schedulers_timed_Nightly.py +++ b/master/buildbot/test/unit/test_schedulers_timed_Nightly.py @@ -57,9 +57,10 @@ def addBuildsetForSourceStampsWithDefaults(reason, sourcestamps, self.assertIn('scheduler named', reason) isFirst = (self.events == []) - codebases = [ss['codebase'] for ss in sourcestamps] or [{}] # default codebase + codebases = [ss['codebase'] for ss in sourcestamps] or [''] # default codebase + codebase_dicts = map(sched.getCodebaseDict, codebases) - self.events.append('B(%s)@%d' % (''.join([str(cb.get('branch')) for cb in codebases]), + self.events.append('B(%s)@%d' % (''.join([str(cb.get('branch')) for cb in codebase_dicts]), # show the offset as seconds past the GMT hour self.clock.seconds() - self.localtime_offset)) if isFirst and firstBuildDuration: