[Buildbot-commits] buildbot/buildbot/steps shell.py, 1.19, 1.20 trigger.py, 1.3, 1.4

Brian Warner warner at users.sourceforge.net
Thu May 22 22:12:07 UTC 2008


Update of /cvsroot/buildbot/buildbot/buildbot/steps
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16868/buildbot/steps

Modified Files:
	shell.py trigger.py 
Log Message:
[project @ #87:customprops.patch]
Patch by Paul Gain, Roch Gadson <rochester.gadsdon at bakbone.com>, and
Aaron Maxwell <amax at snaplogic.org> to implement "custom properties":
build properties that can be specified when the build is initially
created, e.g., by a scheduler.

Original author: dustin at v.igoro.us
Date: 2008-04-04 03:52:33+00:00

Index: shell.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/steps/shell.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- shell.py	21 Mar 2008 04:25:31 -0000	1.19
+++ shell.py	22 May 2008 22:12:05 -0000	1.20
@@ -334,3 +334,66 @@
     description = ["testing"]
     descriptionDone = ["test"]
     command = ["make", "test"]
+
+class BKBSelectiveTest(Test):
+ 
+    name = "Test"
+    description = ["testing"]
+    descriptionDone = ["test"]
+    warnOnFailure = 1
+
+    # Overridden method simple to include test filtering information in the
+    # command that we run and to support supressing code coverage information
+    # to aid testing speed
+    def start(self):
+        extraenv = {}
+
+        #
+        # See if the NV_TEST_FILTER property has been set. If it has, we want
+        # to pass it in the enviroment to the build slave and adjust the
+        # description of this step to indicate which tests we are running
+        #
+        try:
+            extraenv['NV_TEST_FILTER'] = self.getProperty('NV_TEST_FILTER')
+            description = ["testing (" + self.getProperty('NV_TEST_FILTER') + ")"]
+            descriptionDone = ["test (" + self.getProperty('NV_TEST_FILTER') + ")"]
+        except:
+            # todo - how do we do nothing here?
+            self.command = self.command
+
+        # Now see if we've been asked to suppress code coverage processing.
+        # If we have, this again needs to get passed in the environment to the
+        # slave.
+        try:
+            if "TRUE" == self.getProperty('NV_SUPPRESS_COVERAGE_PROCESSING'):
+                extraenv['NV_SUPPRESS_COVERAGE_PROCESSING'] = "TRUE"
+        except:
+            # todo - how do we do nothing here?
+            self.command = self.command
+
+        # Combine any enviroment we want to set with any that was already
+        # specified
+        if self.remote_kwargs.has_key('env') != True:
+            self.remote_kwargs['env'] = {}
+
+        self.remote_kwargs['env'].update(extraenv)
+
+        # Invoke the base class to actually carry out the shell command
+        ShellCommand.start(self)
+
+    def describe(self, done=False):
+        filter = None
+        try:
+            filter = self.getProperty('NV_TEST_FILTER')
+        except:
+            filter = None
+
+        if done is True:
+            word = "test"
+        else:
+            word = "testing"
+
+        if None != filter:
+            return [ word + " (" + filter + ")" ]
+        else:
+            return [ word ]

Index: trigger.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/steps/trigger.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- trigger.py	21 Mar 2008 01:32:00 -0000	1.3
+++ trigger.py	22 May 2008 22:12:05 -0000	1.4
@@ -51,6 +51,7 @@
             self.step_status.setText(["interrupted"])
 
     def start(self):
+        custom_props = {}
         self.running = True
         ss = self.build.getSourceStamp()
         if self.updateSourceStamp:
@@ -61,6 +62,7 @@
                 pass
             if got:
                 ss = ss.getAbsoluteSourceStamp(got)
+        custom_props = self.build.getCustomProperties()
         # (is there an easier way to find the BuildMaster?)
         all_schedulers = self.build.builder.botmaster.parent.allSchedulers()
         all_schedulers = dict([(sch.name, sch) for sch in all_schedulers])
@@ -75,7 +77,7 @@
             if all_schedulers.has_key(scheduler):
                 sch = all_schedulers[scheduler]
                 if isinstance(sch, Triggerable):
-                    dl.append(sch.trigger(ss))
+                    dl.append(sch.trigger(ss, custom_props))
                     triggered_schedulers.append(scheduler)
                 else:
                     unknown_schedulers.append(scheduler)





More information about the Commits mailing list