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, {}) _, have_errors = extract_histograms._UpdateHistogramsWithTokens(
histograms_dict, 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__":
......
...@@ -11,29 +11,32 @@ SRC_DIR = os.path.dirname(os.path.dirname(THIS_DIR)) ...@@ -11,29 +11,32 @@ SRC_DIR = os.path.dirname(os.path.dirname(THIS_DIR))
TYP_DIR = os.path.join(SRC_DIR, 'third_party', 'catapult', 'third_party', 'typ') TYP_DIR = os.path.join(SRC_DIR, 'third_party', 'catapult', 'third_party', 'typ')
if not TYP_DIR in sys.path: if not TYP_DIR in sys.path:
sys.path.insert(0, TYP_DIR) sys.path.insert(0, TYP_DIR)
import typ 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(
'actions/extract_actions_test.py', sys.exit(
'histograms/generate_expired_histograms_array_unittest.py', typ.main(tests=resolve(
'histograms/pretty_print_test.py', 'actions/extract_actions_test.py',
'rappor/rappor_model_test.py', 'histograms/extract_histograms_test.py',
'ukm/codegen_test.py', 'histograms/generate_expired_histograms_array_unittest.py',
'ukm/gen_builders_test.py', 'histograms/pretty_print_test.py',
'ukm/ukm_model_test.py', 'rappor/rappor_model_test.py',
'ukm/xml_validations_test.py', 'ukm/codegen_test.py',
'../json_comment_eater/json_comment_eater_test.py', 'ukm/gen_builders_test.py',
'../json_to_struct/element_generator_test.py', 'ukm/ukm_model_test.py',
'../json_to_struct/struct_generator_test.py', 'ukm/xml_validations_test.py',
'../variations/fieldtrial_to_struct_unittest.py', '../json_comment_eater/json_comment_eater_test.py',
'../variations/fieldtrial_util_unittest.py', '../json_to_struct/element_generator_test.py',
'../variations/split_variations_cmd_unittest.py', '../json_to_struct/struct_generator_test.py',
'../../components/variations/service/' '../variations/fieldtrial_to_struct_unittest.py',
'generate_ui_string_overrider_unittest.py', '../variations/fieldtrial_util_unittest.py',
))) '../variations/split_variations_cmd_unittest.py',
'../../components/variations/service/'
'generate_ui_string_overrider_unittest.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