Treat UnitTests failures as presubmit --all errors

When upload presubmits are being run then GetUnitTests would treat
errors as warnings, so as to not stop developers from uploading their
changes. This makes sense when patches are being manually uploaded, but
doesn't make sense when running a "git cl presubmit --all --upload" bot.
This behavior caused nine failures (but not all failures) to be missed
when doing these tests.

This change makes these failures errors when testing with --all
--upload, but leaves them as warnings for other --upload purposes.

Bug: 1309977
Change-Id: Ibf149475e4cdee10bbbbc86fd0ab668b7a679089
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3788227
Reviewed-by: Jesse McKenna <jessemckenna@google.com>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
changes/27/3788227/4
Bruce Dawson 3 years ago committed by LUCI CQ
parent 5a99ae5312
commit 882f1e2a9a

@ -796,8 +796,9 @@ def GetUnitTests(input_api,
maybe_shebang = f.readline()
return maybe_shebang.startswith('#!') and 'python3' in maybe_shebang
# We don't want to hinder users from uploading incomplete patches.
if input_api.is_committing:
# We don't want to hinder users from uploading incomplete patches, but we do
# want to report errors as errors when doing presubmit --all testing.
if input_api.is_committing or input_api.no_diffs:
message_type = output_api.PresubmitError
else:
message_type = output_api.PresubmitPromptWarning

Loading…
Cancel
Save