From 3dab2706d42a93f7a615862d70be254313536616 Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Mon, 23 Apr 2012 13:16:25 -0400 Subject: [PATCH] Fix buildbot configuration Need to define our tests before they're called; also, can't blindly invoke a step out of the proper scope. Duh. Signed-off-by: Dan Scott --- examples/buildbot.cfg | 71 +++++++++++++++++++++++++++++++++---------- 1 file changed, 55 insertions(+), 16 deletions(-) diff --git a/examples/buildbot.cfg b/examples/buildbot.cfg index a29c4f8..9c5f503 100644 --- a/examples/buildbot.cfg +++ b/examples/buildbot.cfg @@ -129,6 +129,39 @@ c['schedulers'].append(SingleBranchScheduler(name="evergreen-master", "evergreen-master-ubuntu-10.04-x86" ])) +#### Build step tests +def eg_requires_autogen(step): + 'Old versions of Evergreen require autogen.sh to bootstrap' + if (step.build.getProperty('branch') == 'rel_2_0' or + step.build.getProperty('branch') == 'rel_2_1' + ): + return True + return False + +def eg_requires_autoreconf(step): + 'Modern versions of Evergreen use autoreconf to bootstrap' + if eg_requires_autogen(step): + return False + return True + +def has_perl_unit_tests(step): + 'Only run Perl tests if there are tests' + if (step.build.getProperty('branch') == 'rel_2_0'): + return False + return True + +def osrf_requires_autogen(step): + 'Old versions of OpenSRF require autogen.sh to bootstrap' + if (step.build.getProperty('branch') == 'rel_2_0'): + return True + return False + +def osrf_requires_autoreconf(step): + 'Modern versions of OpenSRF use autoreconf to bootstrap' + if osrf_requires_autogen(step): + return False + return True + ####### BUILDERS # The 'builders' list defines the Builders, which tell Buildbot how to perform a build: @@ -149,10 +182,17 @@ osrf_factory.addStep(source.Git( ) # bootstrap the code - old branches require autogen.sh -if (step.build.getProperty('branch') == 'rel_2_0'): - osrf_factory.addStep(shell.ShellCommand(command=["./autogen.sh"])) -else: - osrf_factory.addStep(shell.ShellCommand(command=["autoreconf -f -i"])) +osrf_factory.addStep( + shell.ShellCommand(command=["./autogen.sh"], + doStepIf=osrf_requires_autogen + ) +) + +osrf_factory.addStep( + shell.ShellCommand(command=["autoreconf -f -i"], + doStepIf=osrf_requires_autoreconf + ) +) # configure (default args for now) osrf_factory.addStep(shell.Configure()) @@ -201,12 +241,17 @@ eg_factory.addStep(source.Git( ) # bootstrap the code - old branches require autogen.sh -if (step.build.getProperty('branch') == 'rel_2_0' or - step.build.getProperty('branch') == 'rel_2_1' -): - eg_factory.addStep(shell.ShellCommand(command=["./autogen.sh"])) -else: - eg_factory.addStep(shell.ShellCommand(command=["autoreconf -f -i"])) +eg_factory.addStep( + shell.ShellCommand(command=["./autogen.sh"], + doStepIf=eg_requires_autogen + ) +) + +eg_factory.addStep( + shell.ShellCommand(command=["autoreconf -f -i"], + doStepIf=eg_requires_autoreconf + ) +) # configure (default args for now) eg_factory.addStep(shell.Configure()) @@ -220,12 +265,6 @@ class PerlModuleTestMFHDMadness(shell.PerlModuleTest): command = ['prove', '--lib', 'lib', '-I', 'lib/OpenILS/Utils/MFHD/test', '-r', 't'] total = 0 -def has_perl_unit_tests(step): - 'Only run Perl tests if there are tests' - if (step.build.getProperty('branch') == 'rel_2_0'): - return False - return True - # run the Perl unit tests eg_factory.addStep(PerlModuleTestMFHDMadness( doStepIf=has_perl_unit_tests, -- 2.43.2