Commit 6e49ee86 authored by Dirk Pranke's avatar Dirk Pranke Committed by Commit Bot

Remove obsolete --gtest* flags to run_web_tests.

run_web_tests supported the --gtest_repeat,
--gtest_also_run_disabled_tests, and --gtest_filter flags for
compatibility with FindIt; however FindIt eventually moved
to using the --isolated-script-test flags instead, and these
flags should no longer be used or needed, so this CL removes them.

This is a prelude to cleaning up and implementing proper support
for multiple --isolated-script-test-filter args.

Bug: 893235, 994943
Change-Id: Id7a8ef5f43855b54eeb76193ceca45310b426890
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1759138Reviewed-by: default avatarChan Li <chanli@chromium.org>
Reviewed-by: default avatarRobert Ma <robertma@chromium.org>
Reviewed-by: default avatarRakib Hasan <rmhasan@google.com>
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#688190}
parent 72d708ff
...@@ -308,8 +308,6 @@ def parse_args(args): ...@@ -308,8 +308,6 @@ def parse_args(args):
optparse.make_option( optparse.make_option(
'--iterations', '--iterations',
'--isolated-script-test-repeat', '--isolated-script-test-repeat',
# TODO(crbug.com/893235): Remove the gtest alias when FindIt no longer uses it.
'--gtest_repeat',
type='int', type='int',
default=1, default=1,
help='Number of times to run the set of tests (e.g. ABCABCABC)'), help='Number of times to run the set of tests (e.g. ABCABCABC)'),
...@@ -408,8 +406,6 @@ def parse_args(args): ...@@ -408,8 +406,6 @@ def parse_args(args):
'"always" == always skip, even if listed on the command line.')), '"always" == always skip, even if listed on the command line.')),
optparse.make_option( optparse.make_option(
'--isolated-script-test-also-run-disabled-tests', '--isolated-script-test-also-run-disabled-tests',
# TODO(crbug.com/893235): Remove the gtest alias when FindIt no longer uses it.
'--gtest_also_run_disabled_tests',
action='store_const', action='store_const',
const='ignore', const='ignore',
dest='skipped', dest='skipped',
...@@ -441,13 +437,6 @@ def parse_args(args): ...@@ -441,13 +437,6 @@ def parse_args(args):
type='string', type='string',
help='A list of tests to run separated by TWO colons, e.g. fast::css/test.html, ' help='A list of tests to run separated by TWO colons, e.g. fast::css/test.html, '
'same as listing them as positional arguments'), 'same as listing them as positional arguments'),
# TODO(crbug.com/893235): Remove gtest_filter when FindIt no longer uses it.
optparse.make_option(
'--gtest_filter',
type='string',
help='A colon-separated list of tests to run. Wildcards are '
'NOT supported. It is the same as listing the tests as '
'positional arguments.'),
optparse.make_option( optparse.make_option(
'--time-out-ms', '--time-out-ms',
help='Set the timeout for each test'), help='Set the timeout for each test'),
...@@ -589,9 +578,6 @@ def _set_up_derived_options(port, options, args): ...@@ -589,9 +578,6 @@ def _set_up_derived_options(port, options, args):
if options.isolated_script_test_filter: if options.isolated_script_test_filter:
args.extend(options.isolated_script_test_filter.split('::')) args.extend(options.isolated_script_test_filter.split('::'))
if options.gtest_filter:
args.extend(options.gtest_filter.split(':'))
if not options.total_shards and 'GTEST_TOTAL_SHARDS' in port.host.environ: if not options.total_shards and 'GTEST_TOTAL_SHARDS' in port.host.environ:
options.total_shards = int(port.host.environ['GTEST_TOTAL_SHARDS']) options.total_shards = int(port.host.environ['GTEST_TOTAL_SHARDS'])
if not options.shard_index and 'GTEST_SHARD_INDEX' in port.host.environ: if not options.shard_index and 'GTEST_SHARD_INDEX' in port.host.environ:
......
...@@ -398,16 +398,6 @@ class RunTest(unittest.TestCase, StreamTestingMixin): ...@@ -398,16 +398,6 @@ class RunTest(unittest.TestCase, StreamTestingMixin):
tests_run = get_tests_run(['--repeat-each', '2', '--order', 'natural'] + tests_to_run) tests_run = get_tests_run(['--repeat-each', '2', '--order', 'natural'] + tests_to_run)
self.assertEqual(tests_run, ['passes/image.html', 'passes/image.html', 'passes/text.html', 'passes/text.html']) self.assertEqual(tests_run, ['passes/image.html', 'passes/image.html', 'passes/text.html', 'passes/text.html'])
def test_gtest_repeat(self):
tests_to_run = ['passes/image.html', 'passes/text.html']
tests_run = get_tests_run(['--gtest_repeat', '2', '--order', 'natural'] + tests_to_run)
self.assertEqual(tests_run, ['passes/image.html', 'passes/text.html', 'passes/image.html', 'passes/text.html'])
def test_gtest_repeat_overrides_iterations(self):
tests_to_run = ['passes/image.html', 'passes/text.html']
tests_run = get_tests_run(['--iterations', '4', '--gtest_repeat', '2', '--order', 'natural'] + tests_to_run)
self.assertEqual(tests_run, ['passes/image.html', 'passes/text.html', 'passes/image.html', 'passes/text.html'])
def test_ignore_flag(self): def test_ignore_flag(self):
# Note that passes/image.html is expected to be run since we specified it directly. # Note that passes/image.html is expected to be run since we specified it directly.
tests_run = get_tests_run(['-i', 'passes', 'passes/image.html']) tests_run = get_tests_run(['-i', 'passes', 'passes/image.html'])
...@@ -440,12 +430,6 @@ class RunTest(unittest.TestCase, StreamTestingMixin): ...@@ -440,12 +430,6 @@ class RunTest(unittest.TestCase, StreamTestingMixin):
sorted(get_tests_run(['--skipped=ignore', 'passes'])) sorted(get_tests_run(['--skipped=ignore', 'passes']))
) )
def test_gtest_also_run_disabled_tests(self):
self.assertEqual(
sorted(get_tests_run(['--gtest_also_run_disabled_tests', 'passes'])),
sorted(get_tests_run(['--skipped=ignore', 'passes']))
)
def test_iterations(self): def test_iterations(self):
tests_to_run = ['passes/image.html', 'passes/text.html'] tests_to_run = ['passes/image.html', 'passes/text.html']
tests_run = get_tests_run(['--iterations', '2', '--order', 'natural'] + tests_to_run) tests_run = get_tests_run(['--iterations', '2', '--order', 'natural'] + tests_to_run)
...@@ -521,11 +505,6 @@ class RunTest(unittest.TestCase, StreamTestingMixin): ...@@ -521,11 +505,6 @@ class RunTest(unittest.TestCase, StreamTestingMixin):
) )
self.assertEqual(sorted(tests_run), ['passes/error.html', 'passes/image.html', 'passes/text.html']) self.assertEqual(sorted(tests_run), ['passes/error.html', 'passes/image.html', 'passes/text.html'])
def test_gtest_filter(self):
host = MockHost()
tests_run = get_tests_run(['--gtest_filter=passes/text.html:passes/image.html', 'passes/error.html'], host=host)
self.assertEqual(sorted(tests_run), ['passes/error.html', 'passes/image.html', 'passes/text.html'])
def test_sharding_even(self): def test_sharding_even(self):
# Test that we actually select the right part # Test that we actually select the right part
tests_to_run = ['passes/error.html', 'passes/image.html', 'passes/platform_image.html', 'passes/text.html'] tests_to_run = ['passes/error.html', 'passes/image.html', 'passes/platform_image.html', 'passes/text.html']
......
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