| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 import collections | 5 import collections |
| 6 | 6 |
| 7 from recipe_engine.types import freeze | 7 from recipe_engine.types import freeze |
| 8 | 8 |
| 9 DEPS = [ | 9 DEPS = [ |
| 10 'amp', | 10 'amp', |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 def is_source_file(api, filepath): | 196 def is_source_file(api, filepath): |
| 197 """Returns true iff the file is a source file.""" | 197 """Returns true iff the file is a source file.""" |
| 198 _, ext = api.path.splitext(filepath) | 198 _, ext = api.path.splitext(filepath) |
| 199 return ext in ['.c', '.cc', '.cpp', '.h', '.java', '.mm'] | 199 return ext in ['.c', '.cc', '.cpp', '.h', '.java', '.mm'] |
| 200 | 200 |
| 201 def _RunStepsInternal(api): | 201 def _RunStepsInternal(api): |
| 202 def get_bot_config(mastername, buildername): | 202 def get_bot_config(mastername, buildername): |
| 203 master_dict = api.chromium_tests.trybots.get(mastername, {}) | 203 master_dict = api.chromium_tests.trybots.get(mastername, {}) |
| 204 return master_dict.get('builders', {}).get(buildername) | 204 return master_dict.get('builders', {}).get(buildername) |
| 205 | 205 |
| 206 mastername = api.properties.get('mastername') | 206 mastername = api.properties['mastername'] |
| 207 buildername = api.properties.get('buildername') | 207 buildername = api.properties['buildername'] |
| 208 bot_config = get_bot_config(mastername, buildername) | 208 bot_config = get_bot_config(mastername, buildername) |
| 209 api.chromium_tests.configure_swarming('chromium', precommit=True) | 209 api.chromium_tests.configure_swarming('chromium', precommit=True) |
| 210 | 210 |
| 211 # TODO(sergiyb): This is a temporary hack to run GPU tests on tryserver | 211 # TODO(sergiyb): This is a temporary hack to run GPU tests on tryserver |
| 212 # only. This should be removed when we will convert chromium.gpu waterfall | 212 # only. This should be removed when we will convert chromium.gpu waterfall |
| 213 # to swarming and be able to replicate the tests to tryserver automatically. | 213 # to swarming and be able to replicate the tests to tryserver automatically. |
| 214 master = api.properties['mastername'] | 214 enable_gpu_tests = (buildername in |
| 215 builder = api.properties['buildername'] | 215 CHROMIUM_GPU_DIMENSION_SETS.get(mastername, {})) |
| 216 enable_gpu_tests = builder in CHROMIUM_GPU_DIMENSION_SETS.get(master, {}) | |
| 217 | 216 |
| 218 api.chromium_tests.configure_build( | 217 api.chromium_tests.configure_build( |
| 219 bot_config['mastername'], | 218 bot_config['mastername'], |
| 220 bot_config['buildername'], | 219 bot_config['buildername'], |
| 221 override_bot_type='builder_tester') | 220 override_bot_type='builder_tester') |
| 222 | 221 |
| 223 api.chromium.apply_config('trybot_flavor') | 222 api.chromium.apply_config('trybot_flavor') |
| 224 if enable_gpu_tests: | 223 if enable_gpu_tests: |
| 225 api.chromium.apply_config('archive_gpu_tests') | 224 api.chromium.apply_config('archive_gpu_tests') |
| 226 | 225 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 250 tester, | 249 tester, |
| 251 bot_update_step, | 250 bot_update_step, |
| 252 master_dict, | 251 master_dict, |
| 253 override_bot_type='builder_tester')) | 252 override_bot_type='builder_tester')) |
| 254 | 253 |
| 255 if enable_gpu_tests: | 254 if enable_gpu_tests: |
| 256 tests.extend(api.gpu.create_tests( | 255 tests.extend(api.gpu.create_tests( |
| 257 bot_update_step.presentation.properties['got_revision'], | 256 bot_update_step.presentation.properties['got_revision'], |
| 258 bot_update_step.presentation.properties['got_revision'], | 257 bot_update_step.presentation.properties['got_revision'], |
| 259 enable_swarming=True, | 258 enable_swarming=True, |
| 260 swarming_dimension_sets=CHROMIUM_GPU_DIMENSION_SETS[master][builder])) | 259 swarming_dimension_sets=( |
| 260 CHROMIUM_GPU_DIMENSION_SETS[mastername][buildername]))) |
| 261 | 261 |
| 262 affected_files = api.tryserver.get_files_affected_by_patch() | 262 affected_files = api.tryserver.get_files_affected_by_patch() |
| 263 | 263 |
| 264 affects_blink_paths = False | 264 affects_blink_paths = False |
| 265 for path in CHROMIUM_BLINK_TESTS_PATHS: | 265 for path in CHROMIUM_BLINK_TESTS_PATHS: |
| 266 if any([f.startswith(path) for f in affected_files]): | 266 if any([f.startswith(path) for f in affected_files]): |
| 267 affects_blink_paths = True | 267 affects_blink_paths = True |
| 268 | 268 |
| 269 affects_blink = any([f.startswith('third_party/WebKit') | 269 affects_blink = any([f.startswith('third_party/WebKit') |
| 270 for f in affected_files]) | 270 for f in affected_files]) |
| (...skipping 30 matching lines...) Expand all Loading... |
| 301 override_tests=tests) | 301 override_tests=tests) |
| 302 | 302 |
| 303 test_targets = sorted(set( | 303 test_targets = sorted(set( |
| 304 all_compile_targets(api, tests + tests_including_triggered))) | 304 all_compile_targets(api, tests + tests_including_triggered))) |
| 305 additional_compile_targets = sorted(set(compile_targets) - | 305 additional_compile_targets = sorted(set(compile_targets) - |
| 306 set(test_targets)) | 306 set(test_targets)) |
| 307 test_targets, compile_targets = \ | 307 test_targets, compile_targets = \ |
| 308 api.chromium_tests.analyze(affected_files, | 308 api.chromium_tests.analyze(affected_files, |
| 309 test_targets, | 309 test_targets, |
| 310 additional_compile_targets, | 310 additional_compile_targets, |
| 311 'trybot_analyze_config.json') | 311 'trybot_analyze_config.json', |
| 312 mastername, |
| 313 buildername) |
| 312 | 314 |
| 313 if bot_config.get('analyze_mode') == 'compile': | 315 if bot_config.get('analyze_mode') == 'compile': |
| 314 tests = [] | 316 tests = [] |
| 315 tests_including_triggered = [] | 317 tests_including_triggered = [] |
| 316 | 318 |
| 317 # Blink tests have to bypass "analyze", see below. | 319 # Blink tests have to bypass "analyze", see below. |
| 318 if compile_targets or add_blink_tests: | 320 if compile_targets or add_blink_tests: |
| 319 tests = tests_in_compile_targets(api, test_targets, tests) | 321 tests = tests_in_compile_targets(api, test_targets, tests) |
| 320 tests_including_triggered = tests_in_compile_targets( | 322 tests_including_triggered = tests_in_compile_targets( |
| 321 api, test_targets, tests_including_triggered) | 323 api, test_targets, tests_including_triggered) |
| (...skipping 17 matching lines...) Expand all Loading... |
| 339 compile_targets.extend(test.compile_targets(api)) | 341 compile_targets.extend(test.compile_targets(api)) |
| 340 compile_targets = sorted(set(compile_targets)) | 342 compile_targets = sorted(set(compile_targets)) |
| 341 | 343 |
| 342 api.chromium_tests.compile_specific_targets( | 344 api.chromium_tests.compile_specific_targets( |
| 343 bot_config['mastername'], | 345 bot_config['mastername'], |
| 344 bot_config['buildername'], | 346 bot_config['buildername'], |
| 345 bot_update_step, | 347 bot_update_step, |
| 346 master_dict, | 348 master_dict, |
| 347 compile_targets, | 349 compile_targets, |
| 348 tests_including_triggered, | 350 tests_including_triggered, |
| 351 mb_mastername=mastername, |
| 352 mb_buildername=buildername, |
| 349 override_bot_type='builder_tester') | 353 override_bot_type='builder_tester') |
| 350 else: | 354 else: |
| 351 # Even though the patch doesn't require a compile on this platform, | 355 # Even though the patch doesn't require a compile on this platform, |
| 352 # we'd still like to run tests not depending on | 356 # we'd still like to run tests not depending on |
| 353 # compiled targets (that's obviously not covered by the | 357 # compiled targets (that's obviously not covered by the |
| 354 # 'analyze' step) if any source files change. | 358 # 'analyze' step) if any source files change. |
| 355 if any([is_source_file(api, f) for f in affected_files]): | 359 if any([is_source_file(api, f) for f in affected_files]): |
| 356 tests = [t for t in tests if not t.compile_targets(api)] | 360 tests = [t for t in tests if not t.compile_targets(api)] |
| 357 else: | 361 else: |
| 358 return | 362 return |
| 359 | 363 |
| 360 if not tests: | 364 if not tests: |
| 361 return | 365 return |
| 362 | 366 |
| 363 api.chromium_tests.run_tests_on_tryserver( | 367 api.chromium_tests.run_tests_on_tryserver( |
| 364 mastername, api, tests, bot_update_step, affected_files) | 368 mastername, api, tests, bot_update_step, affected_files, |
| 369 mb_mastername=mastername, mb_buildername=buildername) |
| 365 | 370 |
| 366 | 371 |
| 367 def RunSteps(api): | 372 def RunSteps(api): |
| 368 # build/tests/masters_recipes_tests.py needs to manipulate the BUILDERS | 373 # build/tests/masters_recipes_tests.py needs to manipulate the BUILDERS |
| 369 # dict, so we provide an API to dump it here. | 374 # dict, so we provide an API to dump it here. |
| 370 if api.properties.get('dump_builders'): # pragma: no cover | 375 if api.properties.get('dump_builders'): # pragma: no cover |
| 371 api.file.copy('Dump BUILDERS dict', | 376 api.file.copy('Dump BUILDERS dict', |
| 372 api.json.input(api.chromium_tests.trybots), | 377 api.json.input(api.chromium_tests.trybots), |
| 373 api.properties['dump_builders']) | 378 api.properties['dump_builders']) |
| 374 return | 379 return |
| (...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1110 api.test_utils.canned_test_output(passing=True)) | 1115 api.test_utils.canned_test_output(passing=True)) |
| 1111 ) | 1116 ) |
| 1112 | 1117 |
| 1113 yield ( | 1118 yield ( |
| 1114 api.test('use_v8_patch_on_blink_trybot') + | 1119 api.test('use_v8_patch_on_blink_trybot') + |
| 1115 props(mastername='tryserver.blink', | 1120 props(mastername='tryserver.blink', |
| 1116 buildername='mac_blink_rel', | 1121 buildername='mac_blink_rel', |
| 1117 patch_project='v8') + | 1122 patch_project='v8') + |
| 1118 api.platform.name('mac') | 1123 api.platform.name('mac') |
| 1119 ) | 1124 ) |
| OLD | NEW |