Chromium Code Reviews| Index: scripts/master/factory/commands.py |
| diff --git a/scripts/master/factory/commands.py b/scripts/master/factory/commands.py |
| index 44ef69216247ac1323d71e5400b51266072cded8..4bee2ad3d59940a617c9de8a13b2dd36b2e160f1 100644 |
| --- a/scripts/master/factory/commands.py |
| +++ b/scripts/master/factory/commands.py |
| @@ -112,6 +112,35 @@ class SwarmShellForHashes(shell.ShellCommand): |
| self.setProperty('swarm_hashes', swarm_hashes) |
| +def GetSwarmTestsFromTestFilter(test_filters): |
| + """Returns a list of all the tests in the list that should be run with |
| + swarm.""" |
| + swarm_tests = [] |
| + for test_filter in test_filters: |
| + if '_swarm:' in test_filter: |
| + swarm_tests.append(test_filter.split('_swarm:')[0]) |
|
M-A Ruel
2012/11/01 19:06:46
swarm_tests.append(test_filter.split('_swarm:', 1)
csharp
2012/11/01 19:30:09
Done.
|
| + elif test_filter.endswith('_swarm'): |
| + swarm_tests.append(test_filter[:-len('_swarm')]) |
| + |
| + return swarm_tests |
| + |
| + |
| +class CompileWithRequiredSwarmTargets(shell.Compile): |
| + def start(self): |
| + try: |
| + test_filters = self.getProperty('testfilter') |
| + except KeyError: |
| + test_filters = [] |
| + |
| + command = self.command |
| + swarm_tests = GetSwarmTestsFromTestFilter(test_filters) |
| + for swarm_test in swarm_tests: |
|
M-A Ruel
2012/11/01 19:06:46
command.extend(i + '_run' for i in swarm_tests)
csharp
2012/11/01 19:30:09
Done.
|
| + command.append(swarm_test + '_run') |
| + |
| + self.setCommand(command) |
| + return shell.Compile.start(self) |
| + |
| + |
| class FactoryCommands(object): |
| # Base URL for performance test results. |
| PERF_BASE_URL = config.Master.perf_base_url |
| @@ -914,7 +943,7 @@ class FactoryCommands(object): |
| halfOnFailure: should stop the build if compile fails |
| """ |
| self._factory.addStep( |
| - shell.Compile, |
| + CompileWithRequiredSwarmTargets, |
| name='compile', |
| timeout=timeout, |
| description=description, |