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

Side by Side Diff: scripts/slave/recipes/android/android_builder.py

Issue 23889036: Refactor the way that TestApi works so that it is actually useful. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: once more... Created 7 years, 3 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 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 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 DEPS = [ 5 DEPS = [
6 'chromium_android', 6 'chromium_android',
7 'properties', 7 'properties',
8 'json',
8 ] 9 ]
9 10
10 def GenSteps(api): 11 def GenSteps(api):
11 droid = api.chromium_android 12 droid = api.chromium_android
12 internal = api.properties.get('internal') 13 internal = api.properties.get('internal')
13 14
14 yield droid.init_and_sync() 15 yield droid.init_and_sync()
15 yield droid.envsetup() 16 yield droid.envsetup()
16 yield droid.clean_local_files() 17 yield droid.clean_local_files()
17 if internal: 18 if internal:
18 yield droid.run_tree_truth() 19 yield droid.run_tree_truth()
19 yield droid.runhooks() 20 yield droid.runhooks()
20 yield droid.compile() 21 yield droid.compile()
21 22
22 if droid.c.run_findbugs: 23 if droid.c.run_findbugs:
23 yield droid.findbugs() 24 yield droid.findbugs()
24 if droid.c.run_lint: 25 if droid.c.run_lint:
25 yield droid.lint() 26 yield droid.lint()
26 if droid.c.run_checkdeps: 27 if droid.c.run_checkdeps:
27 yield droid.checkdeps() 28 yield droid.checkdeps()
28 29
29 def GenTests(api): 30 def GenTests(api):
30 bot_ids = ['main_builder', 'component_builder', 'clang_builder', 31 bot_ids = ['main_builder', 'component_builder', 'clang_builder',
31 'x86_builder', 'klp_builder', 'try_builder'] 32 'x86_builder', 'klp_builder', 'try_builder']
32 def _common_step_mocks():
33 return {
34 'get app_manifest_vars': {
35 'json': {
36 'output': {
37 'version_code': 10,
38 'version_name': 'some_builder_1234',
39 'build_id': 3333,
40 'date_string': 6001
41 }
42 }
43 },
44 'envsetup': {
45 'json': {
46 'output': {
47 'PATH': './',
48 'GYP_DEFINES': 'my_new_gyp_def=aaa',
49 'GYP_SOMETHING': 'gyp_something_value'
50 }
51 }
52 }
53 }
54 33
55 for bot_id in bot_ids: 34 for bot_id in bot_ids:
56 props = { 35 props = api.properties(
57 'repo_name': 'src/repo', 36 repo_name='src/repo',
58 'repo_url': 'svn://svn.chromium.org/chrome/trunk/src', 37 repo_url='svn://svn.chromium.org/chrome/trunk/src',
59 'revision': '4f4b02f6b7fa20a3a25682c457bbc8ad589c8a00', 38 revision='4f4b02f6b7fa20a3a25682c457bbc8ad589c8a00',
60 'android_bot_id': bot_id, 39 android_bot_id=bot_id,
61 'buildername': 'builder_name', 40 buildername='builder_name',
62 'internal': True 41 internal=True
63 } 42 )
64 if bot_id == 'try_builder': 43 if bot_id == 'try_builder':
65 props['revision'] = '' 44 props += api.properties(revision='')
66 yield bot_id, { 45
67 'properties': props, 46 yield (
68 'step_mocks': _common_step_mocks() 47 api.test(bot_id) +
69 } 48 props +
49 api.step_data(
50 'get app_manifest_vars',
51 api.json.output({
52 'version_code': 10,
53 'version_name': 'some_builder_1234',
54 'build_id': 3333,
55 'date_string': 6001
56 })
57 ) +
58 api.step_data(
59 'envsetup',
60 api.json.output({
61 'PATH': './',
62 'GYP_DEFINES': 'my_new_gyp_def=aaa',
63 'GYP_SOMETHING': 'gyp_something_value'
64 })
65 )
66 )
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698