Commit a877ee62 authored by Edward Lemur's avatar Edward Lemur Committed by Commit Bot

depot_tools: Run some tests on Python 3 on the bots.

Bug: 984182
Change-Id: I0b7f1e3e056548a27a416c9b4078e54c9e5d60d0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1769400
Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@google.com>
Reviewed-by: 's avatarAndrii Shyshkalov <tandrii@google.com>
parent 1db68ea0
......@@ -56,7 +56,7 @@ def DepotToolsPylint(input_api, output_api):
disabled_warnings=disabled_warnings)
def CommonChecks(input_api, output_api, tests_to_black_list):
def CommonChecks(input_api, output_api, tests_to_black_list, run_on_python3):
results = []
results.extend(input_api.canned_checks.CheckOwners(input_api, output_api))
results.extend(input_api.canned_checks.CheckOwnersFormat(
......@@ -78,7 +78,8 @@ def CommonChecks(input_api, output_api, tests_to_black_list):
output_api,
'tests',
whitelist=tests_to_white_list,
blacklist=tests_to_black_list))
blacklist=tests_to_black_list,
run_on_python3=run_on_python3))
# Validate CIPD manifests.
root = input_api.os_path.normpath(
......@@ -120,15 +121,15 @@ def CheckChangeOnUpload(input_api, output_api):
r'^checkout_test\.py$',
r'^cipd_bootstrap_test\.py$',
r'^gclient_smoketest\.py$',
r'^scm_unittest\.py$',
r'^subprocess2_test\.py$',
]
return CommonChecks(input_api, output_api, tests_to_black_list)
# TODO(ehmaldonado): Run Python 3 tests on upload once Python 3 is
# bootstrapped on Linux and Mac.
return CommonChecks(input_api, output_api, tests_to_black_list, False)
def CheckChangeOnCommit(input_api, output_api):
output = []
output.extend(CommonChecks(input_api, output_api, []))
output.extend(CommonChecks(input_api, output_api, [], True))
output.extend(input_api.canned_checks.CheckDoNotSubmit(
input_api,
output_api))
......
......@@ -916,7 +916,7 @@ class ExecutionQueue(object):
running = self.running
self.running = []
for t in running:
if t.isAlive():
if t.is_alive():
self.running.append(t)
else:
t.join()
......
......@@ -48,7 +48,7 @@ do('A')
do('BB')
do('CCC')
if options.read:
assert options.return_value is 0
assert options.return_value == 0
try:
while sys.stdin.read(1):
options.return_value += 1
......
#!/usr/bin/env python
#!/usr/bin/env vpython3
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
......
#!/usr/bin/env python
#!/usr/bin/env vpython3
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
......
#!/usr/bin/env python
#!/usr/bin/env vpython3
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
......@@ -565,8 +565,8 @@ class GclientTest(trial_dir.TestCase):
obj = gclient.GClient.LoadCurrentConfig(options)
obj.RunOnDeps('None', [])
self.assertEqual(['unix'], sorted(obj.enforced_os))
self.assertEqual([('unix', 'baz'), ('unix',)],
[dep.target_os for dep in obj.dependencies])
self.assertEqual([('unix',), ('unix', 'baz')],
sorted(dep.target_os for dep in obj.dependencies))
self.assertEqual([('foo', 'svn://example.com/foo'),
('bar', 'svn://example.com/bar')],
self._get_processed())
......
#!/usr/bin/env python
#!/usr/bin/env vpython3
# coding=utf-8
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
......
#!/usr/bin/env python
#!/usr/bin/env vpython3
# Copyright (c) 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
......
#!/usr/bin/env python
#!/usr/bin/env vpython3
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
......
#!/usr/bin/env python
#!/usr/bin/env vpython3
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
......
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