Generalize the builder creation methods a bit to prepare for dependent builders

This commit is contained in:
Mitchell Hashimoto 2011-11-12 16:51:00 -08:00
parent 5d98c5cab7
commit b62d7c317c
2 changed files with 25 additions and 8 deletions

View File

@ -16,16 +16,31 @@ def get_builders(slaves):
This returns a list of builder configurations for the given
slaves.
"""
return get_vagrant_builders("master", slaves)
def get_vagrant_builders(branch, slaves):
"""
This returns a list of the builders that represent the entire
chain for a given branch (unit, acceptance, packaging builds).
"""
unit = BuilderConfig(
name="vagrant-%s-unit" % branch,
slavenames=[s.slavename for s in slaves],
factory=make_vagrant_unit_factory(branch))
return [unit]
def make_vagrant_unit_factory(branch):
"""
This returns the factory that runs the Vagrant unit tests.
"""
f = BuildFactory()
f.addStep(Git(repourl="git://github.com/mitchellh/vagrant.git",
branch=branch,
mode="full",
method="fresh",
shallow=True))
f.addStep(buildsteps.Bundler())
f.addStep(buildsteps.UnitTests())
return [BuilderConfig(
name="vagrant-master",
slavenames=[s.slavename for s in slaves],
factory=f)
]
return f

View File

@ -7,8 +7,10 @@ from buildbot.changes.filter import ChangeFilter
from buildbot.schedulers.basic import SingleBranchScheduler
def get_schedulers():
full = SingleBranchScheduler(name="full",
# Run the unit tests for master
master_unit = SingleBranchScheduler(name="full",
change_filter=ChangeFilter(branch="master"),
treeStableTimer=60,
builderNames=["vagrant-master"])
return [full]
builderNames=["vagrant-master-unit"])
return [master_unit]