Commit 8692e7b8 authored by Michael Achenbach's avatar Michael Achenbach Committed by Commit Bot

[test] Add presubmit support for release scripts

This adds one of the release unittests to presubmit.

Different entry points for CI and CQ are required.

More tests will follow in subsequent CLs.

BUG=chromium:701296
NOTRY=true

Change-Id: Ie96fba873f77df14efb1dc54388f075c056b64a6
Reviewed-on: https://chromium-review.googlesource.com/454639Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43831}
parent ead696dc
......@@ -521,6 +521,12 @@ def CheckDeps(workspace):
return subprocess.call([sys.executable, checkdeps_py, workspace]) == 0
def PyTests(workspace):
test_scripts = join(workspace, 'tools', 'release', 'test_scripts.py')
return subprocess.call(
[sys.executable, test_scripts], stdout=subprocess.PIPE) == 0
def GetOptions():
result = optparse.OptionParser()
result.add_option('--no-lint', help="Do not run cpplint", default=False,
......@@ -543,6 +549,8 @@ def Main():
success &= SourceProcessor().RunOnPath(workspace)
print "Running status-files check..."
success &= StatusFilesProcessor().RunOnPath(workspace)
print "Running python tests..."
success &= PyTests(workspace)
if success:
return 0
else:
......
# Copyright 2017 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
def CheckChangeOnCommit(input_api, output_api):
tests = input_api.canned_checks.GetUnitTestsInDirectory(
input_api, output_api, '.', whitelist=['test_scripts.py$'])
return input_api.RunTests(tests)
......@@ -1920,3 +1920,6 @@ Cr-Commit-Position: refs/heads/4.2.71@{#1}
},],
}
self.assertEquals(expected_json, json.loads(FileToText(json_output)))
if __name__ == '__main__':
unittest.main()
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