From 0036d1e131d1b655c3ff032e4880d3e7e3cd87a0 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 19 Nov 2011 21:30:51 -0800 Subject: [PATCH] Custom builders for each OS type --- .gitignore | 8 ++++-- .../buildbot_config/master/builders.py | 27 ++++++++++++------- .../buildbot_config/master/schedulers.py | 8 +++--- test/buildbot/master/master.cfg | 2 +- 4 files changed, 30 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 55f0511b1..3e3642be6 100644 --- a/.gitignore +++ b/.gitignore @@ -11,11 +11,15 @@ test/buildbot/master/master.cfg.sample test/buildbot/master/twistd.log test/buildbot/master/twistd.pid test/buildbot/master/state.sqlite -test/buildbot/master/vagrant-*/ +test/buildbot/master/osx-*/ +test/buildbot/master/linux-*/ +test/buildbot/master/win-*/ test/buildbot/slave/twistd.hostname test/buildbot/slave/twistd.log test/buildbot/slave/twistd.pid -test/buildbot/slave/vagrant-*/ +test/buildbot/slave/osx-*/ +test/buildbot/slave/linux-*/ +test/buildbot/slave/win-*/ Vagrantfile .vagrant diff --git a/test/buildbot/buildbot_config/master/builders.py b/test/buildbot/buildbot_config/master/builders.py index e590de4c0..06642b92b 100644 --- a/test/buildbot/buildbot_config/master/builders.py +++ b/test/buildbot/buildbot_config/master/builders.py @@ -23,17 +23,26 @@ 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)) + platforms = ["linux", "osx", "win"] + builders = [] - acceptance = BuilderConfig( - name="vagrant-%s-acceptance" % branch, - slavenames=[s.slavename for s in slaves], - factory=make_vagrant_acceptance_factory(branch)) + for platform in platforms: + platform_slaves = [s.slavename for s in slaves if platform in s.slavename] - return [unit, acceptance] + if len(platform_slaves) > 0: + unit = BuilderConfig( + name="%s-%s-unit" % (platform, branch), + slavenames=platform_slaves, + factory=make_vagrant_unit_factory(branch)) + + acceptance = BuilderConfig( + name="%s-%s-acceptance" % (platform, branch), + slavenames=platform_slaves, + factory=make_vagrant_acceptance_factory(branch)) + + builders.extend([unit, acceptance]) + + return builders def make_vagrant_unit_factory(branch): """ diff --git a/test/buildbot/buildbot_config/master/schedulers.py b/test/buildbot/buildbot_config/master/schedulers.py index df03d6283..ef9e98861 100644 --- a/test/buildbot/buildbot_config/master/schedulers.py +++ b/test/buildbot/buildbot_config/master/schedulers.py @@ -8,15 +8,17 @@ from buildbot.schedulers.basic import ( Dependent, SingleBranchScheduler) -def get_schedulers(): +def get_schedulers(builders): # Run the unit tests for master + unit_builders = [b.name for b in builders if "unit" in b.name] master_unit = SingleBranchScheduler(name="master-unit", change_filter=ChangeFilter(branch="master"), treeStableTimer=60, - builderNames=["vagrant-master-unit"]) + builderNames=unit_builders) + acceptance_builders = [b.name for b in builders if "acceptance" in b.name] master_acceptance = Dependent(name="master-acceptance", upstream=master_unit, - builderNames=["vagrant-master-acceptance"]) + builderNames=acceptance_builders) return [master_unit, master_acceptance] diff --git a/test/buildbot/master/master.cfg b/test/buildbot/master/master.cfg index d0db4d7a1..a4733b954 100644 --- a/test/buildbot/master/master.cfg +++ b/test/buildbot/master/master.cfg @@ -63,5 +63,5 @@ c['slavePortnum'] = 9989 c['slaves'] = get_slaves_from_config(options.slaves) c['status'] = get_status(options) c['builders'] = get_builders(c['slaves']) -c['schedulers'] = get_schedulers() +c['schedulers'] = get_schedulers(c['builders']) c['change_source'] = get_change_sources()