| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 from recipe_engine.types import freeze | 5 from recipe_engine.types import freeze |
| 6 | 6 |
| 7 DEPS = [ | 7 DEPS = [ |
| 8 'bot_update', | 8 'bot_update', |
| 9 'chromium', | 9 'chromium', |
| 10 'chromium_tests', | 10 'chromium_tests', |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 | 181 |
| 182 | 182 |
| 183 def all_compile_targets(api, tests): | 183 def all_compile_targets(api, tests): |
| 184 """Returns the compile_targets for all the Tests in |tests|.""" | 184 """Returns the compile_targets for all the Tests in |tests|.""" |
| 185 return sorted(set(x | 185 return sorted(set(x |
| 186 for test in tests | 186 for test in tests |
| 187 for x in test.compile_targets(api))) | 187 for x in test.compile_targets(api))) |
| 188 | 188 |
| 189 | 189 |
| 190 def _RunStepsInternal(api): | 190 def _RunStepsInternal(api): |
| 191 mastername = api.properties.get('mastername') | 191 mastername = api.properties['mastername'] |
| 192 buildername = api.properties.get('buildername') | 192 buildername = api.properties['buildername'] |
| 193 bot_config = BUILDERS[mastername]['builders'][buildername] | 193 bot_config = BUILDERS[mastername]['builders'][buildername] |
| 194 is_android = ('Android' in buildername or 'android' in buildername) | 194 is_android = ('Android' in buildername or 'android' in buildername) |
| 195 force_clobber = bot_config.get('force_clobber', False) | 195 force_clobber = bot_config.get('force_clobber', False) |
| 196 | 196 |
| 197 api.chromium.configure_bot(BUILDERS, ['mb']) | 197 api.chromium.configure_bot(BUILDERS, ['mb']) |
| 198 bot_update_step = api.bot_update.ensure_checkout( | 198 bot_update_step = api.bot_update.ensure_checkout( |
| 199 force=True, patch_root=bot_config.get('root_override')) | 199 force=True, patch_root=bot_config.get('root_override')) |
| 200 | 200 |
| 201 # because the 'mb' config is applied, we skip running gyp in the | 201 # because the 'mb' config is applied, we skip running gyp in the |
| 202 # the runhooks step. | 202 # the runhooks step. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 224 if api.tryserver.is_tryserver: | 224 if api.tryserver.is_tryserver: |
| 225 affected_files = api.tryserver.get_files_affected_by_patch() | 225 affected_files = api.tryserver.get_files_affected_by_patch() |
| 226 | 226 |
| 227 test_targets = all_compile_targets(api, tests) | 227 test_targets = all_compile_targets(api, tests) |
| 228 | 228 |
| 229 test_targets, compile_targets = \ | 229 test_targets, compile_targets = \ |
| 230 api.chromium_tests.analyze( | 230 api.chromium_tests.analyze( |
| 231 affected_files, | 231 affected_files, |
| 232 test_targets, | 232 test_targets, |
| 233 additional_compile_targets, | 233 additional_compile_targets, |
| 234 'trybot_analyze_config.json') | 234 'trybot_analyze_config.json', |
| 235 mastername, |
| 236 buildername) |
| 235 if compile_targets: | 237 if compile_targets: |
| 236 api.chromium.run_mb(mastername, buildername, use_goma=True) | 238 api.chromium.run_mb(mastername, buildername, use_goma=True) |
| 237 api.chromium.compile(compile_targets, | 239 api.chromium.compile(compile_targets, |
| 238 force_clobber=force_clobber) | 240 force_clobber=force_clobber) |
| 239 tests = tests_in_compile_targets(api, test_targets, tests) | 241 tests = tests_in_compile_targets(api, test_targets, tests) |
| 240 else: | 242 else: |
| 241 api.chromium.run_mb(mastername, buildername, use_goma=True) | 243 api.chromium.run_mb(mastername, buildername, use_goma=True) |
| 242 api.chromium.compile(all_compile_targets(api, tests) + | 244 api.chromium.compile(all_compile_targets(api, tests) + |
| 243 additional_compile_targets, | 245 additional_compile_targets, |
| 244 force_clobber=force_clobber) | 246 force_clobber=force_clobber) |
| 245 | 247 |
| 246 if tests: | 248 if tests: |
| 247 if api.tryserver.is_tryserver: | 249 if api.tryserver.is_tryserver: |
| 248 api.chromium_tests.run_tests_on_tryserver( | 250 api.chromium_tests.run_tests_on_tryserver( |
| 249 mastername, api, tests, bot_update_step, affected_files) | 251 mastername, api, tests, bot_update_step, affected_files, |
| 252 mb_mastername=mastername, mb_buildername=buildername) |
| 250 else: | 253 else: |
| 251 api.chromium_tests.configure_swarming('chromium', precommit=False, | 254 api.chromium_tests.configure_swarming('chromium', precommit=False, |
| 252 mastername=mastername) | 255 mastername=mastername) |
| 253 test_runner = api.chromium_tests.create_test_runner(api, tests) | 256 test_runner = api.chromium_tests.create_test_runner(api, tests) |
| 254 with api.chromium_tests.wrap_chromium_tests(mastername, tests): | 257 with api.chromium_tests.wrap_chromium_tests(mastername, tests): |
| 255 test_runner() | 258 test_runner() |
| 256 | 259 |
| 257 | 260 |
| 258 def RunSteps(api): | 261 def RunSteps(api): |
| 259 with api.tryserver.set_failure_hash(): | 262 with api.tryserver.set_failure_hash(): |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 'gtest_tests': ['base_unittests'], | 332 'gtest_tests': ['base_unittests'], |
| 330 }})) + | 333 }})) + |
| 331 api.override_step_data( | 334 api.override_step_data( |
| 332 'analyze', | 335 'analyze', |
| 333 api.json.output({ | 336 api.json.output({ |
| 334 'status': 'Found dependency', | 337 'status': 'Found dependency', |
| 335 'test_targets': ['net_unittests'], | 338 'test_targets': ['net_unittests'], |
| 336 'compile_targets': ['net_unittests'], | 339 'compile_targets': ['net_unittests'], |
| 337 })) | 340 })) |
| 338 ) | 341 ) |
| OLD | NEW |