Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(887)

Side by Side Diff: third_party/buildbot_7_12/buildbot/steps/dummy.py

Issue 12207158: Bye bye buildbot 0.7.12. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1
2 from twisted.internet import reactor
3 from buildbot.process.buildstep import BuildStep, LoggingBuildStep
4 from buildbot.process.buildstep import LoggedRemoteCommand
5 from buildbot.status.builder import SUCCESS, FAILURE
6
7 # these classes are used internally by buildbot unit tests
8
9 class Dummy(BuildStep):
10 """I am a dummy no-op step, which runs entirely on the master, and simply
11 waits 5 seconds before finishing with SUCCESS
12 """
13
14 haltOnFailure = True
15 flunkOnFailure = True
16 name = "dummy"
17
18 def __init__(self, timeout=5, **kwargs):
19 """
20 @type timeout: int
21 @param timeout: the number of seconds to delay before completing
22 """
23 BuildStep.__init__(self, **kwargs)
24 self.addFactoryArguments(timeout=timeout)
25 self.timeout = timeout
26 self.timer = None
27
28 def start(self):
29 self.step_status.setText(["delay", "%s secs" % self.timeout])
30 self.timer = reactor.callLater(self.timeout, self.done)
31
32 def interrupt(self, reason):
33 if self.timer:
34 self.timer.cancel()
35 self.timer = None
36 self.step_status.setText(["delay", "interrupted"])
37 self.finished(FAILURE)
38
39 def done(self):
40 self.finished(SUCCESS)
41
42 class FailingDummy(Dummy):
43 """I am a dummy no-op step that 'runs' master-side and finishes (with a
44 FAILURE status) after 5 seconds."""
45
46 name = "failing dummy"
47
48 def start(self):
49 self.step_status.setText(["boom", "%s secs" % self.timeout])
50 self.timer = reactor.callLater(self.timeout, self.done)
51
52 def done(self):
53 self.finished(FAILURE)
54
55 class RemoteDummy(LoggingBuildStep):
56 """I am a dummy no-op step that runs on the remote side and
57 simply waits 5 seconds before completing with success.
58 See L{buildbot.slave.commands.DummyCommand}
59 """
60
61 haltOnFailure = True
62 flunkOnFailure = True
63 name = "remote dummy"
64
65 def __init__(self, timeout=5, **kwargs):
66 """
67 @type timeout: int
68 @param timeout: the number of seconds to delay
69 """
70 LoggingBuildStep.__init__(self, **kwargs)
71 self.addFactoryArguments(timeout=timeout)
72 self.timeout = timeout
73 self.description = ["remote", "delay", "%s secs" % timeout]
74
75 def describe(self, done=False):
76 return self.description
77
78 def start(self):
79 args = {'timeout': self.timeout}
80 cmd = LoggedRemoteCommand("dummy", args)
81 self.startCommand(cmd)
82
83 class Wait(LoggingBuildStep):
84 """I start a command on the slave that waits for the unit test to
85 tell it when to finish.
86 """
87
88 name = "wait"
89 def __init__(self, handle, **kwargs):
90 LoggingBuildStep.__init__(self, **kwargs)
91 self.addFactoryArguments(handle=handle)
92 self.handle = handle
93
94 def describe(self, done=False):
95 return ["wait: %s" % self.handle]
96
97 def start(self):
98 args = {'handle': (self.handle, self.build.reason)}
99 cmd = LoggedRemoteCommand("dummy.wait", args)
100 self.startCommand(cmd)
OLDNEW
« no previous file with comments | « third_party/buildbot_7_12/buildbot/steps/__init__.py ('k') | third_party/buildbot_7_12/buildbot/steps/master.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698