0

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
This commit is contained in:
dbeam@chromium.org
2013-01-10 23:12:17 +00:00
parent 89c7a1c8ef
commit 751b05fad7
2 changed files with 17 additions and 1 deletions

@ -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):

@ -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()