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

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

Issue 2237293005: Add support to Perf tryjobs to read test attributes from buildbot properties. (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
« no previous file with comments | « scripts/slave/recipe_modules/auto_bisect/api.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/slave/recipe_modules/perf_try/api.py
diff --git a/scripts/slave/recipe_modules/perf_try/api.py b/scripts/slave/recipe_modules/perf_try/api.py
index b6a2c8d35cec69c02587133c358585a58b9a83aa..cb73f23504c8e57c8c1e9f76c840b20084232997 100644
--- a/scripts/slave/recipe_modules/perf_try/api.py
+++ b/scripts/slave/recipe_modules/perf_try/api.py
@@ -42,9 +42,9 @@ class PerfTryJobApi(recipe_api.RecipeApi):
def __init__(self, *args, **kwargs):
super(PerfTryJobApi, self).__init__(*args, **kwargs)
- def start_perf_try_job(self, affected_files, bot_update_step, bot_db):
+ def start_perf_try_job(self, api, affected_files, bot_update_step, bot_db):
"""Entry point pert tryjob or CQ tryjob."""
- perf_config = self._get_perf_config(affected_files)
+ perf_config = self._get_perf_config(api, affected_files)
if perf_config:
self._run_perf_job(perf_config, bot_update_step, bot_db)
elif (not perf_config and
@@ -228,15 +228,19 @@ class PerfTryJobApi(recipe_api.RecipeApi):
src_path)
return step_result.json.output
- def _get_perf_config(self, affected_files):
+ def _get_perf_config(self, api, affected_files):
"""Checks affected config file and loads the config params to a dict."""
perf_cfg_files = [PERF_CONFIG_FILE, WEBKIT_PERF_CONFIG_FILE]
cfg_file = [f for f in perf_cfg_files if str(f) in affected_files]
- if not cfg_file: # pragma: no cover
+ if cfg_file: # pragma: no cover
+ # Try reading any possible perf test config files.
+ cfg_content = self._load_config_file(
+ 'load config', self.m.path['checkout'].join(cfg_file[0]))
+ elif api.properties.get('perf_try_config'): # pragma: no cover
+ cfg_content = dict(api.m.properties.get('perf_try_config'))
+ else:
return None
- # Try reading any possible perf test config files.
- cfg_content = self._load_config_file(
- 'load config', self.m.path['checkout'].join(cfg_file[0]))
+
cfg_is_valid = _validate_perf_config(
cfg_content, required_parameters=['command'])
if cfg_content and cfg_is_valid:
« no previous file with comments | « scripts/slave/recipe_modules/auto_bisect/api.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698