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

[test] Simplify flags for configuring testing variants.

This deprecates --exhaustive-variants and --no-variants flags to
simplify code configuring variants.

Simplification after:
https://crrev.com/c/789831

Bug: chromium:788104
Change-Id: Ie77d48eca083e7721e02d34bc1e9aa1b1f0d0202
Reviewed-on: https://chromium-review.googlesource.com/789836
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: 's avatarSergiy Byelozyorov <sergiyb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49633}
parent 91ff1619
...@@ -57,7 +57,7 @@ do ...@@ -57,7 +57,7 @@ do
echo "Building" $v8_target_arch echo "Building" $v8_target_arch
GYP_DEFINES="component=static_library use_goma=1 target_arch=$target_arch v8_target_arch=$v8_target_arch coverage=1 clang=0" python $v8_root/gypfiles/gyp_v8.py -G output_dir=$work_dir GYP_DEFINES="component=static_library use_goma=1 target_arch=$target_arch v8_target_arch=$v8_target_arch coverage=1 clang=0" python $v8_root/gypfiles/gyp_v8.py -G output_dir=$work_dir
ninja -C $build_dir -j2000 ninja -C $build_dir -j2000
$v8_root/tools/run-tests.py --gcov-coverage --arch=$v8_target_arch --mode=$mode --shell-dir=$build_dir --exhaustive-variants $v8_root/tools/run-tests.py --gcov-coverage --arch=$v8_target_arch --mode=$mode --shell-dir=$build_dir --variants=exhaustive
fi fi
done done
......
...@@ -40,13 +40,13 @@ MORE_VARIANTS = [ ...@@ -40,13 +40,13 @@ MORE_VARIANTS = [
"wasm_traps", "wasm_traps",
] ]
EXHAUSTIVE_VARIANTS = MORE_VARIANTS + VARIANTS
VARIANT_ALIASES = { VARIANT_ALIASES = {
# The default for developer workstations. # The default for developer workstations.
"dev": VARIANTS, "dev": VARIANTS,
# Additional variants, run on all bots. # Additional variants, run on all bots.
"more": MORE_VARIANTS, "more": MORE_VARIANTS,
# Shortcut for the two above ("more" first - it has the longer running tests).
"exhaustive": MORE_VARIANTS + VARIANTS,
# Additional variants, run on a subset of bots. # Additional variants, run on a subset of bots.
"extra": ["future", "liftoff"], "extra": ["future", "liftoff"],
} }
...@@ -169,15 +169,16 @@ class StandardTestRunner(base_runner.BaseTestRunner): ...@@ -169,15 +169,16 @@ class StandardTestRunner(base_runner.BaseTestRunner):
" run.", " run.",
default=False, dest="no_sorting", action="store_true") default=False, dest="no_sorting", action="store_true")
parser.add_option("--no-variants", "--novariants", parser.add_option("--no-variants", "--novariants",
help="Don't run any testing variants", help="Deprecated. "
"Equivalent to passing --variants=default",
default=False, dest="no_variants", action="store_true") default=False, dest="no_variants", action="store_true")
parser.add_option("--variants", parser.add_option("--variants",
help="Comma-separated list of testing variants;" help="Comma-separated list of testing variants;"
" default: \"%s\"" % ",".join(VARIANTS)) " default: \"%s\"" % ",".join(VARIANTS))
parser.add_option("--exhaustive-variants", parser.add_option("--exhaustive-variants",
default=False, action="store_true", default=False, action="store_true",
help="Use exhaustive set of default variants:" help="Deprecated. "
" \"%s\"" % ",".join(EXHAUSTIVE_VARIANTS)) "Equivalent to passing --variants=exhaustive")
parser.add_option("-p", "--progress", parser.add_option("-p", "--progress",
help=("The style of progress indicator" help=("The style of progress indicator"
" (verbose, dots, color, mono)"), " (verbose, dots, color, mono)"),
...@@ -252,16 +253,38 @@ class StandardTestRunner(base_runner.BaseTestRunner): ...@@ -252,16 +253,38 @@ class StandardTestRunner(base_runner.BaseTestRunner):
if options.novfp3: if options.novfp3:
options.extra_flags.append("--noenable-vfp3") options.extra_flags.append("--noenable-vfp3")
if options.no_variants:
print ("Option --no-variants is deprecated. "
"Pass --variants=default instead.")
assert not options.variants
options.variants = "default"
if options.exhaustive_variants: if options.exhaustive_variants:
# TODO(machenbach): Switch infra to --variants=exhaustive after M65.
print ("Option --exhaustive-variants is deprecated. "
"Pass --variants=exhaustive instead.")
# This is used on many bots. It includes a larger set of default # This is used on many bots. It includes a larger set of default
# variants. # variants.
# Other options for manipulating variants still apply afterwards. # Other options for manipulating variants still apply afterwards.
VARIANTS = EXHAUSTIVE_VARIANTS assert not options.variants
options.variants = "exhaustive"
if options.quickcheck:
assert not options.variants
options.variants = "stress,default"
options.slow_tests = "skip"
options.pass_fail_tests = "skip"
if self.build_config.predictable:
options.variants = "default"
options.extra_flags.append("--predictable")
options.extra_flags.append("--verify_predictable")
options.extra_flags.append("--no-inline-new")
# TODO(machenbach): Figure out how to test a bigger subset of variants on # TODO(machenbach): Figure out how to test a bigger subset of variants on
# msan. # msan.
if self.build_config.msan: if self.build_config.msan:
VARIANTS = ["default"] options.variants = "default"
if options.j == 0: if options.j == 0:
options.j = multiprocessing.cpu_count() options.j = multiprocessing.cpu_count()
...@@ -269,40 +292,21 @@ class StandardTestRunner(base_runner.BaseTestRunner): ...@@ -269,40 +292,21 @@ class StandardTestRunner(base_runner.BaseTestRunner):
if options.random_seed_stress_count <= 1 and options.random_seed == 0: if options.random_seed_stress_count <= 1 and options.random_seed == 0:
options.random_seed = self._random_seed() options.random_seed = self._random_seed()
def excl(*args): # Use developer defaults if no variant was specified.
"""Returns true if zero or one of multiple arguments are true.""" options.variants = options.variants or "dev"
return reduce(lambda x, y: x + y, args) <= 1
if not excl(options.no_variants, bool(options.variants)): # Resolve variant aliases and dedupe.
print("Use only one of --no-variants or --variants.") # TODO(machenbach): Don't mutate global variable. Rather pass mutated
raise base_runner.TestRunnerError() # version as local variable.
if options.quickcheck: VARIANTS = list(set(reduce(
VARIANTS = ["default", "stress"] list.__add__,
options.slow_tests = "skip" (VARIANT_ALIASES.get(v, [v]) for v in options.variants.split(",")),
options.pass_fail_tests = "skip" [],
if options.no_variants: )))
VARIANTS = ["default"]
if options.variants:
VARIANTS = options.variants.split(",")
# Resolve variant aliases.
VARIANTS = reduce(
list.__add__,
(VARIANT_ALIASES.get(v, [v]) for v in VARIANTS),
[],
)
if not set(VARIANTS).issubset(ALL_VARIANTS):
print "All variants must be in %s" % str(ALL_VARIANTS)
raise base_runner.TestRunnerError()
if self.build_config.predictable:
VARIANTS = ["default"]
options.extra_flags.append("--predictable")
options.extra_flags.append("--verify_predictable")
options.extra_flags.append("--no-inline-new")
# Dedupe. if not set(VARIANTS).issubset(ALL_VARIANTS):
VARIANTS = list(set(VARIANTS)) print "All variants must be in %s" % str(ALL_VARIANTS)
raise base_runner.TestRunnerError()
def CheckTestMode(name, option): def CheckTestMode(name, option):
if not option in ["run", "skip", "dontcare"]: if not option in ["run", "skip", "dontcare"]:
......
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