summaryrefslogtreecommitdiffstats
path: root/PRESUBMIT_test.py
diff options
context:
space:
mode:
authorasvitkine <asvitkine@chromium.org>2015-01-09 13:43:49 -0800
committerCommit bot <commit-bot@chromium.org>2015-01-09 21:45:16 +0000
commite56a58d717f0ee53671d80518c9bcf70824a4d63 (patch)
treeb38c5e1612bfca350b28344587d06acf0ab09d69 /PRESUBMIT_test.py
parent48ccc7e7853f4a0c7f73fb81d97135f381d2d795 (diff)
downloadchromium_src-e56a58d717f0ee53671d80518c9bcf70824a4d63.zip
chromium_src-e56a58d717f0ee53671d80518c9bcf70824a4d63.tar.gz
chromium_src-e56a58d717f0ee53671d80518c9bcf70824a4d63.tar.bz2
Revert of Add PRESUBMIT check if modified UMA histogram name can be found (patchset #2 id:40001 of https://codereview.chromium.org/766713004/)
Reason for revert: Produces false positive warnings on histograms using histogram_suffixes, see: https://code.google.com/p/chromium/issues/detail?id=445265 Original issue's description: > Add PRESUBMIT check if modified UMA histogram name can be found > > This Presubmit checks if some diffs affect any UMA_HISTOGRAM_* > macro and, if so, checks if the histogram name is to be found > in either tools/metrics/histograms/histograms.xml or in the > CL diffs. > > Addresses the problem of someone modifying code and > inadvertently forgetting a corresponding histograms.xml > adaptation, that has happened in the past. > > BUG=434420 > > Committed: https://crrev.com/2ece5270462346b1ac3bccd3bfe5e68d024b98b5 > Cr-Commit-Position: refs/heads/master@{#306388} TBR=phajdan.jr@chromium.org,mcasas@chromium.org NOTREECHECKS=true NOTRY=true BUG=434420, 445265 Review URL: https://codereview.chromium.org/841323002 Cr-Commit-Position: refs/heads/master@{#310863}
Diffstat (limited to 'PRESUBMIT_test.py')
-rwxr-xr-xPRESUBMIT_test.py22
1 files changed, 0 insertions, 22 deletions
diff --git a/PRESUBMIT_test.py b/PRESUBMIT_test.py
index 9d82644..6daae16 100755
--- a/PRESUBMIT_test.py
+++ b/PRESUBMIT_test.py
@@ -270,28 +270,6 @@ class VersionControlConflictsTest(unittest.TestCase):
self.assertTrue('3' in errors[1])
self.assertTrue('5' in errors[2])
-class UmaHistogramChangeMatchedOrNotTest(unittest.TestCase):
- def testTypicalNotMatchedChange(self):
- diff = ['UMA_HISTOGRAM_BOOL("Bla.Foo.Dummy", true)']
- mock_input_api = MockInputApi()
- mock_input_api.files = [MockFile('some/path/foo.cc', diff)]
- warnings = PRESUBMIT._CheckUmaHistogramChanges(mock_input_api,
- MockOutputApi())
- self.assertEqual(1, len(warnings))
- self.assertEqual('warning', warnings[0].type)
-
- def testTypicalCorrectlyMatchedChange(self):
- diff_cc = ['UMA_HISTOGRAM_BOOL("Bla.Foo.Dummy", true)']
- diff_xml = ['<histogram name="Bla.Foo.Dummy"> </histogram>']
- mock_input_api = MockInputApi()
- mock_input_api.files = [
- MockFile('some/path/foo.cc', diff_cc),
- MockFile('tools/metrics/histograms/histograms.xml', diff_xml),
- ]
- warnings = []
- warnings = PRESUBMIT._CheckUmaHistogramChanges(mock_input_api,
- MockOutputApi())
- self.assertEqual(0, len(warnings))
class BadExtensionsTest(unittest.TestCase):
def testBadRejFile(self):