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

Unified 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: rebase 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 side-by-side diff with in-line comments
Download patch
Index: scripts/slave/recipes/android/android_builder.py
diff --git a/scripts/slave/recipes/android/android_builder.py b/scripts/slave/recipes/android/android_builder.py
index fbd0400b1ecf4ceeee740f76c6ec2ddada8ad676..258a670f4b8f15bcf1a277eb864116545a23b91b 100644
--- a/scripts/slave/recipes/android/android_builder.py
+++ b/scripts/slave/recipes/android/android_builder.py
@@ -5,6 +5,7 @@
DEPS = [
'chromium_android',
'properties',
+ 'json',
]
def GenSteps(api):
@@ -29,39 +30,30 @@ def GenSteps(api):
def GenTests(api):
bot_ids = ['main_builder', 'component_builder', 'clang_builder',
'x86_builder', 'klp_builder', 'try_builder']
- def _common_step_mocks():
- return {
- 'Get AppManifestVars': {
- 'json': {
- 'output': {
- 'version_code': 10,
- 'version_name': 'some builder 1234',
- 'build_id': 3333,
- 'date_string': 6001
- }
- }
- },
- 'envsetup': {
- 'json': {
- 'output': {
- 'PATH': './',
- }
- }
- }
- }
for bot_id in bot_ids:
- props = {
- 'repo_name': 'src/repo',
- 'repo_url': 'svn://svn.chromium.org/chrome/trunk/src',
- 'revision': '4f4b02f6b7fa20a3a25682c457bbc8ad589c8a00',
- 'android_bot_id': bot_id,
- 'buildername': 'builder_name',
- 'internal': True
- }
+ props = api.Properties(
+ repo_name='src/repo',
+ repo_url='svn://svn.chromium.org/chrome/trunk/src',
+ revision='4f4b02f6b7fa20a3a25682c457bbc8ad589c8a00',
+ android_bot_id=bot_id,
+ buildername='builder_name',
+ internal=True
+ )
if bot_id == 'try_builder':
- props['revision'] = ''
- yield bot_id, {
- 'properties': props,
- 'step_mocks': _common_step_mocks()
- }
+ props += api.Properties(revision='')
+
+ yield (
+ api.Test(bot_id) +
+ props +
+ api.StepData(
+ 'Get AppManifestVars',
+ api.json.output({
+ 'version_code': 10,
+ 'version_name': 'some builder 1234',
+ 'build_id': 3333,
+ 'date_string': 6001
+ })
+ ) +
+ api.StepData('envsetup', api.json.output({'PATH': './'}))
+ )

Powered by Google App Engine
This is Rietveld 408576698