Don't issue try jobs for OWNERS-only changes.
BUG=None
[email protected]
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
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 @@
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 @@
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()