Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Unified Diff: scripts/slave/recipes/chromium_trybot.py

Issue 1287723002: Run tests that do not have any compile targets if source files change. Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | scripts/slave/recipes/chromium_trybot.expected/full_tryserver_chromium_linux_android_coverage_analyze.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | scripts/slave/recipes/chromium_trybot.expected/full_tryserver_chromium_linux_android_coverage_analyze.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698