[Buildbot-devel] Custom BuildStep Error

David A. Greene greened at obbligato.org
Thu Nov 20 17:51:57 UTC 2008


I got a custom BuildStep from another user that knows about DejaGNU:

class DejaGNUTester(Test):
  command=["make", "check"]
  total = 0
  description = "testing"
  descriptionDone = "test"
  def __init__(self, type):
    description = "testing " + type
    descriptionDone = "test " + type
  def describe(self, done=False):
    result = Test.describe(self, done)
    return result
  def evaluateCommand(self, cmd):
    rc = 0
    lines = self.getLog('stdio').readlines()
    failre = re.compile("^FAIL:.*")
    faillines = []
    xpass_result = re.compile("^# of unexpected passes\s*(\d+)")
    xpasses = 0
    xfail_result = re.compile("^# of expected failures\s*(\d+)")
    xfails = 0
    fail_result = re.compile("^# of unexpected failures\s*(\d+)")
    fails = 0
    pass_result = re.compile("^# of expected passes\s*(\d+)")
    passes = 0
    fails_list = []
    for line in lines:
      result = failre.search(line)
      if result:
        faillines.append(line)
      result =  xpass_result.search(line)
      if result:
	xpasses += int(result.group(1))
      result =  xfail_result.search(line)
      if result:
	xfails += int(result.group(1))
      result =  pass_result.search(line)
      if result:
	passes += int(result.group(1))
      result =  fail_result.search(line)
      if result:
	fails += int(result.group(1))
	fails_list.append(line)
    if faillines:
      self.addCompleteLog("fails", "\n".join(faillines) + "\n")
    if fails == 0:
      rc = SUCCESS
    else:
      rc = FAILURE
    self.setTestResults(total=fails+xpasses+xfails+passes, failed = fails, 
passed = passes, warnings = xpasses + xfails)
    return rc

But when I run buildbot checkconfig:

  File "lib/python/buildbot/process/factory.py", line 45, in addStep
    s = step_or_factory.getStepFactory()
  File "lib/python/buildbot/process/buildstep.py", line 612, in getStepFactory
    return self.factory
AttributeError: DejaGNUTester instance has no attribute 'factory'

This is with BuildBot 0.7.9, Tiwsted 8.1.0.

Any idea how to fix this?  No other BuildStep in the BuildBot sources seems to 
have a 'factory' attribute either.

                                                    -Dave





More information about the devel mailing list