[Buildbot-commits] buildbot/buildbot/test __init__.py,1.2,1.3 test_scheduler.py,1.9,1.10 test_vc.py,1.49,1.50 test_slavecommand.py,1.17,1.18

Brian Warner warner at users.sourceforge.net
Mon May 1 00:10:59 UTC 2006


Update of /cvsroot/buildbot/buildbot/buildbot/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9344/buildbot/test

Modified Files:
	__init__.py test_scheduler.py test_vc.py test_slavecommand.py 
Log Message:
Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-518
Creator:  Brian Warner <warner at lothar.com>

set LC_ALL=C, accomodate non-DNotify platforms in testTryJobdir

	* buildbot/test/test_vc.py (VCBase.runCommand): set $LC_ALL="C" to
	make sure child commands emit messages in english, so our regexps
	will match. Thanks to Nikaus Giger for identifying the problems.
	(VCBase._do_vctest_export_1): mode="export" is not responsible
	for setting the "got_revision" property, since in many cases it is
	not convenient to determine.
	(SVNSupport.capable): when running 'svn --version' to check for
	ra_local, we want error messages in english
	* buildbot/test/test_slavecommand.py 
	(ShellBase.testShellMissingCommand): set $LC_ALL="C" to get bash
	to emit the error message in english

	* buildbot/slave/commands.py (SourceBase.setup): stash a copy of
	the environment with $LC_ALL="C" so that Commands which need to
	parse the output of their child processes can obtain it in
	english.
	(SVN.parseGotRevision): call "svn info" afterwards instead of
	watching the output of the "svn update" or "svn checkout".
	(Darcs.parseGotRevision): use $LC_ALL="C" when running the command
	(Arch.parseGotRevision): same
	(Bazaar.parseGotRevision): same
	(Mercurial.parseGotRevision): same

	* buildbot/scripts/tryclient.py (SourceStampExtractor.dovc): set
	$LC_ALL="C" when running commands under 'buildbot try', too

	* buildbot/test/__init__.py: remove the global os.environ()
	setting, instead we do it just for the tests that run commands and
	need to parse their output.

	* buildbot/test/test_scheduler.py (Scheduling.testTryJobdir):
	remove the overly-short .timeout on this test, because non-DNotify
	platforms must fall back to polling which happens at 10 second
	intervals, so a 5 second timeout would never succeed.


Index: __init__.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/test/__init__.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- __init__.py	5 Apr 2006 18:10:36 -0000	1.2
+++ __init__.py	1 May 2006 00:10:57 -0000	1.3
@@ -1,4 +0,0 @@
-import os
-
-# We do not want to be bother with output in exotic languages!
-os.environ['LANG']='C'

Index: test_scheduler.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_scheduler.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- test_scheduler.py	27 Nov 2005 03:58:48 -0000	1.9
+++ test_scheduler.py	1 May 2006 00:10:57 -0000	1.10
@@ -249,8 +249,11 @@
         self.master.d = d = defer.Deferred()
         self.pushJob(jobdir_abs, job1)
         d.addCallback(self._testTryJobdir_1)
+        # N.B.: if we don't have DNotify, we poll every 10 seconds, so don't
+        # set a .timeout here shorter than that. TODO: make it possible to
+        # set the polling interval, so we can make it shorter.
         return maybeWait(d, 5)
-    testTryJobdir.timeout = 5
+
     def _testTryJobdir_1(self, bs):
         self.failUnlessEqual(bs.builderNames, ["a", "b"])
         self.failUnlessEqual(bs.source.branch, "branch1")

Index: test_slavecommand.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_slavecommand.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- test_slavecommand.py	20 Jul 2005 08:08:24 -0000	1.17
+++ test_slavecommand.py	1 May 2006 00:10:57 -0000	1.18
@@ -156,7 +156,9 @@
 
     def testShellMissingCommand(self):
         args = {'command': "/bin/EndWorldHungerAndMakePigsFly",
-                'workdir': '.', 'timeout': 10}
+                'workdir': '.', 'timeout': 10,
+                'env': {"LC_ALL": "C"},
+                }
         c = SlaveShellCommand(self.builder, None, args)
         d = c.start()
         d.addCallback(self._testShellMissingCommand_1)

Index: test_vc.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_vc.py,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- test_vc.py	24 Apr 2006 09:03:07 -0000	1.49
+++ test_vc.py	1 May 2006 00:10:57 -0000	1.50
@@ -322,8 +322,10 @@
         if type(command) not in (list, tuple):
             command = command.split(" ")
         #print "do %s" % command
+        env = os.environ.copy()
+        env['LC_ALL'] = "C"
         d = utils.getProcessOutputAndValue(command[0], command[1:],
-                                           env=os.environ, path=basedir)
+                                           env=env, path=basedir)
         def check((out, err, code)):
             #print
             #print "command: %s" % command
@@ -592,7 +594,8 @@
         self.shouldNotExist(self.workdir, self.metadir)
         self.shouldNotExist(self.workdir, "newfile")
         self.failUnlessEqual(bs.getProperty("revision"), None)
-        self.checkGotRevisionIsLatest(bs)
+        #self.checkGotRevisionIsLatest(bs)
+        # VC 'export' is not required to have a got_revision
         self.touch(self.workdir, "newfile")
 
         d = self.doBuild() # export rebuild clobbers new files
@@ -602,7 +605,8 @@
         self.shouldNotExist(self.workdir, self.metadir)
         self.shouldNotExist(self.workdir, "newfile")
         self.failUnlessEqual(bs.getProperty("revision"), None)
-        self.checkGotRevisionIsLatest(bs)
+        #self.checkGotRevisionIsLatest(bs)
+        # VC 'export' is not required to have a got_revision
 
     def do_patch(self):
         vctype = self.vctype
@@ -1093,8 +1097,10 @@
                 # we need svn to be compiled with the ra_local access
                 # module
                 log.msg("running svn --version..")
+                env = os.environ.copy()
+                env['LC_ALL'] = "C"
                 d = utils.getProcessOutput(svnpaths[0], ["--version"],
-                                           env=os.environ)
+                                           env=env)
                 d.addCallback(self._capable, svnpaths[0], svnadminpaths[0])
                 return d
         if not VCS["svn"]:
@@ -1109,8 +1115,7 @@
             self.svnadmin = svnadmin
         else:
             log.msg(("%s found but it does not support 'file:' " +
-                     "schema, skipping svn tests") %
-                    os.path.join(p, "svn"))
+                     "schema, skipping svn tests") % vcexe)
             VCS['svn'] = None
             raise unittest.SkipTest("Found SVN, but it can't use file: schema")
 





More information about the Commits mailing list