Commit 41691abe authored by Bruce Dawson's avatar Bruce Dawson Committed by LUCI CQ

Fix not-run-test detection.

In crrev.com/c/2986400 the skip_shebang_check flag was added to address
the problem of some tests being run neither on Python 2 or Python 3. At
the same time reporting was added to warn if tests were run on neither
Python version.

Unfortunately the reporting code was incorrect. A PresubmitPromptWarning
object was created but was not added to the list of results, so it had
no effect. Also the skipped tests name was added where a list was
expected which meant that each character of the test name showed up on
its own line.

This change fixes the reporting. It also changes the format of the
report and makes it an error - a failure to run tests at all deserves
that severity level.

A test run with the fixed check showed that no errors have crept in -
all tests were being run with one or the other. However the fix did
find a bug in an in-progress change I was working on.

Bug: 1223478
Change-Id: Ibb44b5e60e7a7a5de08302f19ee4035cdfac5212
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3674199
Auto-Submit: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Fabrice de Gans <fdegans@chromium.org>
Reviewed-by: 's avatarFabrice de Gans <fdegans@chromium.org>
parent 10a82868
......@@ -835,10 +835,9 @@ def GetUnitTests(input_api,
message=message_type))
test_run = True
if not test_run:
output_api.PresubmitPromptWarning(
"Some python tests were not run. You may need to add\n"
"skip_shebang_check=True for python3 tests.",
items=unit_test)
results.append(output_api.PresubmitError(
"The %s test was not run. You may need to add\n"
"skip_shebang_check=True for python3 tests." % unit_test))
return results
......
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