[jhbuild] [bot] new options to enable/disable optional buildbot steps



commit 53996620e84ca23934c5f02a462f6ae56db8f963
Author: Frederic Peters <fpeters 0d be>
Date:   Tue May 5 21:03:21 2009 +0200

    [bot] new options to enable/disable optional buildbot steps
    
    The buildbot slave description can now hold three new elements
    under <config> to enable or disable steps (run_checks,
    run_coverage_report, run_clean_afterwards), set to "yes" to enable.
---
 jhbuild/buildbot/factory.py |   15 ++++++++++-----
 jhbuild/commands/bot.py     |   11 ++++++++++-
 2 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/jhbuild/buildbot/factory.py b/jhbuild/buildbot/factory.py
index b9fd886..2e35ec7 100644
--- a/jhbuild/buildbot/factory.py
+++ b/jhbuild/buildbot/factory.py
@@ -26,19 +26,24 @@ class JHBuildFactory(factory.BuildFactory):
     targets = []
     steps = []
 
-    def __init__(self, module):
+    def __init__(self, module, slave):
         factory.BuildFactory.__init__(self)
         self.moduleset = jhbuild_config.moduleset
         self.module = module
+        self.slave = slave
         self.getSteps()
 
     def getSteps(self):
         self.addStep(JHBuildSource, moduleset=self.moduleset, module=self.module)
         self.addStep(JHBuildCommand, stage='build', moduleset=self.moduleset, module=self.module)
-        self.addStep(JHBuildCheckCommand, moduleset=self.moduleset, module=self.module)
-#	self.addStep(JHBuildModulePathCommand, moduleset=self.moduleset, module=self.module, action='module-reports.sh', 
-#                     haltOnFailure = False, actionName='coverage')
-	self.addStep(JHBuildCommand, stage='clean', moduleset=self.moduleset, module=self.module)
+        if self.slave.run_checks:
+            self.addStep(JHBuildCheckCommand, moduleset=self.moduleset, module=self.module)
+        if self.slave.run_coverage_report:
+            self.addStep(JHBuildModulePathCommand, moduleset=self.moduleset,
+                    module=self.module, action='module-reports.sh')
+        if self.slave.run_clean_afterwards:
+            self.addStep(JHBuildCommand, stage='clean', moduleset=self.moduleset,
+                    module=self.module)
 
     def newBuild(self, request):
         return factory.BuildFactory.newBuild(self, request)
diff --git a/jhbuild/commands/bot.py b/jhbuild/commands/bot.py
index aa23e1d..b280fcd 100644
--- a/jhbuild/commands/bot.py
+++ b/jhbuild/commands/bot.py
@@ -268,6 +268,10 @@ class cmd_bot(Command):
 
             max_builds = 2
 
+            run_checks = True
+            run_coverage_report = False
+            run_clean_afterwards = False
+
             def load_extra_configuration(self, slaves_dir):
                 slave_xml_file = os.path.join(slaves_dir, self.slavename + '.xml')
                 if not os.path.exists(slave_xml_file):
@@ -278,6 +282,8 @@ class cmd_bot(Command):
                     return
 
                 for attribute in ('config/max_builds', 'config/missing_timeout',
+                            'config/run_checks', 'config/run_coverage_report',
+                            'config/run_clean_afterwards',
                             'info/contact_name', 'info/contact_email',
                             'info/url', 'info/distribution', 'info/architecture',
                             'info/version'):
@@ -293,6 +299,9 @@ class cmd_bot(Command):
                         except ValueError:
                             continue
 
+                    if attr_name in ('run_checks', 'run_coverage_report', 'run_clean_afterwards'):
+                        value = (value == 'yes')
+
                     setattr(self, attr_name, value)
 
         class JhBuildMaster(BuildMaster):
@@ -389,7 +398,7 @@ class cmd_bot(Command):
                 config['builders'] = []
                 for project in config['projects']:
                     for slave in config['slaves']:
-                        f = JHBuildFactory(project)
+                        f = JHBuildFactory(project, slave)
                         config['builders'].append({
                             'name' : "%s-%s" % (project, slave.slavename),
                             'slavename' : slave.slavename,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]