diff options
author | dbeam@chromium.org <dbeam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-10 23:12:17 +0000 |
---|---|---|
committer | dbeam@chromium.org <dbeam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-10 23:12:17 +0000 |
commit | 751b05fad763942db4a538eac7382a64ad7c58d7 (patch) | |
tree | 1953d2db149f119770871ef4e96cb58964074f20 | |
parent | 89c7a1c8efe0f6d752c2ceb5907423318a6b324c (diff) | |
download | chromium_src-751b05fad763942db4a538eac7382a64ad7c58d7.zip chromium_src-751b05fad763942db4a538eac7382a64ad7c58d7.tar.gz chromium_src-751b05fad763942db4a538eac7382a64ad7c58d7.tar.bz2 |
Don't issue try jobs for OWNERS-only changes.
BUG=None
R=maruel@chromium.org
TEST=PRESUBMIT_test.py, less needless try jobs.
NOTRY=true
Review URL: https://chromiumcodereview.appspot.com/11830057
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@176192 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | PRESUBMIT.py | 2 | ||||
-rwxr-xr-x | PRESUBMIT_test.py | 16 |
2 files changed, 17 insertions, 1 deletions
diff --git a/PRESUBMIT.py b/PRESUBMIT.py index 17e3091..a738477 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py @@ -829,7 +829,7 @@ def CheckChangeOnCommit(input_api, output_api): def GetPreferredTrySlaves(project, change): files = change.LocalPaths() - if not files: + if not files or all(re.search(r'[\\/]OWNERS$', f) for f in files): return [] if all(re.search('\.(m|mm)$|(^|[/_])mac[/_.]', f) for f in files): diff --git a/PRESUBMIT_test.py b/PRESUBMIT_test.py index 979ad89..6a29aca 100755 --- a/PRESUBMIT_test.py +++ b/PRESUBMIT_test.py @@ -60,6 +60,14 @@ class MockFile(object): return self._local_path +class MockChange(object): + def __init__(self, changed_files): + self._changed_files = changed_files + + def LocalPaths(self): + return self._changed_files + + class IncludeOrderTest(unittest.TestCase): def testSystemHeaderOrder(self): scope = [(1, '#include <csystem.h>'), @@ -339,6 +347,14 @@ class BadExtensionsTest(unittest.TestCase): results = PRESUBMIT._CheckPatchFiles(mock_input_api, MockOutputApi()) self.assertEqual(0, len(results)) + def testOnlyOwnersFiles(self): + mock_change = MockChange([ + 'some/path/OWNERS', + 'A\Windows\Path\OWNERS', + ]) + results = PRESUBMIT.GetPreferredTrySlaves(None, mock_change) + self.assertEqual(0, len(results)) + if __name__ == '__main__': unittest.main() |