| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 infra.libs.infra_types import freeze | 5 from infra.libs.infra_types import freeze |
| 6 | 6 |
| 7 DEPS = [ | 7 DEPS = [ |
| 8 'bot_update', | 8 'bot_update', |
| 9 'chromium', | 9 'chromium', |
| 10 'chromium_android', | 10 'chromium_android', |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 raise ValueError('Unrecognized entry in test spec: %r' % test) | 227 raise ValueError('Unrecognized entry in test spec: %r' % test) |
| 228 | 228 |
| 229 # Should skip it completely? | 229 # Should skip it completely? |
| 230 if not test_name or not should_use_test(test_dict): | 230 if not test_name or not should_use_test(test_dict): |
| 231 continue | 231 continue |
| 232 | 232 |
| 233 test_args = test_dict.get('args') | 233 test_args = test_dict.get('args') |
| 234 if isinstance(test_args, basestring): | 234 if isinstance(test_args, basestring): |
| 235 test_args = [test_args] | 235 test_args = [test_args] |
| 236 | 236 |
| 237 test = api.chromium.steps.GTestTest(test_name, test_args) | 237 test = api.chromium_tests.steps.GTestTest(test_name, test_args) |
| 238 assert not test.uses_swarming | 238 assert not test.uses_swarming |
| 239 | 239 |
| 240 gtest_tests.append(test) | 240 gtest_tests.append(test) |
| 241 | 241 |
| 242 return compile_targets, gtest_tests | 242 return compile_targets, gtest_tests |
| 243 | 243 |
| 244 def get_bot_config(mastername, buildername): | 244 def get_bot_config(mastername, buildername): |
| 245 master_dict = BUILDERS.get(mastername, {}) | 245 master_dict = BUILDERS.get(mastername, {}) |
| 246 return master_dict.get('builders', {}).get(buildername) | 246 return master_dict.get('builders', {}).get(buildername) |
| 247 | 247 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 compile_targets, gtest_tests = parse_test_spec( | 324 compile_targets, gtest_tests = parse_test_spec( |
| 325 test_spec, | 325 test_spec, |
| 326 should_use_test) | 326 should_use_test) |
| 327 compile_targets.extend(bot_config.get('compile_targets', [])) | 327 compile_targets.extend(bot_config.get('compile_targets', [])) |
| 328 # TODO(phajdan.jr): Also compile 'all' on win, http://crbug.com/368831 . | 328 # TODO(phajdan.jr): Also compile 'all' on win, http://crbug.com/368831 . |
| 329 # Disabled for now because it takes too long and/or fails on Windows. | 329 # Disabled for now because it takes too long and/or fails on Windows. |
| 330 if not api.platform.is_win and not bot_config.get('exclude_compile_all'): | 330 if not api.platform.is_win and not bot_config.get('exclude_compile_all'): |
| 331 compile_targets = ['all'] + compile_targets | 331 compile_targets = ['all'] + compile_targets |
| 332 | 332 |
| 333 scripts_compile_targets = \ | 333 scripts_compile_targets = \ |
| 334 api.chromium.get_compile_targets_for_scripts().json.output | 334 api.chromium_tests.get_compile_targets_for_scripts().json.output |
| 335 | 335 |
| 336 # Tests that are only run if their compile_targets are going to be built. | 336 # Tests that are only run if their compile_targets are going to be built. |
| 337 conditional_tests = [] | 337 conditional_tests = [] |
| 338 if bot_config.get('add_nacl_integration_tests', True): | 338 if bot_config.get('add_nacl_integration_tests', True): |
| 339 conditional_tests += [ | 339 conditional_tests += [ |
| 340 api.chromium.steps.ScriptTest( | 340 api.chromium_tests.steps.ScriptTest( |
| 341 'nacl_integration', 'nacl_integration.py', | 341 'nacl_integration', 'nacl_integration.py', |
| 342 scripts_compile_targets), | 342 scripts_compile_targets), |
| 343 ] | 343 ] |
| 344 if bot_config.get('add_telemetry_tests', True): | 344 if bot_config.get('add_telemetry_tests', True): |
| 345 conditional_tests += [ | 345 conditional_tests += [ |
| 346 api.chromium.steps.ScriptTest( | 346 api.chromium_tests.steps.ScriptTest( |
| 347 'telemetry_unittests', 'telemetry_unittests.py', | 347 'telemetry_unittests', 'telemetry_unittests.py', |
| 348 scripts_compile_targets), | 348 scripts_compile_targets), |
| 349 api.chromium.steps.ScriptTest( | 349 api.chromium_tests.steps.ScriptTest( |
| 350 'telemetry_perf_unittests', 'telemetry_perf_unittests.py', | 350 'telemetry_perf_unittests', 'telemetry_perf_unittests.py', |
| 351 scripts_compile_targets), | 351 scripts_compile_targets), |
| 352 ] | 352 ] |
| 353 | 353 |
| 354 # See if the patch needs to compile on the current platform. | 354 # See if the patch needs to compile on the current platform. |
| 355 if isinstance(test_spec, dict): | 355 if isinstance(test_spec, dict): |
| 356 analyze_config_file = bot_config['testing'].get('analyze_config_file', | 356 analyze_config_file = bot_config['testing'].get('analyze_config_file', |
| 357 'trybot_analyze_config.json') | 357 'trybot_analyze_config.json') |
| 358 requires_compile, matching_exes, compile_targets = \ | 358 requires_compile, matching_exes, compile_targets = \ |
| 359 api.chromium_tests.analyze( | 359 api.chromium_tests.analyze( |
| (...skipping 11 matching lines...) Expand all Loading... |
| 371 tests = [] | 371 tests = [] |
| 372 | 372 |
| 373 conditional_tests = tests_in_compile_targets( | 373 conditional_tests = tests_in_compile_targets( |
| 374 api, compile_targets, conditional_tests) | 374 api, compile_targets, conditional_tests) |
| 375 tests.extend(find_test_named('telemetry_unittests', conditional_tests)) | 375 tests.extend(find_test_named('telemetry_unittests', conditional_tests)) |
| 376 tests.extend(find_test_named('telemetry_perf_unittests', conditional_tests)) | 376 tests.extend(find_test_named('telemetry_perf_unittests', conditional_tests)) |
| 377 tests.extend(gtest_tests) | 377 tests.extend(gtest_tests) |
| 378 tests.extend(find_test_named('nacl_integration', conditional_tests)) | 378 tests.extend(find_test_named('nacl_integration', conditional_tests)) |
| 379 | 379 |
| 380 if api.platform.is_win: | 380 if api.platform.is_win: |
| 381 tests.append(api.chromium.steps.MiniInstallerTest()) | 381 tests.append(api.chromium_tests.steps.MiniInstallerTest()) |
| 382 | 382 |
| 383 # Swarming uses Isolate to transfer files to swarming bots. | 383 # Swarming uses Isolate to transfer files to swarming bots. |
| 384 # set_isolate_environment modifies GYP_DEFINES to enable test isolation. | 384 # set_isolate_environment modifies GYP_DEFINES to enable test isolation. |
| 385 if bot_config.get('use_isolate'): | 385 if bot_config.get('use_isolate'): |
| 386 api.isolate.set_isolate_environment(api.chromium.c) | 386 api.isolate.set_isolate_environment(api.chromium.c) |
| 387 | 387 |
| 388 try: | 388 try: |
| 389 api.chromium.runhooks(name='runhooks (with patch)') | 389 api.chromium.runhooks(name='runhooks (with patch)') |
| 390 except api.step.StepFailure: | 390 except api.step.StepFailure: |
| 391 # As part of deapplying patch we call runhooks without the patch. | 391 # As part of deapplying patch we call runhooks without the patch. |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 862 'test': 'base_tests', | 862 'test': 'base_tests', |
| 863 'args': ['--gtest-filter: *NaCl*.*'], | 863 'args': ['--gtest-filter: *NaCl*.*'], |
| 864 }, | 864 }, |
| 865 ], | 865 ], |
| 866 }) | 866 }) |
| 867 ) + | 867 ) + |
| 868 api.override_step_data( | 868 api.override_step_data( |
| 869 'analyze', | 869 'analyze', |
| 870 api.json.output({'invalid_targets': ['invalid target', 'another one']})) | 870 api.json.output({'invalid_targets': ['invalid target', 'another one']})) |
| 871 ) | 871 ) |
| OLD | NEW |