Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1411 from tardyp/t3024
serialize remoteCommand
- Loading branch information
Showing
4 changed files
with
98 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
master/buildbot/test/integration/test_setproperyfromcommand.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# This file is part of Buildbot. Buildbot is free software: you can | ||
# redistribute it and/or modify it under the terms of the GNU General Public | ||
# License as published by the Free Software Foundation, version 2. | ||
# | ||
# This program is distributed in the hope that it will be useful, but WITHOUT | ||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | ||
# details. | ||
# | ||
# You should have received a copy of the GNU General Public License along with | ||
# this program; if not, write to the Free Software Foundation, Inc., 51 | ||
# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
# | ||
# Copyright Buildbot Team Members | ||
|
||
from buildbot.test.util.integration import RunMasterBase | ||
from twisted.internet import defer | ||
from twisted.internet import reactor | ||
from twisted.internet import task | ||
|
||
# This integration test helps reproduce http://trac.buildbot.net/ticket/3024 | ||
# we make sure that we can reconfigure the master while build is running | ||
|
||
|
||
class SetProperyFromCommand(RunMasterBase): | ||
|
||
@defer.inlineCallbacks | ||
def test_setProp(self): | ||
oldNewLog = self.master.data.updates.newLog | ||
|
||
@defer.inlineCallbacks | ||
def newLog(*arg, **kw): | ||
# Simulate db delay. We usually don't test race conditions | ||
# with delays, but in integrations test, that would be pretty tricky | ||
yield task.deferLater(reactor, .1, lambda: None) | ||
res = yield oldNewLog(*arg, **kw) | ||
defer.returnValue(res) | ||
self.master.data.updates.newLog = newLog | ||
build = yield self.doForceBuild(wantProperties=True) | ||
|
||
self.assertEqual(build['properties']['test'], (u'foo', u'SetPropertyFromCommand Step')) | ||
|
||
|
||
# master configuration | ||
|
||
num_reconfig = 0 | ||
|
||
|
||
def masterConfig(): | ||
global num_reconfig | ||
num_reconfig += 1 | ||
c = {} | ||
from buildbot.plugins import schedulers, steps, util | ||
|
||
c['schedulers'] = [ | ||
schedulers.ForceScheduler( | ||
name="force", | ||
builderNames=["testy"])] | ||
|
||
f = util.BuildFactory() | ||
f.addStep(steps.SetPropertyFromCommand(property="test", command=["echo", "foo"])) | ||
c['builders'] = [ | ||
util.BuilderConfig(name="testy", | ||
slavenames=["local1"], | ||
factory=f)] | ||
|
||
return c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters