Ticket #228: pmt.diff
| File pmt.diff, 7.0 KB (added by nhemingway, 2 years ago) |
|---|
-
buildbot/process/factory.py
diff -rN -u old-buildbot_only_PerlModuleTest/buildbot/process/factory.py new-buildbot_only_PerlModuleTest/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): -
buildbot/status/web/waterfall.py
diff -rN -u old-buildbot_only_PerlModuleTest/buildbot/status/web/waterfall.py new-buildbot_only_PerlModuleTest/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() -
buildbot/steps/shell.py
diff -rN -u old-buildbot_only_PerlModuleTest/buildbot/steps/shell.py new-buildbot_only_PerlModuleTest/buildbot/steps/shell.py
old new 334 334 description = ["testing"] 335 335 descriptionDone = ["test"] 336 336 command = ["make", "test"] 337 338 class PerlModuleTest(Test): 339 command=["prove", "--lib", "lib", "-r", "t"] 340 341 def evaluateCommand(self, cmd): 342 lines = self.getLog('stdio').readlines() 343 344 re_test_result = re.compile("^(All tests successful)|(\d+)/(\d+) subtests failed|Files=\d+, Tests=(\d+),") 345 346 mos = map(lambda line: re_test_result.search(line), lines) 347 test_result_lines = [mo.groups() for mo in mos if mo] 348 349 if not test_result_lines: 350 return cmd.rc 351 352 test_result_line = test_result_lines[0] 353 354 success = test_result_line[0] 355 356 if success: 357 failed = 0 358 359 test_totals_line = test_result_lines[1] 360 total_str = test_totals_line[3] 361 362 rc = SUCCESS 363 else: 364 failed_str = test_result_line[1] 365 failed = int(failed_str) 366 367 total_str = test_result_line[2] 368 369 rc = FAILURE 370 371 total = int(total_str) 372 passed = total - failed 373 374 self.setStepProperty('tests-total', total) 375 self.setStepProperty('tests-failed', failed) 376 self.setStepProperty('tests-passed', passed) 377 378 self.warnings = failed 379 380 return rc -
buildbot/test/test_steps.py
diff -rN -u old-buildbot_only_PerlModuleTest/buildbot/test/test_steps.py new-buildbot_only_PerlModuleTest/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) -
docs/buildbot.texinfo
diff -rN -u old-buildbot_only_PerlModuleTest/docs/buildbot.texinfo new-buildbot_only_PerlModuleTest/docs/buildbot.texinfo
old new 206 206 * Compile:: 207 207 * Test:: 208 208 * TreeSize:: 209 * Build Properties:: 209 * Build Properties:: 210 210 211 211 Python BuildSteps 212 212 … … 4475 4475 * Compile:: 4476 4476 * Test:: 4477 4477 * TreeSize:: 4478 * Build Properties:: 4478 * PerlModuleTest:: 4479 * Build Properties:: 4479 4480 @end menu 4480 4481 4481 4482 @node Configure, Compile, Simple ShellCommand Subclasses, Simple ShellCommand Subclasses … … 4531 4532 This is meant to handle unit tests. The default command is @code{make 4532 4533 test}, and the @code{warnOnFailure} flag is set. 4533 4534 4534 @node TreeSize, Build Properties, Test, Simple ShellCommand Subclasses4535 @node TreeSize, PerlModuleTest, Test, Simple ShellCommand Subclasses 4535 4536 @subsubsection TreeSize 4536 4537 4537 4538 @bsindex buildbot.steps.shell.TreeSize … … 4541 4542 aka 'KiB' or 'kibibytes') on the step's status text, and sets a build 4542 4543 property named 'tree-size-KiB' with the same value. 4543 4544 4545 @node PerlModuleTest, Build Properties, TreeSize, Simple ShellCommand Subclasses 4546 @subsubsection PerlModuleTest 4544 4547 4545 @node Build Properties, , TreeSize, Simple ShellCommand Subclasses 4548 @bsindex buildbot.steps.shell.PerlModuleTest 4549 4550 This is a simple command that knows how to run tests of perl modules. 4551 It parses the output to determine the number of tests passed and 4552 failed and total number executed, saving the results for later query. 4553 4554 4555 @node Build Properties, , PerlModuleTest, Simple ShellCommand Subclasses 4546 4556 @subsubsection Build Properties 4547 4557 4548 4558 @cindex build properties … … 5339 5349 5340 5350 5341 5351 5342 @node BuildStep URLs, , Adding LogObservers, Writing New BuildSteps5352 @node BuildStep URLs, , Adding LogObservers, Writing New BuildSteps 5343 5353 @subsubsection BuildStep URLs 5344 5354 5345 5355 @cindex links
![[Buildbot Logo]](/trac/chrome/site/header-text-transparent.png)