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

Unified Diff: tools/auto_bisect/PRESUBMIT.py

Issue 669543002: Fix auto-bisect presubmit so that it checks config files again. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 6 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/auto_bisect/PRESUBMIT.py
diff --git a/tools/auto_bisect/PRESUBMIT.py b/tools/auto_bisect/PRESUBMIT.py
index 0cfdd189ddc7911097dd8eefac3f739672c816c8..6fc3c6ecefb55825ec6a7690663b61a5cdcb647f 100644
--- a/tools/auto_bisect/PRESUBMIT.py
+++ b/tools/auto_bisect/PRESUBMIT.py
@@ -12,13 +12,12 @@ import imp
import subprocess
import os
-# Paths to bisect config files relative to src/tools.
+# Paths to bisect config files relative to this script.
CONFIG_FILES = [
- 'auto_bisect/config.cfg',
- 'run-perf-test.cfg'
+ 'bisect.cfg',
+ os.path.join(os.path.pardir, 'run-perf-test.cfg'),
]
-
def CheckChangeOnUpload(input_api, output_api):
return _CommonChecks(input_api, output_api)
@@ -39,10 +38,10 @@ def _CommonChecks(input_api, output_api):
def _CheckAllConfigFiles(input_api, output_api):
"""Checks all bisect config files and returns a list of presubmit results."""
results = []
- for f in input_api.AffectedFiles():
- for config_file in CONFIG_FILES:
- if f.LocalPath().endswith(config_file):
- results.extend(_CheckConfigFile(config_file, output_api))
+ script_path = input_api.PresubmitLocalPath()
+ for config_file in CONFIG_FILES:
+ file_path = os.path.join(script_path, config_file)
+ results.extend(_CheckConfigFile(file_path, output_api))
return results
@@ -54,7 +53,7 @@ def _CheckConfigFile(file_path, output_api):
warning = 'Failed to read config file %s: %s' % (file_path, str(e))
return [output_api.PresubmitError(warning, items=[file_path])]
- if not hasattr(config_file.config):
+ if not hasattr(config_file, 'config'):
warning = 'Config file has no "config" global variable: %s' % str(e)
return [output_api.PresubmitError(warning, items=[file_path])]
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698