From 74de9673431e8848a002b86472a3d81a6e68fa42 Mon Sep 17 00:00:00 2001 From: UK992 Date: Tue, 12 Jul 2016 22:52:10 +0200 Subject: [PATCH] Add description to buildbot steps --- buildbot/master/files/config/factories.py | 30 ++++++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/buildbot/master/files/config/factories.py b/buildbot/master/files/config/factories.py index aca9b747..43858d90 100644 --- a/buildbot/master/files/config/factories.py +++ b/buildbot/master/files/config/factories.py @@ -79,7 +79,7 @@ def make_step(self, command): command = command.split(' ') - # Add bash -l before every command on Windows builders + # Add `bash -l` before every command on Windows builders bash_args = ["bash", "-l"] if self.is_windows else [] step_kwargs['command'] = bash_args + command if self.is_windows: @@ -90,6 +90,7 @@ def make_step(self, command): ), }) + step_desc = [] step_class = steps.ShellCommand args = iter(command) for arg in args: @@ -97,6 +98,7 @@ def make_step(self, command): # (steps.Compile and steps.Test catch warnings) if arg == './mach': mach_arg = next(args) + step_desc = [mach_arg] if re.match('build(-.*)?', mach_arg): step_class = steps.Compile elif re.match('test-.*', mach_arg): @@ -125,6 +127,15 @@ def make_step(self, command): r'C:\Program Files\Amazon\cfn-bootstrap', ]) + else: + step_desc += [arg] + + if step_class != steps.ShellCommand: + step_kwargs['descriptionSuffix'] = " ".join(step_desc) + + step_kwargs['description'] = "running" + step_kwargs['descriptionDone'] = "ran" + step_kwargs['env'] = step_env return step_class(**step_kwargs) @@ -194,9 +205,9 @@ def make_step(self, command): command = command.split(' ') - # Add bash -l before every command on Windows builders - bash_command = ["bash", "-l"] if self.is_windows else [] - step_kwargs['command'] = bash_command + command + # Add `bash -l` before every command on Windows builders + bash_args = ["bash", "-l"] if self.is_windows else [] + step_kwargs['command'] = bash_args + command if self.is_windows: step_env += envs.Environment({ # Set home directory, to avoid adding `cd` command every time @@ -205,6 +216,7 @@ def make_step(self, command): ), }) + step_desc = [] step_class = steps.ShellCommand args = iter(command) for arg in args: @@ -212,6 +224,7 @@ def make_step(self, command): # (steps.Compile and steps.Test catch warnings) if arg == './mach': mach_arg = next(args) + step_desc = [mach_arg] if re.match('build(-.*)?', mach_arg): step_class = steps.Compile elif re.match('test-.*', mach_arg): @@ -240,6 +253,15 @@ def make_step(self, command): r'C:\Program Files\Amazon\cfn-bootstrap', ]) + else: + step_desc += [arg] + + if step_class != steps.ShellCommand: + step_kwargs['descriptionSuffix'] = " ".join(step_desc) + + step_kwargs['description'] = "running" + step_kwargs['descriptionDone'] = "ran" + step_kwargs['env'] = step_env return step_class(**step_kwargs)