Commit a51a0669 authored by Edward Lesmes's avatar Edward Lesmes Committed by Commit Bot

presubmit: Run tests on Windows.

Change-Id: Ia6844cd6da6a9c68ed3d83144bd032933ab69fcf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1875110
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: 's avatarAnthony Polito <apolito@google.com>
parent dc4d19ee
...@@ -79,7 +79,6 @@ def CommonChecks(input_api, output_api, tests_to_black_list, run_on_python3): ...@@ -79,7 +79,6 @@ def CommonChecks(input_api, output_api, tests_to_black_list, run_on_python3):
r'.*git_number_test\.py$', r'.*git_number_test\.py$',
r'.*git_rebase_update_test\.py$', r'.*git_rebase_update_test\.py$',
r'.*ninjalog_uploader_test\.py$', r'.*ninjalog_uploader_test\.py$',
r'.*presubmit_unittest\.py$',
r'.*recipes_test\.py$', r'.*recipes_test\.py$',
r'.*roll_dep_test\.py$', r'.*roll_dep_test\.py$',
r'.*scm_unittest\.py$', r'.*scm_unittest\.py$',
......
...@@ -917,7 +917,7 @@ class InputApiUnittest(PresubmitTestsBase): ...@@ -917,7 +917,7 @@ class InputApiUnittest(PresubmitTestsBase):
known_files = [] known_files = []
for _, f, exists in files: for _, f, exists in files:
full_file = os.path.join(self.fake_root_dir, f) full_file = os.path.join(self.fake_root_dir, f)
if exists and f.startswith('foo/'): if exists and f.startswith('foo'):
known_files.append(full_file) known_files.append(full_file)
diffs.append(self.presubmit_diffs % {'filename': f}) diffs.append(self.presubmit_diffs % {'filename': f})
...@@ -2078,8 +2078,8 @@ the current line as well! ...@@ -2078,8 +2078,8 @@ the current line as well!
input_api.environ = mock.MagicMock(os.environ) input_api.environ = mock.MagicMock(os.environ)
input_api.environ.copy.return_value = {} input_api.environ.copy.return_value = {}
input_api.AffectedSourceFiles.return_value = True input_api.AffectedSourceFiles.return_value = True
input_api.PresubmitLocalPath.return_value = '/foo' input_api.PresubmitLocalPath.return_value = 'CWD'
input_api.os_walk.return_value = [('/foo', [], ['file1.py'])] input_api.os_walk.return_value = [('CWD', [], ['file1.py'])]
process = mock.Mock() process = mock.Mock()
process.returncode = 0 process.returncode = 0
...@@ -2088,7 +2088,9 @@ the current line as well! ...@@ -2088,7 +2088,9 @@ the current line as well!
pylint = os.path.join(_ROOT, 'pylint') pylint = os.path.join(_ROOT, 'pylint')
pylintrc = os.path.join(_ROOT, 'pylintrc') pylintrc = os.path.join(_ROOT, 'pylintrc')
env = {'PYTHONPATH': ''} env = {str('PYTHONPATH'): str('')}
if sys.platform == 'win32':
pylint += '.bat'
results = presubmit_canned_checks.RunPylint( results = presubmit_canned_checks.RunPylint(
input_api, presubmit.OutputApi) input_api, presubmit.OutputApi)
...@@ -2097,11 +2099,11 @@ the current line as well! ...@@ -2097,11 +2099,11 @@ the current line as well!
self.assertEqual(subprocess.Popen.mock_calls, [ self.assertEqual(subprocess.Popen.mock_calls, [
mock.call( mock.call(
[pylint, '--args-on-stdin'], env=env, [pylint, '--args-on-stdin'], env=env,
cwd='/foo', stderr=subprocess.STDOUT, stdout=subprocess.PIPE, cwd='CWD', stderr=subprocess.STDOUT, stdout=subprocess.PIPE,
stdin=subprocess.PIPE), stdin=subprocess.PIPE),
mock.call( mock.call(
[pylint, '--args-on-stdin'], env=env, [pylint, '--args-on-stdin'], env=env,
cwd='/foo', stderr=subprocess.STDOUT, stdout=subprocess.PIPE, cwd='CWD', stderr=subprocess.STDOUT, stdout=subprocess.PIPE,
stdin=subprocess.PIPE), stdin=subprocess.PIPE),
]) ])
self.assertEqual(presubmit.sigint_handler.wait.mock_calls, [ self.assertEqual(presubmit.sigint_handler.wait.mock_calls, [
......
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