Index: scripts/slave/recipes/chromium_trybot.py |
diff --git a/scripts/slave/recipes/chromium_trybot.py b/scripts/slave/recipes/chromium_trybot.py |
index 5225d0483986dd1bb7642230d12646ac4cb6f409..ae234d9574625ac684b132871bae2997b5719092 100644 |
--- a/scripts/slave/recipes/chromium_trybot.py |
+++ b/scripts/slave/recipes/chromium_trybot.py |
@@ -284,6 +284,12 @@ def all_compile_targets(api, tests): |
for x in test.compile_targets(api))) |
+def is_source_file(api, file): |
+ """Returns true iff the file is a source file.""" |
+ _, ext = api.path.splitext(file) |
+ return ext in [".cc", ".cpp", ".h", ".java", ".mm"] |
+ |
+ |
def _GenStepsInternal(api): |
def get_bot_config(mastername, buildername): |
master_dict = BUILDERS.get(mastername, {}) |
@@ -359,22 +365,28 @@ def _GenStepsInternal(api): |
compile_targets, |
'trybot_analyze_config.json') |
- if not requires_compile: |
- return |
- |
- tests = tests_in_compile_targets(api, compile_targets, tests) |
- tests_including_triggered = tests_in_compile_targets( |
- api, compile_targets, tests_including_triggered) |
+ if requires_compile: |
+ tests = tests_in_compile_targets(api, compile_targets, tests) |
+ tests_including_triggered = tests_in_compile_targets( |
+ api, compile_targets, tests_including_triggered) |
- api.chromium_tests.compile_specific_targets( |
- bot_config['mastername'], |
- bot_config['buildername'], |
- bot_update_step, |
- master_dict, |
- test_spec, |
- compile_targets, |
- tests_including_triggered, |
- override_bot_type='builder_tester') |
+ api.chromium_tests.compile_specific_targets( |
+ bot_config['mastername'], |
+ bot_config['buildername'], |
+ bot_update_step, |
+ master_dict, |
+ test_spec, |
+ compile_targets, |
+ tests_including_triggered, |
+ override_bot_type='builder_tester') |
+ else: |
+ # Even though the patch doesn't require compile on this platform, we'd still |
+ # like to run tests not depending on compiled targets (that's obviously not |
+ # covered by the "analyze" step) if any source files change. |
+ if any([is_source_file(api, f) for f in affected_files]): |
+ tests = [t for t in tests if not t.compile_targets(api)] |
+ else: |
+ return |
luqui
2015/03/02 23:21:53
You could either add a test for it in GenTests (ge
jam
2015/03/04 15:16:41
right, i didn't know how to do the "somehow" part
luqui
2015/03/04 21:51:04
You could try
yield (api.test('...') +
|
def deapply_patch_fn(failing_tests): |
api.chromium_tests.deapply_patch(bot_update_step) |