Commit dbb198af authored by Michal Majewski's avatar Michal Majewski Committed by Commit Bot

[test] Random seed and rerun proc moved to base runner

Bug: v8:6917
Change-Id: I543c232489e6b93f5f98ccf63eea475535d82613
Reviewed-on: https://chromium-review.googlesource.com/893566
Commit-Queue: Michał Majewski <majeski@google.com>
Reviewed-by: 's avatarSergiy Byelozyorov <sergiyb@chromium.org>
Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50998}
parent 291dc3cd
......@@ -21,6 +21,7 @@ sys.path.insert(
from testrunner.local import testsuite
from testrunner.local import utils
from testrunner.test_config import TestConfig
from testrunner.testproc.rerun import RerunProc
from testrunner.testproc.shard import ShardProc
from testrunner.testproc.sigproc import SignalProc
from testrunner.testproc.timeout import TimeoutProc
......@@ -272,6 +273,14 @@ class BaseTestRunner(object):
default=1, type="int")
parser.add_option("--total-timeout-sec", default=0, type="int",
help="How long should fuzzer run")
parser.add_option("--random-seed", default=0, type=int,
help="Default seed for initializing random generator")
parser.add_option("--rerun-failures-count", default=0, type=int,
help="Number of times to rerun each failing test case. "
"Very slow tests will be rerun only once.")
parser.add_option("--rerun-failures-max", default=100, type=int,
help="Maximum number of failing test cases to rerun")
parser.add_option("--command-prefix", default="",
help="Prepended to each shell command used to run a test")
......@@ -622,3 +631,9 @@ class BaseTestRunner(object):
def _create_signal_proc(self):
return SignalProc()
def _create_rerun_proc(self, options):
if not options.rerun_failures_count:
return None
return RerunProc(options.rerun_failures_count,
options.rerun_failures_max)
......@@ -23,7 +23,6 @@ from testrunner.testproc.execution import ExecutionProc
from testrunner.testproc.filter import StatusFileFilterProc, NameFilterProc
from testrunner.testproc.loader import LoadProc
from testrunner.testproc.progress import ResultsTracker, TestsCounter
from testrunner.testproc.rerun import RerunProc
from testrunner.utils import random_utils
......@@ -45,18 +44,9 @@ class NumFuzzer(base_runner.BaseTestRunner):
" (verbose, dots, color, mono)"),
choices=progress.PROGRESS_INDICATORS.keys(),
default="mono")
parser.add_option("--random-seed", default=0, type=int,
help="Default seed for initializing random generator")
parser.add_option("--fuzzer-random-seed", default=0,
help="Default seed for initializing fuzzer random "
"generator")
parser.add_option("--rerun-failures-count",
help=("Number of times to rerun each failing test case."
" Very slow tests will be rerun only once."),
default=0, type="int")
parser.add_option("--rerun-failures-max",
help="Maximum number of failing test cases to rerun.",
default=100, type="int")
parser.add_option("--swarming",
help="Indicates running test driver on swarming.",
default=False, action="store_true")
......@@ -307,11 +297,6 @@ class NumFuzzer(base_runner.BaseTestRunner):
add('deopt', options.stress_deopt, options.stress_deopt_min)
return fuzzers
def _create_rerun_proc(self, options):
if not options.rerun_failures_count:
return None
return RerunProc(options.rerun_failures_count,
options.rerun_failures_max)
if __name__ == '__main__':
sys.exit(NumFuzzer().execute())
......@@ -32,7 +32,6 @@ from testrunner.testproc.loader import LoadProc
from testrunner.testproc.progress import (VerboseProgressIndicator,
ResultsTracker,
TestsCounter)
from testrunner.testproc.rerun import RerunProc
from testrunner.testproc.seed import SeedProc
from testrunner.testproc.variant import VariantProc
from testrunner.utils import random_utils
......@@ -168,13 +167,6 @@ class StandardTestRunner(base_runner.BaseTestRunner):
help="Path to a file for storing json results.")
parser.add_option("--flakiness-results",
help="Path to a file for storing flakiness json.")
parser.add_option("--rerun-failures-count",
help=("Number of times to rerun each failing test case."
" Very slow tests will be rerun only once."),
default=0, type="int")
parser.add_option("--rerun-failures-max",
help="Maximum number of failing test cases to rerun.",
default=100, type="int")
parser.add_option("--dont-skip-slow-simulator-tests",
help="Don't skip more slow tests when using a"
" simulator.",
......@@ -191,9 +183,6 @@ class StandardTestRunner(base_runner.BaseTestRunner):
parser.add_option("--junittestsuite",
help="The testsuite name in the JUnit output file",
default="v8tests")
parser.add_option("--random-seed", default=0, dest="random_seed",
help="Default seed for initializing random generator",
type=int)
parser.add_option("--random-seed-stress-count", default=1, type="int",
dest="random_seed_stress_count",
help="Number of runs with different random seeds. Only "
......@@ -555,7 +544,7 @@ class StandardTestRunner(base_runner.BaseTestRunner):
] + indicators + [
results,
self._create_timeout_proc(options),
self._create_rerun_proc(context),
self._create_rerun_proc(options),
execproc,
]
......@@ -606,13 +595,6 @@ class StandardTestRunner(base_runner.BaseTestRunner):
return SeedProc(options.random_seed_stress_count, options.random_seed,
options.j * 4)
def _create_rerun_proc(self, ctx):
if not ctx.rerun_failures_count:
return None
return RerunProc(ctx.rerun_failures_count,
ctx.rerun_failures_max)
if __name__ == '__main__':
sys.exit(StandardTestRunner().execute())
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