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

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

Issue 963263002: Run scripts which don't have any compile targets if any source files change. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build@master
Patch Set: Created 5 years, 10 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 | no next file » | 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 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)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698