Commit b3a0d30f authored by Dirk Pranke's avatar Dirk Pranke Committed by Commit Bot

Disable coverage tests in //testing/buildbot if coverage is not installed.

At the moment we can't assume that the Python `coverage` module is
installed everywhere we might want to run the presubmit tests in
//testing/buildbot. The right fix for this is to add coverage to
the .vpython spec, but in the meantime this disables the check if
it would fail.

R=kbr@chromium.org, jbudorick@chromium.org
BUG=662541

Change-Id: If71bfe7774788776865c8f1f9ecf38aafaddc308
Reviewed-on: https://chromium-review.googlesource.com/809464Reviewed-by: default avatarKenneth Russell <kbr@chromium.org>
Reviewed-by: default avatarJohn Budorick <jbudorick@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521772}
parent 8be495bb
...@@ -10,7 +10,7 @@ for more details on the presubmit API built into depot_tools. ...@@ -10,7 +10,7 @@ for more details on the presubmit API built into depot_tools.
def CommonChecks(input_api, output_api): def CommonChecks(input_api, output_api):
return input_api.RunTests([ commands = [
input_api.Command( input_api.Command(
name='generate_buildbot_json', cmd=[ name='generate_buildbot_json', cmd=[
input_api.python_executable, 'generate_buildbot_json.py', '--check'], input_api.python_executable, 'generate_buildbot_json.py', '--check'],
...@@ -21,16 +21,31 @@ def CommonChecks(input_api, output_api): ...@@ -21,16 +21,31 @@ def CommonChecks(input_api, output_api):
input_api.python_executable, 'generate_buildbot_json_unittest.py'], input_api.python_executable, 'generate_buildbot_json_unittest.py'],
kwargs={}, message=output_api.PresubmitError), kwargs={}, message=output_api.PresubmitError),
input_api.Command(
name='generate_buildbot_json_coveragetest', cmd=[
input_api.python_executable, 'generate_buildbot_json_coveragetest.py'],
kwargs={}, message=output_api.PresubmitError),
input_api.Command( input_api.Command(
name='manage', cmd=[ name='manage', cmd=[
input_api.python_executable, 'manage.py', '--check'], input_api.python_executable, 'manage.py', '--check'],
kwargs={}, message=output_api.PresubmitError), kwargs={}, message=output_api.PresubmitError),
]) ]
messages = []
# TODO(crbug.com/662541), TODO(crbug.com/792130): Make this command
# run unconditionally once we've added coverage to .vpython and can
# safely assume it will be importable.
try:
import coverage
assert coverage # This silences pylint.
commands.append(input_api.Command(
name='generate_buildbot_json_coveragetest',
cmd=[input_api.python_executable,
'generate_buildbot_json_coveragetest.py'],
kwargs={}, message=output_api.PresubmitError))
except ImportError:
messages.append(output_api.PresubmitNotifyResult(
'Python\'s coverage module is not installed; '
'coverage tests in //testing/buildbot are disabled.'))
messages.extend(input_api.RunTests(commands))
return messages
def CheckChangeOnUpload(input_api, output_api): def CheckChangeOnUpload(input_api, output_api):
......
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