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 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 'telemetry_unittests', 'telemetry_unittests.py', | 432 'telemetry_unittests', 'telemetry_unittests.py', |
433 scripts_compile_targets), | 433 scripts_compile_targets), |
434 api.chromium.steps.ScriptTest( | 434 api.chromium.steps.ScriptTest( |
435 'telemetry_perf_unittests', 'telemetry_perf_unittests.py', | 435 'telemetry_perf_unittests', 'telemetry_perf_unittests.py', |
436 scripts_compile_targets), | 436 scripts_compile_targets), |
437 ] | 437 ] |
438 | 438 |
439 # See if the patch needs to compile on the current platform. | 439 # See if the patch needs to compile on the current platform. |
440 # Don't run analyze for other projects, such as blink, as there aren't that | 440 # Don't run analyze for other projects, such as blink, as there aren't that |
441 # many try jobs for them. | 441 # many try jobs for them. |
442 requires_compile = True | |
443 if (isinstance(test_spec, dict) and | 442 if (isinstance(test_spec, dict) and |
444 api.properties.get('patch_project') == 'chromium'): | 443 api.properties.get('patch_project') == 'chromium'): |
445 analyze_config_file = bot_config['testing'].get('analyze_config_file', | 444 analyze_config_file = bot_config['testing'].get('analyze_config_file', |
446 'trybot_analyze_config.json') | 445 'trybot_analyze_config.json') |
447 requires_compile, matching_exes, compile_targets = \ | 446 requires_compile, matching_exes, compile_targets = \ |
448 api.chromium_tests.analyze( | 447 api.chromium_tests.analyze( |
449 get_test_names(gtest_tests) + | 448 get_test_names(gtest_tests) + |
450 all_compile_targets(api, conditional_tests), | 449 all_compile_targets(api, conditional_tests), |
451 compile_targets, | 450 compile_targets, |
452 analyze_config_file) | 451 analyze_config_file) |
453 | 452 |
| 453 if not requires_compile: |
| 454 return [], bot_update_step |
| 455 |
454 gtest_tests = filter_tests(gtest_tests, matching_exes) | 456 gtest_tests = filter_tests(gtest_tests, matching_exes) |
455 | 457 |
456 tests = [] | 458 tests = [] |
457 | 459 |
458 conditional_tests = tests_in_compile_targets( | 460 conditional_tests = tests_in_compile_targets( |
459 api, compile_targets, conditional_tests) | 461 api, compile_targets, conditional_tests) |
460 tests.extend(find_test_named('telemetry_unittests', conditional_tests)) | 462 tests.extend(find_test_named('telemetry_unittests', conditional_tests)) |
461 tests.extend(find_test_named('telemetry_perf_unittests', conditional_tests)) | 463 tests.extend(find_test_named('telemetry_perf_unittests', conditional_tests)) |
462 tests.extend(gtest_tests) | 464 tests.extend(gtest_tests) |
463 tests.extend(find_test_named('nacl_integration', conditional_tests)) | 465 tests.extend(find_test_named('nacl_integration', conditional_tests)) |
464 | 466 |
465 if api.platform.is_win: | 467 if api.platform.is_win: |
466 tests.append(api.chromium.steps.MiniInstallerTest()) | 468 tests.append(api.chromium.steps.MiniInstallerTest()) |
467 | 469 |
468 if not requires_compile: | |
469 # Even though the patch doesn't require compile, we'd still like to | |
470 # run tests not depending on compiled targets (that's obviously not | |
471 # covered by the "analyze" step). | |
472 tests = [t for t in tests if not t.compile_targets(api)] | |
473 return tests, bot_update_step | |
474 | |
475 has_swarming_tests = any(t.uses_swarming for t in tests) | 470 has_swarming_tests = any(t.uses_swarming for t in tests) |
476 | 471 |
477 # Swarming uses Isolate to transfer files to swarming bots. | 472 # Swarming uses Isolate to transfer files to swarming bots. |
478 # set_isolate_environment modifies GYP_DEFINES to enable test isolation. | 473 # set_isolate_environment modifies GYP_DEFINES to enable test isolation. |
479 if bot_config.get('use_isolate') or has_swarming_tests: | 474 if bot_config.get('use_isolate') or has_swarming_tests: |
480 api.isolate.set_isolate_environment(api.chromium.c) | 475 api.isolate.set_isolate_environment(api.chromium.c) |
481 | 476 |
482 # If going to use swarming_client (pinned in src/DEPS), ensure it is | 477 # If going to use swarming_client (pinned in src/DEPS), ensure it is |
483 # compatible with what recipes expect. | 478 # compatible with what recipes expect. |
484 if has_swarming_tests: | 479 if has_swarming_tests: |
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
994 'test': 'base_tests', | 989 'test': 'base_tests', |
995 'args': ['--gtest-filter: *NaCl*.*'], | 990 'args': ['--gtest-filter: *NaCl*.*'], |
996 }, | 991 }, |
997 ], | 992 ], |
998 }) | 993 }) |
999 ) + | 994 ) + |
1000 api.override_step_data( | 995 api.override_step_data( |
1001 'analyze', | 996 'analyze', |
1002 api.json.output({'invalid_targets': ['invalid target', 'another one']})) | 997 api.json.output({'invalid_targets': ['invalid target', 'another one']})) |
1003 ) | 998 ) |
OLD | NEW |