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

Side by Side Diff: scripts/slave/recipes/findit/chromium/compile.py

Issue 1554383003: Add support for "additional_mirrors" property in trybot configs. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Created 4 years, 11 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 unified diff | Download patch
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import json 5 import json
6 6
7 from recipe_engine.config import List 7 from recipe_engine.config import List
8 from recipe_engine.config import Single 8 from recipe_engine.config import Single
9 from recipe_engine.recipe_api import Property 9 from recipe_engine.recipe_api import Property
10 10
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 class CompileResult(object): 43 class CompileResult(object):
44 SKIPPED = 'skipped' # No compile is needed. 44 SKIPPED = 'skipped' # No compile is needed.
45 PASSED = 'passed' # Compile passed. 45 PASSED = 'passed' # Compile passed.
46 FAILED = 'failed' # Compile failed. 46 FAILED = 'failed' # Compile failed.
47 47
48 48
49 def _run_compile_at_revision(api, target_mastername, target_buildername, 49 def _run_compile_at_revision(api, target_mastername, target_buildername,
50 revision, compile_targets, use_analyze): 50 revision, compile_targets, use_analyze):
51 with api.step.nest('test %s' % str(revision)): 51 with api.step.nest('test %s' % str(revision)):
52 # Checkout code at the given revision to recompile. 52 # Checkout code at the given revision to recompile.
53 bot_update_step, master_dict, test_spec = \ 53 bot_update_step, master_dicts, test_specs = \
54 api.chromium_tests.prepare_checkout( 54 api.chromium_tests.prepare_checkout(
55 target_mastername, 55 target_mastername,
56 target_buildername, 56 target_buildername,
57 root_solution_revision=revision) 57 root_solution_revision=revision)
58 58
59 # TODO(http://crbug.com/560991): if compile targets are provided, check 59 # TODO(http://crbug.com/560991): if compile targets are provided, check
60 # whether they exist and then use analyze to compile the impacted ones by 60 # whether they exist and then use analyze to compile the impacted ones by
61 # the given revision. 61 # the given revision.
62 compile_targets = sorted(set(compile_targets or [])) 62 compile_targets = sorted(set(compile_targets or []))
63 if not compile_targets: 63 if not compile_targets:
64 compile_targets, _ = api.chromium_tests.get_compile_targets_and_tests( 64 compile_targets, _ = api.chromium_tests.get_compile_targets_and_tests(
65 target_mastername, 65 target_mastername,
66 target_buildername, 66 target_buildername,
67 master_dict, 67 master_dicts,
68 test_spec, 68 None,
69 test_specs,
69 override_bot_type='builder_tester') 70 override_bot_type='builder_tester')
70 71
71 if use_analyze: 72 if use_analyze:
72 changed_files = api.findit.files_changed_by_revision(revision) 73 changed_files = api.findit.files_changed_by_revision(revision)
73 74
74 _, compile_targets = api.chromium_tests.analyze( 75 _, compile_targets = api.chromium_tests.analyze(
75 changed_files, 76 changed_files,
76 test_targets=[], 77 test_targets=[],
77 additional_compile_targets=compile_targets, 78 additional_compile_targets=compile_targets,
78 config_file_name='trybot_analyze_config.json', 79 config_file_name='trybot_analyze_config.json',
79 mb_mastername=target_mastername, 80 mb_mastername=target_mastername,
80 mb_buildername=target_buildername, 81 mb_buildername=target_buildername,
81 additional_names=None) 82 additional_names=None)
82 83
83 if not compile_targets: 84 if not compile_targets:
84 # No compile target is impacted by the given revision. 85 # No compile target is impacted by the given revision.
85 return CompileResult.SKIPPED 86 return CompileResult.SKIPPED
86 87
87 try: 88 try:
88 api.chromium_tests.compile_specific_targets( 89 api.chromium_tests.compile_specific_targets(
89 target_mastername, 90 target_mastername,
90 target_buildername, 91 target_buildername,
91 bot_update_step, 92 bot_update_step,
92 master_dict, 93 master_dicts,
93 compile_targets, 94 compile_targets,
94 tests_including_triggered=[], 95 tests_including_triggered=[],
95 mb_mastername=target_mastername, 96 mb_mastername=target_mastername,
96 mb_buildername=target_buildername, 97 mb_buildername=target_buildername,
97 override_bot_type='builder_tester') 98 override_bot_type='builder_tester')
98 return CompileResult.PASSED 99 return CompileResult.PASSED
99 except api.step.InfraFailure: 100 except api.step.InfraFailure:
100 raise 101 raise
101 except api.step.StepFailure: 102 except api.step.StepFailure:
102 return CompileResult.FAILED 103 return CompileResult.FAILED
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 })) + 236 })) +
236 api.override_step_data( 237 api.override_step_data(
237 'test r1.analyze', 238 'test r1.analyze',
238 api.json.output({ 239 api.json.output({
239 'status': 'Found dependency', 240 'status': 'Found dependency',
240 'compile_targets': ['a', 'a_run'], 241 'compile_targets': ['a', 'a_run'],
241 'test_targets': ['a', 'a_run'], 242 'test_targets': ['a', 'a_run'],
242 }) 243 })
243 ) 244 )
244 ) 245 )
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698