Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix handling of stdin in master-side gist step.

RemoteShellCommand didn't in fact take the extra arguments that
the test fake did, so this wasn't caught by the tests.

Refs #2269.
  • Loading branch information...
commit 6da04ee7097238f2f7022d4e5f8d9739881ef188 1 parent dd4db71
@tomprince tomprince authored
View
4 master/buildbot/process/buildstep.py
@@ -344,7 +344,8 @@ def __init__(self, workdir, command, env=None,
want_stdout=1, want_stderr=1,
timeout=20*60, maxTime=None, logfiles={},
usePTY="slave-config", logEnviron=True,
- collectStdout=False, interruptSignal=None):
+ collectStdout=False, interruptSignal=None,
+ initialStdin=None):
self.command = command # stash .command, set it later
if env is not None:
@@ -361,6 +362,7 @@ def __init__(self, workdir, command, env=None,
'maxTime': maxTime,
'usePTY': usePTY,
'logEnviron': logEnviron,
+ 'initial_stdin': initialStdin
}
if interruptSignal is not None:
args['interruptSignal'] = interruptSignal
View
6 master/buildbot/steps/source/git.py
@@ -236,12 +236,12 @@ def setrev(stdout):
d.addCallback(setrev)
return d
- def _dovccmd(self, command, abandonOnFailure=True, collectStdout=False, extra_args={}):
+ def _dovccmd(self, command, abandonOnFailure=True, collectStdout=False, initialStdin=None):
cmd = buildstep.RemoteShellCommand(self.workdir, ['git'] + command,
env=self.env,
logEnviron=self.logEnviron,
collectStdout=collectStdout,
- **extra_args)
+ initialStdin=initialStdin)
cmd.useLog(self.stdio_log, False)
log.msg("Starting git command : git %s" % (" ".join(command), ))
d = self.runCommand(cmd)
@@ -288,7 +288,7 @@ def renameBranch(res):
return d
def patch(self, _, patch):
- d = self._dovccmd(['apply', '--index'], extra_args={'initial_stdin': patch})
+ d = self._dovccmd(['apply', '--index'], initialStdin=patch)
return d
@defer.inlineCallbacks
View
8 master/buildbot/test/fake/remotecommand.py
@@ -54,11 +54,11 @@ class FakeRemoteShellCommand(FakeRemoteCommand):
def __init__(self, workdir, command, env=None,
want_stdout=1, want_stderr=1,
timeout=DEFAULT_TIMEOUT, maxTime=DEFAULT_MAXTIME, logfiles={},
- initial_stdin=None,
+ initialStdin=None,
usePTY=DEFAULT_USEPTY, logEnviron=True, collectStdout=False):
args = dict(workdir=workdir, command=command, env=env or {},
want_stdout=want_stdout, want_stderr=want_stderr,
- initial_stdin=initial_stdin,
+ initial_stdin=initialStdin,
timeout=timeout, maxTime=maxTime, logfiles=logfiles,
usePTY=usePTY, logEnviron=logEnviron)
FakeRemoteCommand.__init__(self, "shell", args,
@@ -236,12 +236,12 @@ class ExpectShell(Expect):
non-default arguments must be specified explicitly (e.g., usePTY).
"""
def __init__(self, workdir, command, env={},
- want_stdout=1, want_stderr=1, initial_stdin=None,
+ want_stdout=1, want_stderr=1, initialStdin=None,
timeout=DEFAULT_TIMEOUT, maxTime=DEFAULT_MAXTIME, logfiles={},
usePTY=DEFAULT_USEPTY, logEnviron=True):
args = dict(workdir=workdir, command=command, env=env,
want_stdout=want_stdout, want_stderr=want_stderr,
- initial_stdin=initial_stdin,
+ initial_stdin=initialStdin,
timeout=timeout, maxTime=maxTime, logfiles=logfiles,
usePTY=usePTY, logEnviron=logEnviron)
Expect.__init__(self, "shell", args)
View
4 master/buildbot/test/unit/test_steps_source_git.py
@@ -83,7 +83,7 @@ def test_mode_full_clean_patch(self):
+ 0,
ExpectShell(workdir='wkdir',
command=['git', 'apply', '--index'],
- initial_stdin='patch')
+ initialStdin='patch')
+ 0,
ExpectShell(workdir='wkdir',
command=['git', 'rev-parse', 'HEAD'])
@@ -119,7 +119,7 @@ def test_mode_full_clean_patch_fail(self):
+ 0,
ExpectShell(workdir='wkdir',
command=['git', 'apply', '--index'],
- initial_stdin='patch')
+ initialStdin='patch')
+ 1,
)
self.expectOutcome(result=FAILURE, status_text=["updating"])
Please sign in to comment.
Something went wrong with that request. Please try again.