Commit 7e3c67f2 authored by Edward Lemur's avatar Edward Lemur Committed by Commit Bot

presubmit_support: Fix parallel execution of presubmit tests.

The flag value was not being propagated correctly.

Bug: 819774
Change-Id: I42519e1c84704b9a4a613005d3441b7ee12ea427
Reviewed-on: https://chromium-review.googlesource.com/1142533Reviewed-by: 's avatarAaron Gable <agable@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
parent 60b9b6fb
......@@ -762,6 +762,7 @@ class InputApi(object):
# will run all tests once all PRESUBMIT files are processed.
tests = []
msgs = []
parallel = parallel and self.parallel
for t in tests_mix:
if isinstance(t, OutputApi.PresubmitResult) and t:
msgs.append(t)
......@@ -773,7 +774,7 @@ class InputApi(object):
if not t.kwargs.get('cwd'):
t.kwargs['cwd'] = self.PresubmitLocalPath()
self.thread_pool.AddTests(tests, parallel)
if not self.parallel:
if not parallel:
msgs.extend(self.thread_pool.RunAsync())
return msgs
......@@ -1530,8 +1531,8 @@ def DoPresubmitChecks(change,
output.write("Warning, no PRESUBMIT.py found.\n")
results = []
thread_pool = ThreadPool()
executer = PresubmitExecuter(change, committing, verbose,
gerrit_obj, dry_run, thread_pool)
executer = PresubmitExecuter(change, committing, verbose, gerrit_obj,
dry_run, thread_pool, parallel)
if default_presubmit:
if verbose:
output.write("Running default presubmit script.\n")
......
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