浏览代码

Permit google app engine to be installed in testing_support.

I recently needed to run presubmit tests in depot_tools, and I was helpfully told:

$ gcl presubmit mychange
... eliding stuff ...
Install google_appengine sdk in /scratch/scratch/chrome/depot_tools_git/testing_support or higher up

This was a lie. If you put google_appengine there, the same presubmit
tools that told you to install it there will fail you for numerous
style violations contained within appengine itself. This change makes
us ignore those by blacklisting google_appengine inside of
testing_support.

Review URL: https://chromiumcodereview.appspot.com/10829293

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@151210 0039d316-1c4b-4281-b951-d872f2087c98
gavinp@chromium.org 13 年之前
父节点
当前提交
656326d43d
共有 2 个文件被更改,包括 13 次插入1 次删除
  1. 1 0
      presubmit_support.py
  2. 12 1
      tests/presubmit_unittest.py

+ 1 - 0
presubmit_support.py

@@ -195,6 +195,7 @@ class InputApi(object):
   # Path regexp that should be excluded from being considered containing source
   # Path regexp that should be excluded from being considered containing source
   # files. Don't modify this list from a presubmit script!
   # files. Don't modify this list from a presubmit script!
   DEFAULT_BLACK_LIST = (
   DEFAULT_BLACK_LIST = (
+      r"testing_support[\\\/]google_appengine[\\\/].*",
       r".*\bexperimental[\\\/].*",
       r".*\bexperimental[\\\/].*",
       r".*\bthird_party[\\\/].*",
       r".*\bthird_party[\\\/].*",
       # Output directories (just in case)
       # Output directories (just in case)

+ 12 - 1
tests/presubmit_unittest.py

@@ -1026,6 +1026,17 @@ class InputApiUnittest(PresubmitTestsBase):
     def f(x):
     def f(x):
       return presubmit.AffectedFile(x, 'M', self.fake_root_dir)
       return presubmit.AffectedFile(x, 'M', self.fake_root_dir)
     files = [
     files = [
+      (
+        [
+          # To be tested.
+          f('testing_support/google_appengine/b'),
+          f('testing_support/not_google_appengine/foo.cc'),
+        ],
+        [
+          # Expected.
+          'testing_support/not_google_appengine/foo.cc',
+        ],
+      ),
       (
       (
         [
         [
           # To be tested.
           # To be tested.
@@ -1089,7 +1100,7 @@ class InputApiUnittest(PresubmitTestsBase):
     self.mox.ReplayAll()
     self.mox.ReplayAll()
 
 
     self.assertEqual(len(input_api.DEFAULT_WHITE_LIST), 22)
     self.assertEqual(len(input_api.DEFAULT_WHITE_LIST), 22)
-    self.assertEqual(len(input_api.DEFAULT_BLACK_LIST), 11)
+    self.assertEqual(len(input_api.DEFAULT_BLACK_LIST), 12)
     for item in files:
     for item in files:
       results = filter(input_api.FilterSourceFile, item[0])
       results = filter(input_api.FilterSourceFile, item[0])
       for i in range(len(results)):
       for i in range(len(results)):