Ticket #228: 228.patch
| File 228.patch, 5.6 kB (added by dustin, 6 months ago) |
|---|
-
old-dustin/buildbot/process/factory.py
old new 4 4 from buildbot.process.base import Build 5 5 from buildbot.process.buildstep import BuildStep 6 6 from buildbot.steps.source import CVS, SVN 7 from buildbot.steps.shell import Configure, Compile, Test 7 from buildbot.steps.shell import Configure, Compile, Test, PerlModuleTest 8 8 9 9 # deprecated, use BuildFactory.addStep 10 10 def s(steptype, **kwargs): … … 81 81 BuildFactory.__init__(self, [source]) 82 82 self.addStep(Configure, command=[perl, "Makefile.PL"]) 83 83 self.addStep(Compile, command=["make"]) 84 self.addStep( Test, command=["make", "test"])84 self.addStep(PerlModuleTest, command=["make", "test"]) 85 85 86 86 class Distutils(BuildFactory): 87 87 def __init__(self, source, python="python", test=None): -
old-dustin/buildbot/status/web/waterfall.py
old new 110 110 number = b.getNumber() 111 111 url = path_to_build(req, b) 112 112 text = b.getText() 113 tests_failed = b.sumStepProperty('tests-failed') 114 if tests_failed: text.extend(["Failed tests: %d" % tests_failed]) 113 115 # TODO: maybe add logs? 114 116 # TODO: add link to the per-build page at 'url' 115 117 c = b.getColor() -
old-dustin/buildbot/steps/shell.py
old new 425 425 return [ word + " (" + filter + ")" ] 426 426 else: 427 427 return [ word ] 428 429 class PerlModuleTest(Test): 430 command=["prove", "--lib", "lib", "-r", "t"] 431 432 def evaluateCommand(self, cmd): 433 lines = self.getLog('stdio').readlines() 434 435 re_test_result = re.compile("^(All tests successful)|(\d+)/(\d+) subtests failed|Files=\d+, Tests=(\d+),") 436 437 mos = map(lambda line: re_test_result.search(line), lines) 438 test_result_lines = [mo.groups() for mo in mos if mo] 439 440 if not test_result_lines: 441 return cmd.rc 442 443 test_result_line = test_result_lines[0] 444 445 success = test_result_line[0] 446 447 if success: 448 failed = 0 449 450 test_totals_line = test_result_lines[1] 451 total_str = test_totals_line[3] 452 453 rc = SUCCESS 454 else: 455 failed_str = test_result_line[1] 456 failed = int(failed_str) 457 458 total_str = test_result_line[2] 459 460 rc = FAILURE 461 462 total = int(total_str) 463 passed = total - failed 464 465 self.setStepProperty('tests-total', total) 466 self.setStepProperty('tests-failed', failed) 467 self.setStepProperty('tests-passed', passed) 468 469 self.warnings = failed 470 471 return rc -
old-dustin/buildbot/test/test_steps.py
old new 639 639 "treesize %d KiB" % kib) 640 640 d.addCallback(_check) 641 641 return d 642 643 class PerlModuleTest(StepTester, unittest.TestCase): 644 def testAllTestsPassed(self): 645 self.masterbase = "Warnings.testAllTestsPassed" 646 step = self.makeStep(shell.PerlModuleTest) 647 output = \ 648 """ok 1 649 ok 2 650 All tests successful 651 Files=1, Tests=123, other stuff 652 """ 653 log = step.addLog("stdio") 654 log.addStdout(output) 655 log.finish() 656 step.evaluateCommand(log) 657 self.failUnlessEqual(step.getStepProperty('tests-failed'), 0) 658 self.failUnlessEqual(step.getStepProperty('tests-total'), 123) 659 self.failUnlessEqual(step.getStepProperty('tests-passed'), 123) 660 661 def testFailures(self): 662 self.masterbase = "Warnings.testFailures" 663 step = self.makeStep(shell.PerlModuleTest) 664 output = \ 665 """ 666 ok 1 667 ok 2 668 3/7 subtests failed 669 """ 670 log = step.addLog("stdio") 671 log.addStdout(output) 672 log.finish() 673 step.evaluateCommand(log) 674 self.failUnlessEqual(step.getStepProperty('tests-failed'), 3) 675 self.failUnlessEqual(step.getStepProperty('tests-total'), 7) 676 self.failUnlessEqual(step.getStepProperty('tests-passed'), 4) -
old-dustin/docs/buildbot.texinfo
old new 4927 4927 * Compile:: 4928 4928 * Test:: 4929 4929 * TreeSize:: 4930 * PerlModuleTest:: 4930 4931 * SetProperty:: 4931 4932 * Build Properties:: 4932 4933 @end menu … … 4994 4995 aka 'KiB' or 'kibibytes') on the step's status text, and sets a build 4995 4996 property named 'tree-size-KiB' with the same value. 4996 4997 4998 @node PerlModuleTest, Build Properties, TreeSize, Simple ShellCommand Subclasses 4999 @subsubsection PerlModuleTest 5000 5001 @bsindex buildbot.steps.shell.PerlModuleTest 5002 5003 This is a simple command that knows how to run tests of perl modules. 5004 It parses the output to determine the number of tests passed and 5005 failed and total number executed, saving the results for later query. 5006 4997 5007 @node SetProperty 4998 5008 @subsubsection SetProperty 4999 5009
![[Buildbot Logo]](/trac/chrome/site/header-text-transparent.png)