Commit 3ab681ee authored by Weilun Shi's avatar Weilun Shi Committed by Commit Bot

Add extract_histograms_test to metrics_python_tests

Add extract_histograms_test to metrics_python_tests so that
extract_histograms_test will be run by trybot.

Bug: 1114894
Change-Id: Ieae44071631a018e705dd11baa60fe0ab7cd9d7f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2347891
Commit-Queue: Steven Holte <holte@chromium.org>
Reviewed-by: default avatarSteven Holte <holte@chromium.org>
Auto-Submit: Weilun Shi <sweilun@chromium.org>
Cr-Commit-Position: refs/heads/master@{#796944}
parent 967bdbdb
...@@ -94,6 +94,7 @@ group("metrics_python_tests") { ...@@ -94,6 +94,7 @@ group("metrics_python_tests") {
"//tools/metrics/histograms/expand_owners.py", "//tools/metrics/histograms/expand_owners.py",
"//tools/metrics/histograms/expand_owners_unittest.py", "//tools/metrics/histograms/expand_owners_unittest.py",
"//tools/metrics/histograms/extract_histograms.py", "//tools/metrics/histograms/extract_histograms.py",
"//tools/metrics/histograms/extract_histograms_test.py",
"//tools/metrics/histograms/generate_expired_histograms_array.py", "//tools/metrics/histograms/generate_expired_histograms_array.py",
"//tools/metrics/histograms/generate_expired_histograms_array_unittest.py", "//tools/metrics/histograms/generate_expired_histograms_array_unittest.py",
"//tools/metrics/histograms/histogram_ownership.py", "//tools/metrics/histograms/histogram_ownership.py",
......
...@@ -634,13 +634,11 @@ class ExtractHistogramsTest(unittest.TestCase): ...@@ -634,13 +634,11 @@ class ExtractHistogramsTest(unittest.TestCase):
""") """)
# Check that error is logged when empty string variant name is used # Check that error is logged when empty string variant name is used
# in token that is not the last token. # in token that is not the last token.
with self.assertLogs(level='ERROR') as log:
histograms_dict, _ = extract_histograms._ExtractHistogramsFromXmlTree( histograms_dict, _ = extract_histograms._ExtractHistogramsFromXmlTree(
histogram_with_duplicate_variant, {}) histogram_with_duplicate_variant, {})
histograms_dict, have_errors = extract_histograms._UpdateHistogramsWithTokens( _, have_errors = extract_histograms._UpdateHistogramsWithTokens(
histograms_dict) histograms_dict)
self.assertTrue(have_errors) self.assertTrue(have_errors)
self.assertIn('Duplicate histogram name', log.output[0])
if __name__ == "__main__": if __name__ == "__main__":
......
...@@ -19,8 +19,11 @@ import typ ...@@ -19,8 +19,11 @@ import typ
def resolve(*paths): def resolve(*paths):
return [os.path.join(THIS_DIR, *(p.split('/'))) for p in paths] return [os.path.join(THIS_DIR, *(p.split('/'))) for p in paths]
sys.exit(typ.main(tests=resolve(
sys.exit(
typ.main(tests=resolve(
'actions/extract_actions_test.py', 'actions/extract_actions_test.py',
'histograms/extract_histograms_test.py',
'histograms/generate_expired_histograms_array_unittest.py', 'histograms/generate_expired_histograms_array_unittest.py',
'histograms/pretty_print_test.py', 'histograms/pretty_print_test.py',
'rappor/rappor_model_test.py', 'rappor/rappor_model_test.py',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment