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

Side by Side Diff: scripts/slave/recipe_modules/bot_update/test_api.py

Issue 1151423002: Move recipe engine to third_party/recipe_engine. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Copyright notices Created 5 years, 7 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 | Annotate | Revision Log
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 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 hashlib 5 import hashlib
6 import struct 6 import struct
7 7
8 from slave import bot_update 8 from .resources import bot_update
9 from slave import recipe_test_api 9 from recipe_engine import recipe_test_api
10 10
11 11
12 class BotUpdateTestApi(recipe_test_api.RecipeTestApi): 12 class BotUpdateTestApi(recipe_test_api.RecipeTestApi):
13 def output_json(self, master, builder, slave, root, first_sln, 13 def output_json(self, master, builder, slave, root, first_sln,
14 revision_mapping, git_mode, force=False, fail_patch=False, 14 revision_mapping, git_mode, force=False, fail_patch=False,
15 output_manifest=False): 15 output_manifest=False):
16 """Deterministically synthesize json.output test data for gclient's 16 """Deterministically synthesize json.output test data for gclient's
17 --output-json option. 17 --output-json option.
18 """ 18 """
19 active = bot_update.check_valid_host(master, builder, slave) or force 19 active = bot_update.check_valid_host(master, builder, slave) or force
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 return self.m.json.output(output) 67 return self.m.json.output(output)
68 68
69 @staticmethod 69 @staticmethod
70 def gen_revision(project, GIT_MODE): 70 def gen_revision(project, GIT_MODE):
71 """Hash project to bogus deterministic revision values.""" 71 """Hash project to bogus deterministic revision values."""
72 h = hashlib.sha1(project) 72 h = hashlib.sha1(project)
73 if GIT_MODE: 73 if GIT_MODE:
74 return h.hexdigest() 74 return h.hexdigest()
75 else: 75 else:
76 return struct.unpack('!I', h.digest()[:4])[0] % 300000 76 return struct.unpack('!I', h.digest()[:4])[0] % 300000
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698