Skip to content
This repository has been archived by the owner on May 24, 2018. It is now read-only.

Commit

Permalink
Merge 160443d into ed375ba
Browse files Browse the repository at this point in the history
  • Loading branch information
warcholprzemo committed May 2, 2018
2 parents ed375ba + 160443d commit f556f56
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions master/buildbot/steps/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from twisted.python import log, failure
from twisted.spread import pb
from buildbot.process import buildstep
from buildbot.process.properties import Interpolate
from buildbot.status.results import SUCCESS, WARNINGS, FAILURE
from buildbot.status.logfile import STDOUT, STDERR
from buildbot import config
Expand Down Expand Up @@ -200,6 +201,8 @@ def _describe(self, done=False):
words = self.command
if isinstance(words, (str, unicode)):
words = words.split()
elif isinstance(words, Interpolate):
return [str(words)]

try:
len(words)
Expand Down
6 changes: 6 additions & 0 deletions master/buildbot/test/unit/test_steps_shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import re
import textwrap
from twisted.trial import unittest
from buildbot.process.properties import Interpolate
from buildbot.steps import shell
from buildbot.status.results import SKIPPED, SUCCESS, WARNINGS, FAILURE
from buildbot.status.results import EXCEPTION
Expand Down Expand Up @@ -71,6 +72,11 @@ def test_constructor_args_validity(self):
lambda: shell.ShellCommand('build', "echo Hello World",
wrongArg1=1, wrongArg2='two'))

def test_describe_with_command_Interpolate(self):
command = Interpolate("echo 'test %s'", 'one fish')
step = shell.ShellCommand(command=command)
self.assertEqual(step.describe(), [str(command)])

def test_describe_no_command(self):
step = shell.ShellCommand(workdir='build')
self.assertEqual((step.describe(), step.describe(done=True)),
Expand Down

0 comments on commit f556f56

Please sign in to comment.