Commit ab184555 authored by Michael Achenbach's avatar Michael Achenbach Committed by Commit Bot

[test] Add feature to keep running skipped tests.

This commit adds a --run-skipped flag to the test runner that will
bypass the 'SKIP' status.

Bug: v8:8485
Change-Id: Iac012bdaf2de6b0f8e44ed3a65bc9330709527bb
Reviewed-on: https://chromium-review.googlesource.com/c/1346490
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
Reviewed-by: 's avatarSigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57710}
parent 0e2b1aaa
...@@ -345,6 +345,8 @@ class BaseTestRunner(object): ...@@ -345,6 +345,8 @@ class BaseTestRunner(object):
help="Run without test harness of a given suite") help="Run without test harness of a given suite")
parser.add_option("--random-seed", default=0, type=int, parser.add_option("--random-seed", default=0, type=int,
help="Default seed for initializing random generator") help="Default seed for initializing random generator")
parser.add_option("--run-skipped", help="Also run skipped tests.",
default=False, action="store_true")
parser.add_option("-t", "--timeout", default=60, type=int, parser.add_option("-t", "--timeout", default=60, type=int,
help="Timeout for single test in seconds") help="Timeout for single test in seconds")
parser.add_option("-v", "--verbose", default=False, action="store_true", parser.add_option("-v", "--verbose", default=False, action="store_true",
...@@ -677,6 +679,7 @@ class BaseTestRunner(object): ...@@ -677,6 +679,7 @@ class BaseTestRunner(object):
no_harness=options.no_harness, no_harness=options.no_harness,
noi18n=self.build_config.no_i18n, noi18n=self.build_config.no_i18n,
random_seed=options.random_seed, random_seed=options.random_seed,
run_skipped=options.run_skipped,
shell_dir=self.outdir, shell_dir=self.outdir,
timeout=timeout, timeout=timeout,
verbose=options.verbose, verbose=options.verbose,
......
...@@ -135,7 +135,8 @@ class TestCase(object): ...@@ -135,7 +135,8 @@ class TestCase(object):
@property @property
def do_skip(self): def do_skip(self):
return statusfile.SKIP in self._statusfile_outcomes return (statusfile.SKIP in self._statusfile_outcomes and
not self.suite.test_config.run_skipped)
@property @property
def is_slow(self): def is_slow(self):
......
...@@ -16,6 +16,7 @@ class TestConfig(object): ...@@ -16,6 +16,7 @@ class TestConfig(object):
no_harness, no_harness,
noi18n, noi18n,
random_seed, random_seed,
run_skipped,
shell_dir, shell_dir,
timeout, timeout,
verbose): verbose):
...@@ -27,6 +28,7 @@ class TestConfig(object): ...@@ -27,6 +28,7 @@ class TestConfig(object):
self.noi18n = noi18n self.noi18n = noi18n
# random_seed is always not None. # random_seed is always not None.
self.random_seed = random_seed or random_utils.random_seed() self.random_seed = random_seed or random_utils.random_seed()
self.run_skipped = run_skipped
self.shell_dir = shell_dir self.shell_dir = shell_dir
self.timeout = timeout self.timeout = timeout
self.verbose = verbose self.verbose = verbose
...@@ -404,6 +404,22 @@ class SystemTest(unittest.TestCase): ...@@ -404,6 +404,22 @@ class SystemTest(unittest.TestCase):
self.assertIn('0 tests ran', result.stdout, result) self.assertIn('0 tests ran', result.stdout, result)
self.assertEqual(2, result.returncode, result) self.assertEqual(2, result.returncode, result)
def testRunSkips(self):
"""Inverse the above. Test parameter to keep running skipped tests."""
with temp_base() as basedir:
result = run_tests(
basedir,
'--mode=Release',
'--progress=verbose',
'--variants=nooptimization',
'--run-skipped',
'sweet/strawberries',
)
self.assertIn('Running 1 base tests', result.stdout, result)
self.assertIn('1 tests failed', result.stdout, result)
self.assertIn('1 tests ran', result.stdout, result)
self.assertEqual(1, result.returncode, result)
def testDefaultProc(self): def testDefaultProc(self):
self.testDefault(infra_staging=True) self.testDefault(infra_staging=True)
......
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