[Buildbot-commits] buildbot/buildbot/test test_twisted.py,1.2,1.3
Brian Warner
warner at users.sourceforge.net
Fri Oct 15 18:44:21 UTC 2004
Update of /cvsroot/buildbot/buildbot/buildbot/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31334/buildbot/test
Modified Files:
test_twisted.py
Log Message:
* buildbot/process/step_twisted.py (Trial.createSummary): parse
the 'problems' portion of stdout, add TestResults to our build
* buildbot/test/test_twisted.py (Parse.testParse): test it
Index: test_twisted.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_twisted.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- test_twisted.py 10 Jul 2004 23:10:27 -0000 1.2
+++ test_twisted.py 15 Oct 2004 18:44:18 -0000 1.3
@@ -2,7 +2,8 @@
from twisted.trial import unittest
-from buildbot.process.step_twisted import countFailedTests
+from buildbot.process.step_twisted import countFailedTests, Trial
+from buildbot.status import builder
noisy = 0
if noisy:
@@ -45,8 +46,60 @@
unparseable
"""
+out6 = """
+===============================================================================
+SKIPPED: testProtocolLocalhost (twisted.flow.test.test_flow.FlowTest)
+-------------------------------------------------------------------------------
+XXX freezes, fixme
+===============================================================================
+SKIPPED: testIPv6 (twisted.names.test.test_names.HostsTestCase)
+-------------------------------------------------------------------------------
+IPv6 support is not in our hosts resolver yet
+===============================================================================
+EXPECTED FAILURE: testSlots (twisted.test.test_rebuild.NewStyleTestCase)
+-------------------------------------------------------------------------------
+Traceback (most recent call last):
+ File "/Users/buildbot/Buildbot/twisted/OSX-full2.3/Twisted/twisted/trial/unittest.py", line 240, in _runPhase
+ stage(*args, **kwargs)
+ File "/Users/buildbot/Buildbot/twisted/OSX-full2.3/Twisted/twisted/trial/unittest.py", line 262, in _main
+ self.runner(self.method)
+ File "/Users/buildbot/Buildbot/twisted/OSX-full2.3/Twisted/twisted/trial/runner.py", line 95, in runTest
+ method()
+ File "/Users/buildbot/Buildbot/twisted/OSX-full2.3/Twisted/twisted/test/test_rebuild.py", line 130, in testSlots
+ rebuild.updateInstance(self.m.SlottedClass())
+ File "/Users/buildbot/Buildbot/twisted/OSX-full2.3/Twisted/twisted/python/rebuild.py", line 114, in updateInstance
+ self.__class__ = latestClass(self.__class__)
+TypeError: __class__ assignment: 'SlottedClass' object layout differs from 'SlottedClass'
+===============================================================================
+FAILURE: testBatchFile (twisted.conch.test.test_sftp.TestOurServerBatchFile)
+-------------------------------------------------------------------------------
+Traceback (most recent call last):
+ File "/Users/buildbot/Buildbot/twisted/OSX-full2.3/Twisted/twisted/trial/unittest.py", line 240, in _runPhase
+ stage(*args, **kwargs)
+ File "/Users/buildbot/Buildbot/twisted/OSX-full2.3/Twisted/twisted/trial/unittest.py", line 262, in _main
+ self.runner(self.method)
+ File "/Users/buildbot/Buildbot/twisted/OSX-full2.3/Twisted/twisted/trial/runner.py", line 95, in runTest
+ method()
+ File "/Users/buildbot/Buildbot/twisted/OSX-full2.3/Twisted/twisted/conch/test/test_sftp.py", line 450, in testBatchFile
+ self.failUnlessEqual(res[1:-2], ['testDirectory', 'testRemoveFile', 'testRenameFile', 'testfile1'])
+ File "/Users/buildbot/Buildbot/twisted/OSX-full2.3/Twisted/twisted/trial/unittest.py", line 115, in failUnlessEqual
+ raise FailTest, (msg or '%r != %r' % (first, second))
+FailTest: [] != ['testDirectory', 'testRemoveFile', 'testRenameFile', 'testfile1']
+-------------------------------------------------------------------------------
+Ran 1454 tests in 911.579s
+
+FAILED (failures=2, skips=49, expectedFailures=9)
+Exception exceptions.AttributeError: "'NoneType' object has no attribute 'StringIO'" in <bound method RemoteReference.__del__ of <twisted.spread.pb.RemoteReference instance at 0x27036c0>> ignored
+"""
-class Case1(unittest.TestCase):
+class MyTrial(Trial):
+ def addTestResult(self, testname, results, text, logs):
+ self.results.append((testname, results, text, logs))
+ def addCompleteLog(self, name, log):
+ pass
+
+
+class Count(unittest.TestCase):
def count(self, total, failures=0, errors=0,
expectedFailures=0, unexpectedSuccesses=0, skips=0):
@@ -71,3 +124,53 @@
self.assertEquals(count, self.count(total=None))
count = countFailedTests(out5)
self.assertEquals(count, self.count(total=None))
+
+class Parse(unittest.TestCase):
+ def testParse(self):
+ t = MyTrial(build=None, workdir=".", testpath=None, testChanges=True)
+ t.results = []
+ log = builder.LogFile(None)
+ log.addStdout(out6)
+ t.createSummary(log)
+
+ self.failUnlessEqual(len(t.results), 4)
+ r1, r2, r3, r4 = t.results
+ testname, results, text, logs = r1
+ self.failUnlessEqual(testname,
+ ("twisted", "flow", "test", "test_flow",
+ "FlowTest", "testProtocolLocalhost"))
+ self.failUnlessEqual(results, builder.SKIPPED)
+ self.failUnlessEqual(text, ['skipped'])
+ self.failUnless("XXX freezes, fixme" in logs)
+ self.failUnless(logs.startswith("SKIPPED:"))
+ self.failUnless(logs.endswith("fixme\n"))
+
+ testname, results, text, logs = r2
+ self.failUnlessEqual(testname,
+ ("twisted", "names", "test", "test_names",
+ "HostsTestCase", "testIPv6"))
+ self.failUnlessEqual(results, builder.SKIPPED)
+ self.failUnlessEqual(text, ['skipped'])
+ self.failUnless(logs.startswith("SKIPPED: testIPv6"))
+ self.failUnless(logs.endswith("IPv6 support is not in our hosts resolver yet\n"))
+
+ testname, results, text, logs = r3
+ self.failUnlessEqual(testname,
+ ("twisted", "test", "test_rebuild",
+ "NewStyleTestCase", "testSlots"))
+ self.failUnlessEqual(results, builder.SUCCESS)
+ self.failUnlessEqual(text, ['expected', 'failure'])
+ self.failUnless(logs.startswith("EXPECTED FAILURE: "))
+ self.failUnless("\nTraceback " in logs)
+ self.failUnless(logs.endswith("layout differs from 'SlottedClass'\n"))
+
+ testname, results, text, logs = r4
+ self.failUnlessEqual(testname,
+ ("twisted", "conch", "test", "test_sftp",
+ "TestOurServerBatchFile", "testBatchFile"))
+ self.failUnlessEqual(results, builder.FAILURE)
+ self.failUnlessEqual(text, ['failure'])
+ self.failUnless(logs.startswith("FAILURE: "))
+ self.failUnless("Traceback " in logs)
+ self.failUnless(logs.endswith("'testRenameFile', 'testfile1']\n"))
+
More information about the Commits
mailing list