Commit 17201319 authored by Adam Klein's avatar Adam Klein Committed by Commit Bot

[testrunner] Make --no-network the default, introduce --network flag to enable

Also rename options key from "no_network" to "network" to avoid
too many levels of double-negatives.

Change-Id: I6d29edce8abde64199b27ef0f3453ab370a9937b
Reviewed-on: https://chromium-review.googlesource.com/642516Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47695}
parent e5b93bd5
......@@ -276,10 +276,11 @@ def BuildOptions():
result.add_option("--no-i18n", "--noi18n",
help="Skip internationalization tests",
default=False, action="store_true")
result.add_option("--network", help="Distribute tests on the network",
default=False, dest="network", action="store_true")
result.add_option("--no-network", "--nonetwork",
help="Don't distribute tests on the network",
default=(utils.GuessOS() != "linux"),
dest="no_network", action="store_true")
dest="network", action="store_false")
result.add_option("--no-presubmit", "--nopresubmit",
help='Skip presubmit checks (deprecated)',
default=False, dest="no_presubmit", action="store_true")
......@@ -563,11 +564,11 @@ def ProcessOptions(options):
# Special processing of other options, sorted alphabetically.
if options.buildbot:
options.no_network = True
if options.command_prefix:
options.network = False
if options.command_prefix and options.network:
print("Specifying --command-prefix disables network distribution, "
"running tests locally.")
options.no_network = True
options.network = False
options.command_prefix = shlex.split(options.command_prefix)
options.extra_flags = sum(map(shlex.split, options.extra_flags), [])
......@@ -641,7 +642,7 @@ def ProcessOptions(options):
options.shell_dir = os.path.dirname(options.shell)
if options.valgrind:
run_valgrind = os.path.join("tools", "run-valgrind.py")
# This is OK for distributed running, so we don't need to set no_network.
# This is OK for distributed running, so we don't need to disable network.
options.command_prefix = (["python", "-u", run_valgrind] +
options.command_prefix)
def CheckTestMode(name, option):
......@@ -912,7 +913,7 @@ def Execute(arch, mode, args, options, suites):
progress_indicator.Register(progress.FlakinessTestProgressIndicator(
options.flakiness_results))
run_networked = not options.no_network
run_networked = options.network
if not run_networked:
if options.verbose:
print("Network distribution disabled, running tests locally.")
......
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