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

Unified Diff: scripts/slave/recipes/findit/chromium/compile.py

Issue 1615963005: [Findit] Refactoring compile recipe return results into report dict instead of list (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build@master
Patch Set: Fixing whitespace 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | scripts/slave/recipes/findit/chromium/compile.expected/compile_affected_targets_only.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/slave/recipes/findit/chromium/compile.py
diff --git a/scripts/slave/recipes/findit/chromium/compile.py b/scripts/slave/recipes/findit/chromium/compile.py
index ef3a929ca8c3fb03ba89949f96645f978e2b3738..60ee6ebb7d2b5bddd3ef6a2de3186216ed7fa6c2 100644
--- a/scripts/slave/recipes/findit/chromium/compile.py
+++ b/scripts/slave/recipes/findit/chromium/compile.py
@@ -10,15 +10,15 @@ from recipe_engine.recipe_api import Property
DEPS = [
- 'chromium',
- 'chromium_tests',
- 'findit',
- 'gclient',
- 'recipe_engine/json',
- 'recipe_engine/path',
- 'recipe_engine/properties',
- 'recipe_engine/python',
- 'recipe_engine/step',
+ 'chromium',
+ 'chromium_tests',
+ 'findit',
+ 'gclient',
+ 'recipe_engine/json',
+ 'recipe_engine/path',
+ 'recipe_engine/properties',
+ 'recipe_engine/python',
+ 'recipe_engine/step',
]
@@ -52,10 +52,8 @@ def _run_compile_at_revision(api, target_mastername, target_buildername,
# Checkout code at the given revision to recompile.
bot_config = api.chromium_tests.create_bot_config_object(
target_mastername, target_buildername)
- bot_update_step, bot_db = \
- api.chromium_tests.prepare_checkout(
- bot_config,
- root_solution_revision=revision)
+ bot_update_step, bot_db = api.chromium_tests.prepare_checkout(
+ bot_config, root_solution_revision=revision)
# TODO(http://crbug.com/560991): if compile targets are provided, check
# whether they exist and then use analyze to compile the impacted ones by
@@ -114,34 +112,48 @@ def RunSteps(api, target_mastername, target_buildername,
root_solution_revision=bad_revision)
revisions_to_check = api.findit.revisions_between(good_revision, bad_revision)
- results = []
+ compile_results = {}
+ try_job_metadata = {
+ 'regression_range_size': len(revisions_to_check)
+ }
+ report = {
+ 'result': compile_results,
+ 'metadata': try_job_metadata,
+ }
+
try:
for current_revision in revisions_to_check:
+ last_revision = None
compile_result = _run_compile_at_revision(
api, target_mastername, target_buildername,
current_revision, requested_compile_targets, use_analyze)
- results.append([current_revision, compile_result])
+ compile_results[current_revision] = compile_result
+ last_revision = current_revision
if compile_result == CompileResult.FAILED:
# TODO(http://crbug.com/560991): if compile targets are specified,
# compile may fail because those targets are added in a later revision.
- break # Found the culprit, no need to check later revisions.
+ break # Found the culprit, no need to check later revisions.
finally:
# Report the result.
# TODO(http://crbug.com/563807): use api.python.succeeding_step instead.
step_result = api.python.inline(
'report', 'import sys; sys.exit(0)', add_python_log=False)
+
if (not requested_compile_targets and
- results and results[-1][1] == CompileResult.FAILED):
- step_result.presentation.step_text = '<br/>Culprit: %s' % results[-1][0]
+ compile_results and
+ last_revision and
+ compile_results.get(last_revision) == CompileResult.FAILED):
+ step_result.presentation.step_text = '<br/>Culprit: %s' % last_revision
+
step_result.presentation.logs.setdefault('result', []).append(
- json.dumps(results, indent=2))
+ json.dumps(report, indent=2))
# Set the result as a build property too, so that it will be reported back
# to Buildbucket and Findit will pull from there instead of buildbot master.
- step_result.presentation.properties['result'] = results
+ step_result.presentation.properties['result'] = report
- return results
+ return report
def GenTests(api):
@@ -171,11 +183,11 @@ def GenTests(api):
props() +
api.override_step_data('test r1.read test spec',
api.json.output({
- 'Linux Builder': {
- 'additional_compile_targets': [
- 'base_unittests',
- ],
- }
+ 'Linux Builder': {
+ 'additional_compile_targets': [
+ 'base_unittests',
+ ],
+ }
}))
)
@@ -226,12 +238,12 @@ def GenTests(api):
props(use_analyze=True) +
api.override_step_data('test r1.read test spec',
api.json.output({
- 'Linux Builder': {
- 'additional_compile_targets': [
- 'a', 'a_run',
- 'b', 'b_run',
- ],
- }
+ 'Linux Builder': {
+ 'additional_compile_targets': [
+ 'a', 'a_run',
+ 'b', 'b_run',
+ ],
+ }
})) +
api.override_step_data(
'test r1.analyze',
« no previous file with comments | « no previous file | scripts/slave/recipes/findit/chromium/compile.expected/compile_affected_targets_only.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698