Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Set of utilities to add commands to a buildbot factory. | 5 """Set of utilities to add commands to a buildbot factory. |
| 6 | 6 |
| 7 This is based on commands.py and adds swarm-specific commands.""" | 7 This is based on commands.py and adds swarm-specific commands.""" |
| 8 | 8 |
| 9 from buildbot.process.properties import WithProperties | 9 from buildbot.process.properties import WithProperties |
| 10 from buildbot.steps import shell | 10 from buildbot.steps import shell |
| 11 from twisted.python import log | 11 from twisted.python import log |
| 12 | 12 |
| 13 import config | 13 import config |
| 14 from master.factory import commands | 14 from master.factory import commands |
| 15 from master.log_parser import gtest_command | 15 from master.log_parser import gtest_command |
| 16 | 16 |
| 17 | 17 |
| 18 def TestStepFilterSwarm(bStep): | 18 def TestStepFilterSwarm(bStep): |
| 19 """Examines the 'testfilter' property of a build and determines if this | 19 """Examines the 'testfilter' property of a build and determines if this |
| 20 build has swarm steps and thus if the test should run. | 20 build has swarm steps and thus if the test should run. |
| 21 It also adds a property, swarm_tests, which contains all the tests which will | 21 It also adds a property, swarm_tests, which contains all the tests which will |
| 22 run under swarm.""" | 22 run under swarm.""" |
| 23 bStep.setProperty('swarm_tests', '') | |
| 24 test_filters = bStep.build.getProperties().getProperty('testfilter') | 23 test_filters = bStep.build.getProperties().getProperty('testfilter') |
| 25 test_filters = test_filters or commands.DEFAULT_TESTS | 24 test_filters = test_filters or commands.DEFAULT_TESTS |
| 26 | 25 |
| 27 swarm_tests = '' | 26 swarm_tests = commands.GetSwarmTestsFromTestFilter(test_filters) |
| 28 for test_filter in test_filters: | 27 bStep.setProperty('swarm_tests', ' '.join(swarm_tests)) |
|
M-A Ruel
2012/11/01 20:00:00
Why not keep it as a list?
I see it was a string
csharp
2012/11/01 20:05:25
I think I converted to a string because I didn't t
| |
| 29 if '_swarm:' in test_filter: | |
| 30 swarm_tests += test_filter.split('_swarm:')[0] + ' ' | |
| 31 elif test_filter.endswith('_swarm'): | |
| 32 swarm_tests += test_filter[:-len('_swarm')] + ' ' | |
| 33 | |
| 34 bStep.setProperty('swarm_tests', swarm_tests.strip()) | |
| 35 | 28 |
| 36 return bool(swarm_tests) | 29 return bool(swarm_tests) |
| 37 | 30 |
| 38 | 31 |
| 39 def TestStepHasSwarmProperties(bStep): | 32 def TestStepHasSwarmProperties(bStep): |
| 40 """Returns true if the step has the required swarm properties set.""" | 33 """Returns true if the step has the required swarm properties set.""" |
| 41 properties = bStep.build.getProperties() | 34 properties = bStep.build.getProperties() |
| 42 | 35 |
| 43 try: | 36 try: |
| 44 properties.getProperty('testfilter') | 37 properties.getProperty('testfilter') |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 147 | 140 |
| 148 command = [self._python, script_path, '--drive', drive, | 141 command = [self._python, script_path, '--drive', drive, |
| 149 '--network_path', network_path] | 142 '--network_path', network_path] |
| 150 | 143 |
| 151 self._factory.addStep( | 144 self._factory.addStep( |
| 152 shell.ShellCommand, | 145 shell.ShellCommand, |
| 153 name='setup_windows_network_storage', | 146 name='setup_windows_network_storage', |
| 154 description='setup_windows_network_storage', | 147 description='setup_windows_network_storage', |
| 155 descriptionDone='setup_windows_network_storage', | 148 descriptionDone='setup_windows_network_storage', |
| 156 command=command) | 149 command=command) |
| OLD | NEW |