Skip to content

Commit

Permalink
Remove the BuildSetStatus class, still allowing unpickling
Browse files Browse the repository at this point in the history
  • Loading branch information
djmitche committed Sep 25, 2014
1 parent 439f644 commit dc6a88d
Show file tree
Hide file tree
Showing 9 changed files with 267 additions and 547 deletions.
92 changes: 2 additions & 90 deletions master/buildbot/interfaces.py
Expand Up @@ -45,6 +45,7 @@ class LatentBuildSlaveFailedToSubstantiate(Exception):


class IPlugin(Interface):

"""
Base interface for all Buildbot plugins
"""
Expand Down Expand Up @@ -611,96 +612,6 @@ def getLogs():
'stdout', 'log', 'exceptions'. The values are strings."""


class IBuildStepStatus(Interface):

"""I hold status for a single BuildStep."""

def getName():
"""Returns a short string with the name of this step. This string
may have spaces in it."""

def getBuild():
"""Returns the IBuildStatus object which contains this step."""

def getTimes():
"""Returns a tuple of (start, end). 'start' and 'end' are the times
(seconds since the epoch) when the Step started and finished. If the
step has not yet started, 'start' will be None. If the step is still
running, 'end' will be None."""

def getExpectations():
"""Returns a list of tuples (name, current, target). Each tuple
describes a single axis along which the step's progress can be
measured. 'name' is a string which describes the axis itself, like
'filesCompiled' or 'tests run' or 'bytes of output'. 'current' is a
number with the progress made so far, while 'target' is the value
that we expect (based upon past experience) to get to when the build
is finished.
'current' will change over time until the step is finished. It is
'None' until the step starts. When the build is finished, 'current'
may or may not equal 'target' (which is merely the expectation based
upon previous builds)."""

def getURLs():
"""Returns a dictionary of URLs. Each key is a link name (a short
string, like 'results' or 'coverage'), and each value is a URL. These
links will be displayed along with the LogFiles.
"""

def getLogs():
"""Returns a list of IStatusLog objects. If the step has not yet
finished, this list may be incomplete (asking again later may give
you more of them)."""

def isFinished():
"""Return a boolean. True means the step has finished, False means it
is still running."""

def waitUntilFinished():
"""Return a Deferred that will fire when the step finishes. If the
step has already finished, this deferred will fire right away. The
callback is given this IBuildStepStatus instance as an argument."""

# while the step is running, the following methods make sense.
# Afterwards they return None

def getETA():
"""Returns the number of seconds from now in which the step is
expected to finish, or None if we can't make a guess. This guess will
be refined over time."""

# Once you know the step has finished, the following methods are legal.
# Before ths step has finished, they all return None.

def getText():
"""Returns a list of strings which describe the step. These are
intended to be displayed in a narrow column. If more space is
available, the caller should join them together with spaces before
presenting them to the user."""

def getResults():
"""Return a tuple describing the results of the step: (result,
strings). 'result' is one of the constants in
buildbot.status.builder: SUCCESS, WARNINGS, FAILURE, or SKIPPED.
'strings' is an optional list of strings that the step wants to
append to the overall build's results. These strings are usually
more terse than the ones returned by getText(): in particular,
successful Steps do not usually contribute any text to the overall
build."""

# subscription interface

def subscribe(receiver, updateInterval=10):
"""Register an IStatusReceiver to receive new status events. The
receiver will be given logStarted and logFinished messages. It will
also be given a ETAUpdate message every 'updateInterval' seconds."""

def unsubscribe(receiver):
"""Unregister an IStatusReceiver. No further status messgaes will be
delivered."""


class IStatusEvent(Interface):

"""I represent a Builder Event, something non-Build related that can
Expand Down Expand Up @@ -1138,6 +1049,7 @@ def buildStep():


class IBuildStep(IPlugin):

"""
A build step
"""
Expand Down
3 changes: 0 additions & 3 deletions master/buildbot/status/__init__.py
Expand Up @@ -2,20 +2,17 @@
import builder
import buildrequest
import buildset
import buildstep
import logfile
import master
import slave
import testresult

# styles.Versioned requires this, as it keys the version numbers on the fully
# qualified class name; see master/buildbot/test/regressions/test_unpickling.py
buildstep.BuildStepStatus.__module__ = 'buildbot.status.builder'
build.BuildStatus.__module__ = 'buildbot.status.builder'

# add all of these classes to builder; this is a form of late binding to allow
# circular module references among the status modules
builder.BuildStepStatus = buildstep.BuildStepStatus
builder.BuildSetStatus = buildset.BuildSetStatus
builder.TestResult = testresult.TestResult
builder.LogFile = logfile.LogFile
Expand Down
13 changes: 1 addition & 12 deletions master/buildbot/status/build.py
Expand Up @@ -22,7 +22,6 @@
from buildbot import interfaces
from buildbot import util
from buildbot.process import properties
from buildbot.status.buildstep import BuildStepStatus
from buildbot.util import pickle
from twisted.internet import defer
from twisted.internet import reactor
Expand Down Expand Up @@ -226,16 +225,6 @@ def unsubscribe(self, receiver):

# methods for the base.Build to invoke

def addStepWithName(self, name):
"""The Build is setting up, and has added a new BuildStep to its
list. Create a BuildStepStatus object to which it can send status
updates."""

s = BuildStepStatus(self, self.master, len(self.steps))
s.setName(name)
self.steps.append(s)
return s

def addTestResult(self, result):
self.testResults[result.getName()] = result

Expand Down Expand Up @@ -287,7 +276,7 @@ def buildFinished(self):
for w in watchers:
w.callback(self)

# methods called by our BuildStepStatus children
# methods previously called by our now-departed BuildStepStatus children

def stepStarted(self, step):
self.currentStep = step
Expand Down

0 comments on commit dc6a88d

Please sign in to comment.