Chromium Code Reviews| 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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.get('mastername') |
| 207 buildername = api.properties.get('buildername') | 207 buildername = api.properties.get('buildername') |
| 208 bot_config = get_bot_config(mastername, buildername) | 208 bot_config = get_bot_config(mastername, buildername) |
| 209 additional_trybot_mirrors = bot_config.get('additional_mirrors') | |
| 209 | 210 |
| 210 # 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 |
| 211 # 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 |
| 212 # 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. |
| 213 master = api.properties['mastername'] | 214 master = api.properties['mastername'] |
| 214 builder = api.properties['buildername'] | 215 builder = api.properties['buildername'] |
| 215 enable_gpu_tests = builder in CHROMIUM_GPU_DIMENSION_SETS.get(master, {}) | 216 enable_gpu_tests = builder in CHROMIUM_GPU_DIMENSION_SETS.get(master, {}) |
| 216 | 217 |
| 217 api.chromium_tests.configure_build( | 218 api.chromium_tests.configure_build( |
| 218 bot_config['mastername'], | 219 bot_config['mastername'], |
| 219 bot_config['buildername'], | 220 bot_config['buildername'], |
| 221 additional_trybot_mirrors, | |
| 220 override_bot_type='builder_tester') | 222 override_bot_type='builder_tester') |
| 221 | 223 |
| 222 api.chromium_tests.configure_swarming('chromium', precommit=True) | 224 api.chromium_tests.configure_swarming('chromium', precommit=True) |
| 223 | 225 |
| 224 api.chromium.apply_config('trybot_flavor') | 226 api.chromium.apply_config('trybot_flavor') |
| 227 # TODO(kbr): the "optional" flag is only being used during the | |
| 228 # transition from the GPU recipe to the Chromium recipe. | |
| 225 if enable_gpu_tests: | 229 if enable_gpu_tests: |
| 226 api.chromium.apply_config('archive_gpu_tests') | 230 api.chromium.apply_config('archive_gpu_tests', optional=True) |
| 227 api.chromium.apply_config('chrome_with_codecs') | 231 api.chromium.apply_config('chrome_with_codecs', optional=True) |
| 228 | 232 |
| 229 if api.properties.get('patch_project') == 'blink': # pragma: no cover | 233 if api.properties.get('patch_project') == 'blink': # pragma: no cover |
| 230 raise Exception('CLs which use blink project are not supported. ' | 234 raise Exception('CLs which use blink project are not supported. ' |
| 231 'Please re-create the CL using fresh checkout after ' | 235 'Please re-create the CL using fresh checkout after ' |
| 232 'the blink merge.') | 236 'the blink merge.') |
| 233 | 237 |
| 234 bot_update_step, master_dict, test_spec = \ | 238 bot_update_step, master_dicts, test_specs = \ |
| 235 api.chromium_tests.prepare_checkout( | 239 api.chromium_tests.prepare_checkout( |
| 236 bot_config['mastername'], | 240 bot_config['mastername'], |
| 237 bot_config['buildername']) | 241 bot_config['buildername'], |
| 242 additional_trybot_mirrors) | |
| 238 | 243 |
| 239 tests = list(api.chromium_tests.tests_for_builder( | 244 tests = list(api.chromium_tests.tests_for_builder( |
| 240 bot_config['mastername'], | 245 bot_config['mastername'], |
| 241 bot_config['buildername'], | 246 bot_config['buildername'], |
| 242 bot_update_step, | 247 bot_update_step, |
| 243 master_dict, | 248 master_dicts[0], |
| 244 override_bot_type='builder_tester')) | 249 override_bot_type='builder_tester')) |
| 245 tester = bot_config.get('tester', '') | 250 tester = bot_config.get('tester', '') |
| 246 if tester: | 251 if tester: |
| 247 test_config = master_dict.get('builders', {}).get(tester) | 252 test_config = master_dicts[0].get('builders', {}).get(tester) |
| 248 for key, value in test_config.get('swarming_dimensions', {}).iteritems(): | 253 for key, value in test_config.get('swarming_dimensions', {}).iteritems(): |
| 249 api.swarming.set_default_dimension(key, value) | 254 api.swarming.set_default_dimension(key, value) |
| 250 tests.extend(api.chromium_tests.tests_for_builder( | 255 tests.extend(api.chromium_tests.tests_for_builder( |
| 251 bot_config['mastername'], | 256 bot_config['mastername'], |
| 252 tester, | 257 tester, |
| 253 bot_update_step, | 258 bot_update_step, |
| 254 master_dict, | 259 master_dicts[0], |
| 255 override_bot_type='builder_tester')) | 260 override_bot_type='builder_tester')) |
| 261 if additional_trybot_mirrors: | |
| 262 i = 1 | |
| 263 for mirror in additional_trybot_mirrors: | |
|
Sergey Berezin
2016/01/06 01:50:56
nit: if tests_for_builder() takes master_dicts and
| |
| 264 tests.extend(api.chromium_tests.tests_for_builder( | |
| 265 mirror['mastername'], | |
| 266 mirror['buildername'], | |
| 267 bot_update_step, | |
| 268 master_dicts[i], | |
| 269 override_bot_type='builder_tester')) | |
| 270 tester = mirror.get('tester', '') | |
| 271 if tester: | |
| 272 tests.extend(api.chromium_tests.tests_for_builder( | |
| 273 mirror['mastername'], | |
| 274 tester, | |
| 275 bot_update_step, | |
| 276 master_dicts[i], | |
| 277 override_bot_type='builder_tester')) | |
| 278 i += 1 | |
| 256 | 279 |
| 257 if enable_gpu_tests: | 280 if enable_gpu_tests: |
| 258 tests.extend(api.gpu.create_tests( | 281 tests.extend(api.gpu.create_tests( |
| 259 bot_update_step.presentation.properties['got_revision'], | 282 bot_update_step.presentation.properties['got_revision'], |
| 260 bot_update_step.presentation.properties['got_revision'], | 283 bot_update_step.presentation.properties['got_revision'], |
| 261 enable_swarming=True, | 284 enable_swarming=True, |
| 262 swarming_dimension_sets=CHROMIUM_GPU_DIMENSION_SETS[master][builder])) | 285 swarming_dimension_sets=CHROMIUM_GPU_DIMENSION_SETS[master][builder])) |
| 263 | 286 |
| 264 affected_files = api.tryserver.get_files_affected_by_patch() | 287 affected_files = api.tryserver.get_files_affected_by_patch() |
| 265 | 288 |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 290 api.chromium_tests.steps.GTestTest('blink_heap_unittests'), | 313 api.chromium_tests.steps.GTestTest('blink_heap_unittests'), |
| 291 api.chromium_tests.steps.GTestTest('blink_platform_unittests'), | 314 api.chromium_tests.steps.GTestTest('blink_platform_unittests'), |
| 292 api.chromium_tests.steps.GTestTest('webkit_unit_tests'), | 315 api.chromium_tests.steps.GTestTest('webkit_unit_tests'), |
| 293 api.chromium_tests.steps.GTestTest('wtf_unittests'), | 316 api.chromium_tests.steps.GTestTest('wtf_unittests'), |
| 294 ]) | 317 ]) |
| 295 | 318 |
| 296 compile_targets, tests_including_triggered = \ | 319 compile_targets, tests_including_triggered = \ |
| 297 api.chromium_tests.get_compile_targets_and_tests( | 320 api.chromium_tests.get_compile_targets_and_tests( |
| 298 bot_config['mastername'], | 321 bot_config['mastername'], |
| 299 bot_config['buildername'], | 322 bot_config['buildername'], |
| 300 master_dict, | 323 master_dicts, |
| 301 test_spec, | 324 additional_trybot_mirrors, |
| 325 test_specs, | |
| 302 override_bot_type='builder_tester', | 326 override_bot_type='builder_tester', |
| 303 override_tests=tests) | 327 override_tests=tests) |
| 304 | 328 |
| 305 test_targets = sorted(set( | 329 test_targets = sorted(set( |
| 306 all_compile_targets(api, tests + tests_including_triggered))) | 330 all_compile_targets(api, tests + tests_including_triggered))) |
| 307 additional_compile_targets = sorted(set(compile_targets) - | 331 additional_compile_targets = sorted(set(compile_targets) - |
| 308 set(test_targets)) | 332 set(test_targets)) |
| 309 test_targets, compile_targets = \ | 333 test_targets, compile_targets = \ |
| 310 api.chromium_tests.analyze(affected_files, | 334 api.chromium_tests.analyze(affected_files, |
| 311 test_targets, | 335 test_targets, |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 338 tests.extend(blink_tests) | 362 tests.extend(blink_tests) |
| 339 tests_including_triggered.extend(blink_tests) | 363 tests_including_triggered.extend(blink_tests) |
| 340 for test in blink_tests: | 364 for test in blink_tests: |
| 341 compile_targets.extend(test.compile_targets(api)) | 365 compile_targets.extend(test.compile_targets(api)) |
| 342 compile_targets = sorted(set(compile_targets)) | 366 compile_targets = sorted(set(compile_targets)) |
| 343 | 367 |
| 344 api.chromium_tests.compile_specific_targets( | 368 api.chromium_tests.compile_specific_targets( |
| 345 bot_config['mastername'], | 369 bot_config['mastername'], |
| 346 bot_config['buildername'], | 370 bot_config['buildername'], |
| 347 bot_update_step, | 371 bot_update_step, |
| 348 master_dict, | 372 master_dicts, |
| 349 compile_targets, | 373 compile_targets, |
| 350 tests_including_triggered, | 374 tests_including_triggered, |
| 351 override_bot_type='builder_tester') | 375 override_bot_type='builder_tester') |
| 352 else: | 376 else: |
| 353 # Even though the patch doesn't require a compile on this platform, | 377 # Even though the patch doesn't require a compile on this platform, |
| 354 # we'd still like to run tests not depending on | 378 # we'd still like to run tests not depending on |
| 355 # compiled targets (that's obviously not covered by the | 379 # compiled targets (that's obviously not covered by the |
| 356 # 'analyze' step) if any source files change. | 380 # 'analyze' step) if any source files change. |
| 357 if any([is_source_file(api, f) for f in affected_files]): | 381 if any([is_source_file(api, f) for f in affected_files]): |
| 358 tests = [t for t in tests if not t.compile_targets(api)] | 382 tests = [t for t in tests if not t.compile_targets(api)] |
| (...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1076 api.test_utils.canned_test_output(passing=True)) | 1100 api.test_utils.canned_test_output(passing=True)) |
| 1077 ) | 1101 ) |
| 1078 | 1102 |
| 1079 yield ( | 1103 yield ( |
| 1080 api.test('use_v8_patch_on_blink_trybot') + | 1104 api.test('use_v8_patch_on_blink_trybot') + |
| 1081 props(mastername='tryserver.blink', | 1105 props(mastername='tryserver.blink', |
| 1082 buildername='mac_blink_rel', | 1106 buildername='mac_blink_rel', |
| 1083 patch_project='v8') + | 1107 patch_project='v8') + |
| 1084 api.platform.name('mac') | 1108 api.platform.name('mac') |
| 1085 ) | 1109 ) |
| OLD | NEW |