Chromium Code Reviews| Index: scripts/master/factory/swarm_commands.py |
| diff --git a/scripts/master/factory/swarm_commands.py b/scripts/master/factory/swarm_commands.py |
| index 1d3a66a424dcec7cfc3a1b75731b43037b27de43..722e111c4586c7e6d3f32e51ddcc76255667ee52 100644 |
| --- a/scripts/master/factory/swarm_commands.py |
| +++ b/scripts/master/factory/swarm_commands.py |
| @@ -6,20 +6,43 @@ |
| This is based on commands.py and adds swarm-specific commands.""" |
| -from master.factory import commands |
| +from buildbot.process.properties import WithProperties |
| +from buildbot.steps import shell |
| +from master.factory import commands |
| from master.log_parser import gtest_command |
| class SwarmCommands(commands.FactoryCommands): |
| """Encapsulates methods to add swarm commands to a buildbot factory""" |
| - def AddSwarmTestStep(self, target_platform, swarm_server, swarm_port, |
| - min_shards, max_shards, manifest_file, test_name): |
| + def AddSendSwarmTestStep(self, target_platform, swarm_server, |
|
M-A Ruel
2012/04/17 20:16:00
I'd prefer "Trigger" to "Send". It is more meaning
csharp
2012/04/18 18:20:29
Done.
|
| + swarm_port, min_shards, max_shards, |
|
M-A Ruel
2012/04/17 20:16:00
weird alignment.
csharp
2012/04/18 18:20:29
Done.
|
| + manifest_files, test_names): |
| script_path = self.PathJoin(self._script_dir, 'run_slavelastic.py') |
| - command = [self._python, script_path, '-m', min_shards, '-s', max_shards, |
| - '-o', target_platform, '-n', swarm_server, |
| - '-p', swarm_port, manifest_file] |
| + # TODO(csharp) Merge into a single command |
| + for i in range(len(manifest_files)): |
| + swarm_request_name = WithProperties('%s-%s-' + test_names[i], |
| + 'buildername:-None', |
| + 'buildnumber:-None') |
| + |
| + command = [self._python, script_path, '-m', min_shards, '-s', max_shards, |
| + '-o', target_platform, '-n', swarm_server, |
| + '-p', swarm_port, '-t', swarm_request_name, manifest_files[i]] |
| + |
| + self.AddTestStep(shell.ShellCommand, |
| + '%s_swarm' % test_names[i], |
| + command) |
| + |
| + def AddGetSwarmTestStep(self, swarm_server, swarm_port, test_name): |
| + script_path = self.PathJoin(self._script_dir, 'get_swarm_results.py') |
| + |
| + swarm_request_name = WithProperties('%s-%s-' + test_name, |
| + 'buildername:-None', |
| + 'buildnumber:-None') |
| + |
| + command = [self._python, script_path, '-n', swarm_server, '-p', swarm_port, |
| + swarm_request_name] |
| self.AddTestStep(gtest_command.GTestCommand, |
| '%s_swarm' % test_name, |