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

Unified Diff: scripts/slave/recipe_modules/auto_bisect/bisector.py

Issue 1062583003: Adding config step to output the bisect config dictionary. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@hax
Patch Set: Sorting keys. Created 5 years, 9 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/recipe_modules/auto_bisect/example.expected/bad_deps_syntax.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/slave/recipe_modules/auto_bisect/bisector.py
diff --git a/scripts/slave/recipe_modules/auto_bisect/bisector.py b/scripts/slave/recipe_modules/auto_bisect/bisector.py
index 922557f4a4017f32010349ffc193f7ad9eccabba..e88109cce4d5919053ba0d36f04e283e0f3fba8e 100644
--- a/scripts/slave/recipe_modules/auto_bisect/bisector.py
+++ b/scripts/slave/recipe_modules/auto_bisect/bisector.py
@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import json
import re
from . import bisect_results
@@ -32,6 +33,7 @@ class Bisector(object):
super(Bisector, self).__init__()
self._api = api
self.bisect_config = bisect_config
+ self.config_step()
self.revision_class = revision_class
# Test-only properties.
@@ -71,6 +73,24 @@ class Bisector(object):
if init_revisions:
self._expand_revision_range()
+ def config_step(self):
+ """Yields a simple echo step that outputs the bisect config."""
+ api = self.api
+ # bisect_config may come as a FrozenDict (which is not serializable).
+ bisect_config = dict(self.bisect_config)
+
+ def fix_windows_backslashes(s):
+ backslash_regex = re.compile(r'(?<!\\)\\(?!\\)')
+ return backslash_regex.sub(r'\\', s)
+
+ for k, v in bisect_config.iteritems():
+ if isinstance(v, basestring):
+ bisect_config[k] = fix_windows_backslashes(v)
+ # We sort the keys to prevent problems with orders changing when
+ # recipe_simulation_test compares against expectation files.
+ api.m.step('config', ['echo', json.dumps(bisect_config, indent=2,
+ sort_keys=True)])
+
@property
def api(self):
return self._api
« no previous file with comments | « no previous file | scripts/slave/recipe_modules/auto_bisect/example.expected/bad_deps_syntax.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698