Index: scripts/slave/recipes/chromium_trybot.py |
diff --git a/scripts/slave/recipes/chromium_trybot.py b/scripts/slave/recipes/chromium_trybot.py |
index 3a5cf04dcc2237ef90459640e607ef135883d578..6b98c1cee3ef177b443c027a2cd924f3ee381e49 100644 |
--- a/scripts/slave/recipes/chromium_trybot.py |
+++ b/scripts/slave/recipes/chromium_trybot.py |
@@ -453,6 +453,11 @@ def all_compile_targets(api, tests): |
for test in tests |
for x in test.compile_targets(api))) |
+def is_source_file(api, filepath): |
+ """Returns true iff the file is a source file.""" |
+ _, ext = api.path.splitext(filepath) |
+ return ext in ['.c', '.cc', '.cpp', '.h', '.java', '.mm'] |
+ |
def _RunStepsInternal(api): |
def get_bot_config(mastername, buildername): |
@@ -556,21 +561,25 @@ def _RunStepsInternal(api): |
# trying to isolate the tests. Also see above comment. |
compile_targets = sorted(set(compile_targets + matching_exes)) |
- if not requires_compile: |
- return |
- |
- tests = tests_in_compile_targets(api, matching_exes, tests) |
- tests_including_triggered = tests_in_compile_targets( |
- api, matching_exes, tests_including_triggered) |
+ if requires_compile: |
+ tests = tests_in_compile_targets(api, matching_exes, tests) |
+ tests_including_triggered = tests_in_compile_targets( |
+ api, matching_exes, tests_including_triggered) |
- api.chromium_tests.compile_specific_targets( |
- bot_config['mastername'], |
- bot_config['buildername'], |
- bot_update_step, |
- master_dict, |
- 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, |
+ compile_targets, |
+ tests_including_triggered, |
+ override_bot_type='builder_tester') |
+ else: |
+ # Even though the patch doesn't 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)] |
if not tests: |
return |