Commit e0d1419a authored by Caleb Rouleau's avatar Caleb Rouleau Committed by Commit Bot

[Perf Waterfall] Make filter argument standard to work with Findit.

Currently it only works with the story name, i.e.:
   '--isolated-script-test-filter=dummy_page.html'
but we need it to work with the full '/'-delimited path along the test results
json, i.e.:
  '--isolated-script-test-filter=dummy_benchmark.noisy_benchmark_1/dummy_page.html'.

Bug: 894254
Change-Id: Ib9ebee49007369fc28a45e986738771e22784d5f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1611197Reviewed-by: default avatarChan Li <chanli@chromium.org>
Commit-Queue: Caleb Rouleau <crouleau@chromium.org>
Cr-Commit-Position: refs/heads/master@{#659347}
parent 312c278e
......@@ -233,6 +233,11 @@ def execute_gtest_perf_test(command_generator, output_paths, use_xvfb=False):
return return_code
class _TelemetryFilterArgument(object):
def __init__(self, filter_string):
self.benchmark, self.story = filter_string.split('/')
class TelemetryCommandGenerator(object):
def __init__(self, benchmark, options,
stories=None, is_reference=False):
......@@ -270,8 +275,11 @@ class TelemetryCommandGenerator(object):
if self._options.isolated_script_test_filter:
filter_list = common.extract_filter_list(
self._options.isolated_script_test_filter)
filter_arguments = [_TelemetryFilterArgument(f) for f in filter_list]
applicable_stories = [
f.story for f in filter_arguments if f.benchmark == self.benchmark]
# Need to convert this to a valid regex.
filter_regex = '(' + '|'.join(filter_list) + ')'
filter_regex = '(' + '|'.join(applicable_stories) + ')'
return ['--story-filter=' + filter_regex]
return []
......@@ -527,4 +535,4 @@ if __name__ == '__main__':
'compile_targets': main_compile_targets,
}
sys.exit(common.run_script(sys.argv[1:], funcs))
sys.exit(main(sys.argv))
\ No newline at end of file
sys.exit(main(sys.argv))
......@@ -124,6 +124,8 @@ class ScriptsSmokeTest(unittest.TestCase):
'--test-shard-map-filename=smoke_test_benchmark_shard_map.json '
'--browser=%s '
'--run-ref-build '
'--isolated-script-test-filter=dummy_benchmark.noisy_benchmark_1/'
'dummy_page.html::dummy_benchmark.stable_benchmark_1/dummy_page.html '
'--isolated-script-test-repeat=2 '
'--isolated-script-test-also-run-disabled-tests '
'--isolated-script-test-output=%s' % (
......@@ -161,7 +163,6 @@ class ScriptsSmokeTest(unittest.TestCase):
finally:
shutil.rmtree(tempdir)
# Windows: ".exe" is auto-added which breaks Windows.
# ChromeOS: crbug.com/754913.
@decorators.Disabled('win', 'chromeos')
......
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