Chromium Code Reviews| Index: tools/perf/PRESUBMIT.py |
| diff --git a/tools/perf/PRESUBMIT.py b/tools/perf/PRESUBMIT.py |
| index 25fe5f49f644c2145c85a5e8c0c4902170a7f783..a910b14358d2e7451e31d7679844af14429f3e81 100644 |
| --- a/tools/perf/PRESUBMIT.py |
| +++ b/tools/perf/PRESUBMIT.py |
| @@ -18,6 +18,7 @@ def _CommonChecks(input_api, output_api): |
| results.extend(_CheckWprShaFiles(input_api, output_api)) |
| results.extend(_CheckJson(input_api, output_api)) |
| + results.extend(_CheckPerfJsonUpToDate(input_api, output_api)) |
| results.extend(input_api.RunTests(input_api.canned_checks.GetPylint( |
| input_api, output_api, extra_paths_list=_GetPathsToPrepend(input_api), |
| pylintrc='pylintrc'))) |
| @@ -38,6 +39,26 @@ def _GetPathsToPrepend(input_api): |
| ] |
| +def _RunArgs(args, input_api): |
| + p = input_api.subprocess.Popen(args, stdout=input_api.subprocess.PIPE, |
| + stderr=input_api.subprocess.STDOUT) |
| + out, _ = p.communicate() |
| + return (out, p.returncode) |
| + |
| + |
| +def _CheckPerfJsonUpToDate(input_api, output_api): |
| + results = [] |
| + perf_dir = input_api.PresubmitLocalPath() |
| + out, return_code = _RunArgs([ |
|
rnephew (Reviews Here)
2017/02/23 15:49:08
nit: only need 1 space here.
nednguyen
2017/02/23 17:49:13
Done.
|
| + input_api.python_executable, |
|
rnephew (Reviews Here)
2017/02/23 15:49:08
Nit:Seems like too many spaces.
nednguyen
2017/02/23 17:49:13
Done.
|
| + input_api.os_path.join(perf_dir, 'generate_perf_json.py'), |
| + '--validate-only'], input_api) |
| + if return_code: |
| + results.append(output_api.PresubmitError( |
| + 'Validating Perf JSON configs failed.', long_text=out)) |
|
rnephew (Reviews Here)
2017/02/23 15:49:09
Nit:Seems like too many spaces.
nednguyen
2017/02/23 17:49:13
Done.
|
| + return results |
| + |
| + |
| def _CheckWprShaFiles(input_api, output_api): |
| """Check whether the wpr sha files have matching URLs.""" |
| old_sys_path = sys.path |