[Buildbot-devel] Test failures with 0.7.4

Brian Warner warner-buildbot at lothar.com
Sun Oct 1 08:08:50 UTC 2006


> Most of the errors appear to be associated with mail parsing. Perhaps the 
> problem is the version of Twisted that I'm using, or something I don't have 
> installed correctly?

The test_slavecommand, test_maildir, and test_mailparse failures are the
result of that setup.py bug which didn't install the auxilliary datafiles
(like buildbot/test/mail/*) into /usr/local/lib (or whatever you set --prefix
to) when it installed everything else. If you run the test from your source
directory where you unpacked the tarball, those tests ought to pass. This
setup.py bug is fixed in CVS, and I've attached the patch which fixed it
below if you'd like to try it against 0.7.4 .

That leaves the test_scheduler failure:

  File "/usr/local/lib/python2.4/site-packages/buildbot/test/test_scheduler.py", line 58, in testNightly
    self.failUnlessEqual(int(t-now), 2*HOUR+54*MIN+24)
twisted.trial.unittest.FailTest: 6864 != 10464

I suspect this is a timezone issue, since the difference between those two
values is 3600 seconds (one hour). There have been some other reports of this
kind of test failure, mostly from places that have just switched to daylight
savings. I seem to remember that the most immediately obvious fix (which
involved fiddling with the last part of the tuple you pass to time.mktime,
the bit that controls whether we're in DST or not) gave me failures on
certain systems or versions of python. I couldn't find a value that would
work in both environments.

What timezone+DST are you in? What happens if you change test_scheduler.py:55
to read:
        now = time.mktime((2005, 11, 15, 0, 5, 36, 1, 319, 1))
or:
        now = time.mktime((2005, 11, 15, 0, 5, 36, 1, 319, -1))


FYI, there's an open bug on this issue, SF#1530139. I'll see if I can find my
notes.. maybe I only tried tz=0 and tz=1, not tz=-1.

thanks,
 -Brian

-------------- next part --------------
Mon Sep 25 01:11:30 PDT 2006  warner at lothar.com
  * add the extra stuff from buildbot/test/* so unit tests will run on installed copies, not just in the source tree
diff -rN -u old-tinderbox/ChangeLog new-tinderbox/ChangeLog
--- old-tinderbox/ChangeLog	2006-10-01 01:07:19.000000000 -0700
+++ new-tinderbox/ChangeLog	2006-10-01 01:07:19.000000000 -0700
@@ -2,6 +2,9 @@
 
 	* setup.py: the new buildbot.steps module wasn't being installed.
 	Thanks to Jose Dapena Paz for the catch, fixes SF#1560631.
+	(testmsgs): add the extra stuff from buildbot/test/* so you can
+	run unit tests on an installed copy of buildbot, not just from
+	the source tree.
 
 	* contrib/svn_buildbot.py (ChangeSender.getChanges): the first *4*
 	columns of 'svnlook changed' output contain status information, so
diff -rN -u old-tinderbox/setup.py new-tinderbox/setup.py
--- old-tinderbox/setup.py	2006-10-01 01:07:19.000000000 -0700
+++ new-tinderbox/setup.py	2006-10-01 01:07:19.000000000 -0700
@@ -1,6 +1,6 @@
 #! /usr/bin/python
 
-import sys
+import sys, os
 from distutils.core import setup
 from buildbot import version
 
@@ -37,6 +37,12 @@
     scripts.append("contrib/windows/buildbot.bat")
     scripts.append("contrib/windows/buildbot_service.py")
 
+testmsgs = []
+for f in os.listdir("buildbot/test/mail"):
+    if f.endswith("~"):
+        continue
+    testmsgs.append("buildbot/test/mail/%s" % f)
+
 setup(name="buildbot",
       version=version,
       description="BuildBot build automation system",
@@ -65,11 +71,14 @@
                 "buildbot.slave",
                 "buildbot.scripts",
                 "buildbot.test",
+                "buildbot.test.subdir",
                 ],
       data_files=[("buildbot", ["buildbot/buildbot.png"]),
                   ("buildbot/clients", ["buildbot/clients/debug.glade"]),
                   ("buildbot/status", ["buildbot/status/classic.css"]),
-                  ("buildbot/scripts", ["buildbot/scripts/sample.cfg"]),],
+                  ("buildbot/scripts", ["buildbot/scripts/sample.cfg"]),
+                  ("buildbot/test/mail", testmsgs),
+                  ],
       scripts = scripts,
       cmdclass={'install_data': install_data_twisted},
       )



More information about the devel mailing list