From 29d8f841b367dcbc6c260a460f362a86f471f661 Mon Sep 17 00:00:00 2001 From: warner Date: Mon, 18 Jun 2007 08:51:32 +0100 Subject: [PATCH] test_config.py: make sure we can round-trip all of our current step classes --- ChangeLog | 5 +++++ buildbot/steps/maxq.py | 4 ++-- buildbot/test/test_config.py | 40 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index eebbac9..87291ce 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2007-06-17 Brian Warner + * buildbot/test/test_config.py (Factories.testAllSteps): make sure + we can round-trip all of our current step classes by calling + getStepFactory() and using the results to make a clone of the + original step. + * buildbot/steps/maxq.py: fix import errors. Guess this hasn't been used in a while.. diff --git a/buildbot/steps/maxq.py b/buildbot/steps/maxq.py index aa0c9a7..2a29ed8 100644 --- a/buildbot/steps/maxq.py +++ b/buildbot/steps/maxq.py @@ -8,8 +8,8 @@ class MaxQ(ShellCommand): def __init__(self, testdir=None, **kwargs): if not testdir: raise TypeError("please pass testdir") - command = 'run_maxq.py %s' % (testdir,) - ShellCommand.__init__(self, command=command, **kwargs) + kwargs['command'] = 'run_maxq.py %s' % (testdir,) + ShellCommand.__init__(self, **kwargs) self.addFactoryArguments(testdir=testdir) def startStatus(self): diff --git a/buildbot/test/test_config.py b/buildbot/test/test_config.py index 9d6c69e..f80c532 100644 --- a/buildbot/test/test_config.py +++ b/buildbot/test/test_config.py @@ -25,6 +25,8 @@ from buildbot.process.factory import BasicBuildFactory from buildbot.steps.source import CVS, Darcs from buildbot.steps.shell import Compile, Test, ShellCommand from buildbot.status import base +from buildbot.steps import dummy, maxq, python, python_twisted, shell, \ + source, transfer words = None try: from buildbot.status import words @@ -1177,3 +1179,41 @@ class Factories(unittest.TestCase): repourl="http://buildbot.net/repos/trunk") self.failUnlessExpectedShell(steps[3], defaults=False, command="echo old-style") + + def _loop(self, orig): + step_class, kwargs = orig.getStepFactory() + newstep = step_class(**kwargs) + return newstep + + def testAllSteps(self): + # make sure that steps can be created from the factories that they + # return + for s in ( dummy.Dummy(), dummy.FailingDummy(), dummy.RemoteDummy(), + maxq.MaxQ("testdir"), + python.BuildEPYDoc(), python.PyFlakes(), + python_twisted.HLint(), + python_twisted.Trial(testpath=None, tests="tests"), + python_twisted.ProcessDocs(), python_twisted.BuildDebs(), + python_twisted.RemovePYCs(), + shell.ShellCommand(), shell.TreeSize(), + shell.Configure(), shell.Compile(), shell.Test(), + source.CVS("cvsroot", "module"), + source.SVN("svnurl"), source.Darcs("repourl"), + source.Git("repourl"), + source.Arch("url", "version"), + source.Bazaar("url", "version", "archive"), + source.Bzr("repourl"), + source.Mercurial("repourl"), + source.P4("p4base"), + source.P4Sync(1234, "p4user", "passwd", "client", + mode="copy"), + source.Monotone("server", "branch"), + transfer.FileUpload("src", "dest"), + transfer.FileDownload("src", "dest"), + ): + try: + self._loop(s) + except: + print "error checking %s" % s + raise + -- 2.11.4.GIT