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

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

Issue 1862383002: build: add recipe code for new autoroller (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 4 years, 8 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
(Empty)
1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 from recipe_engine import recipe_test_api
6
7
8 class RecipeAutorollerTestApi(recipe_test_api.RecipeTestApi):
9 def roll_data(self, project, success=True, trivial=True, empty=False):
10 """Returns mock roll data for |project|."""
11 if empty:
12 success = False
13
14 ret = self.empty_test_data()
15
16 picked_roll_details = {
17 'commit_infos': {
18 'recipe_engine': [
19 {
20 'author': 'foo@chromium.org',
21 'message': 'some commit message',
22 'revision': '123abc',
23 },
24 ],
25 },
26 }
27
28 roll_result = {
29 'success': success,
30 'trivial': trivial if success else None,
31 'picked_roll_details': picked_roll_details if success else None,
32 'rejected_candidates_details': [],
33 }
34 if empty:
35 roll_result['roll_details'] = []
36 else:
37 roll_result['roll_details'] = [picked_roll_details]
38 if not success:
39 roll_result['rejected_candidates_details'].append({
40 'spec': 'some_spec',
41 'commit_infos': {
42 },
43 })
44
45 ret += self.step_data('%s.roll' % project, self.m.json.output(roll_result))
46 return ret
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698