Commit 9bcb5a32 authored by Stephen Martinis's avatar Stephen Martinis Committed by Commit Bot

metrics_python_tests: Pass correct filter argument

Makes the isolated script test wrapper script know that
metrics_python_tests is a typ based test suite, so that it passes the
proper command line argument to it.

Bug: 533481
Change-Id: Ifd45f947409989174e1da046be6a8342931f82eb
Reviewed-on: https://chromium-review.googlesource.com/1109400Reviewed-by: default avatarDirk Pranke <dpranke@chromium.org>
Reviewed-by: default avatarKenneth Russell <kbr@chromium.org>
Commit-Queue: Stephen Martinis <martiniss@chromium.org>
Cr-Commit-Position: refs/heads/master@{#569423}
parent 11805ff0
......@@ -46,6 +46,12 @@ sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
import xvfb
# Known typ test runners this script wraps. They need a different argument name
# when selecting which tests to run.
# TODO(dpranke): Detect if the wrapped test suite uses typ better.
KNOWN_TYP_TEST_RUNNERS = ['run_blinkpy_tests.py', 'metrics_python_tests.py']
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--isolated-script-test-output', type=str,
......@@ -73,10 +79,13 @@ def main():
temp_filter_file = tempfile.NamedTemporaryFile(mode='w', delete=False)
temp_filter_file.write('\n'.join(filter_list))
temp_filter_file.close()
arg_name = 'test-list'
for arg in rest_args:
if 'run_blinkpy_tests.py' in arg:
arg_name = 'file-list'
for runner in KNOWN_TYP_TEST_RUNNERS:
if runner in arg:
arg_name = 'file-list'
cmd += ['--%s=' % arg_name + temp_filter_file.name]
if args.xvfb:
return xvfb.run_executable(cmd, env)
......
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