Index: scripts/slave/recipes/chromium_trybot.py |
diff --git a/scripts/slave/recipes/chromium_trybot.py b/scripts/slave/recipes/chromium_trybot.py |
index 49067b387728659cfd6cb8a764c076711fae5d73..05dfc0284b8b4048f9aabcc5a6cb47b38c1dd2b1 100644 |
--- a/scripts/slave/recipes/chromium_trybot.py |
+++ b/scripts/slave/recipes/chromium_trybot.py |
@@ -88,6 +88,21 @@ def all_compile_targets(api, tests): |
for test in tests |
for x in test.compile_targets(api))) |
+def _get_files_affected_by_patch(api): |
Paweł Hajdan Jr.
2016/05/02 09:29:02
Could you move this to chromium_tests recipe modul
tandrii(chromium)
2016/05/02 09:51:18
Done.
|
+ """Returns list of posix paths relative to 'src'.""" |
+ patch_root = api.gclient.calculate_patch_root( |
+ api.properties.get('patch_project')) |
+ affected_files = map(str, |
+ api.tryserver.get_files_affected_by_patch(patch_root)) |
+ |
+ # patch_root includes src and affected_files are now relative to patch_root. |
Paweł Hajdan Jr.
2016/05/02 09:29:02
Can we make this more generic? When moved to chrom
tandrii(chromium)
2016/05/02 09:51:18
Hm, not quite sure I understood you, but see what
|
+ # "analyze" wants these relative to 'src'. |
+ assert str(patch_root).startswith('src') |
+ for i, path in enumerate(affected_files): |
+ assert path.startswith('src/') |
+ affected_files[i] = path[len('src/'):] |
+ return affected_files |
+ |
def is_source_file(api, filepath): |
"""Returns true iff the file is a source file.""" |
@@ -127,7 +142,7 @@ def _RunStepsInternal(api): |
tests.extend(additional_tests) |
tests_including_triggered.extend(additional_tests) |
- affected_files = api.tryserver.get_files_affected_by_patch() |
+ affected_files = _get_files_affected_by_patch(api) |
affects_blink_paths = False |
for path in CHROMIUM_BLINK_TESTS_PATHS: |