From 7e3c67f2c3322f146e8e81fabb8d85dde1d04a3c Mon Sep 17 00:00:00 2001 From: Edward Lemur Date: Fri, 20 Jul 2018 20:52:49 +0000 Subject: [PATCH] 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/1142533 Reviewed-by: Aaron Gable Commit-Queue: Edward Lesmes --- presubmit_support.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/presubmit_support.py b/presubmit_support.py index d72e81b4b..d0c835858 100755 --- a/presubmit_support.py +++ b/presubmit_support.py @@ -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")