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:
@@ -829,7 +829,7 @@ def CheckChangeOnCommit(input_api, output_api):
|
|||||||
def GetPreferredTrySlaves(project, change):
|
def GetPreferredTrySlaves(project, change):
|
||||||
files = change.LocalPaths()
|
files = change.LocalPaths()
|
||||||
|
|
||||||
if not files:
|
if not files or all(re.search(r'[\\/]OWNERS$', f) for f in files):
|
||||||
return []
|
return []
|
||||||
|
|
||||||
if all(re.search('\.(m|mm)$|(^|[/_])mac[/_.]', f) for f in files):
|
if all(re.search('\.(m|mm)$|(^|[/_])mac[/_.]', f) for f in files):
|
||||||
|
@@ -60,6 +60,14 @@ class MockFile(object):
|
|||||||
return self._local_path
|
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):
|
class IncludeOrderTest(unittest.TestCase):
|
||||||
def testSystemHeaderOrder(self):
|
def testSystemHeaderOrder(self):
|
||||||
scope = [(1, '#include <csystem.h>'),
|
scope = [(1, '#include <csystem.h>'),
|
||||||
@@ -339,6 +347,14 @@ class BadExtensionsTest(unittest.TestCase):
|
|||||||
results = PRESUBMIT._CheckPatchFiles(mock_input_api, MockOutputApi())
|
results = PRESUBMIT._CheckPatchFiles(mock_input_api, MockOutputApi())
|
||||||
self.assertEqual(0, len(results))
|
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__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
Reference in New Issue
Block a user