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

Unified Diff: scripts/slave/recipe_modules/crrev/api.py

Issue 2247373002: Refactor stages 1, 2 and test_api overhaul. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Created 4 years, 4 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/recipe_modules/crrev/api.py
diff --git a/scripts/slave/recipe_modules/crrev/api.py b/scripts/slave/recipe_modules/crrev/api.py
index 31676b6d6f95ace6547183bcda5a034367bd10e4..919ec153af76818ce75a1485d397cbc11f9b6fec 100644
--- a/scripts/slave/recipe_modules/crrev/api.py
+++ b/scripts/slave/recipe_modules/crrev/api.py
@@ -10,7 +10,8 @@ import re
class CrrevApi(recipe_api.RecipeApi):
"""Recipe module for making requests to crrev.com."""
- def __call__(self, step_name, request_path, request_params=None, attempts=3):
+ def __call__(self, step_name, request_path, request_params=None, attempts=3,
+ **kwargs):
step_result = self.m.python(
step_name,
self.resource('crrev_client.py'),
@@ -19,12 +20,12 @@ class CrrevApi(recipe_api.RecipeApi):
'--params-file', self.m.json.input(request_params or {}),
'--attempts', str(attempts),
],
- stdout=self.m.json.output())
+ stdout=self.m.json.output(), **kwargs)
return step_result.stdout
def to_commit_hash(
self, commit_position, project='chromium', repo='chromium/src',
- attempts=3, step_name=None):
+ attempts=3, step_name=None, **kwargs):
"""Fetches the corresponding commit hash for a commit position."""
branch, number = self.m.commit_position.parse(commit_position)
params = {
@@ -36,7 +37,7 @@ class CrrevApi(recipe_api.RecipeApi):
}
step_name = step_name or 'crrev get commit hash for ' + commit_position
try:
- result = self(step_name, 'get_numbering', params, attempts)
+ result = self(step_name, 'get_numbering', params, attempts, **kwargs)
return result['git_sha']
except (self.m.step.StepFailure, KeyError):
raise self.m.step.StepFailure('Could not resolve ' + commit_position)

Powered by Google App Engine
This is Rietveld 408576698