Commit 6a7e234b authored by Josip Sokcevic's avatar Josip Sokcevic Committed by LUCI CQ

Fix Windows unit tests for roll-dep and use py3

R=ehmaldonado@chromium.org

Change-Id: I5bf1aa21a5ae9b90dbab4cc0439ca19e73de337f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2125221Reviewed-by: 's avatarEdward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
parent b73f8a96
......@@ -82,7 +82,6 @@ def CommonChecks(input_api, output_api, tests_to_black_list, run_on_python3):
r'.*git_map_test\.py$',
r'.*ninjalog_uploader_test\.py$',
r'.*recipes_test\.py$',
r'.*roll_dep_test\.py$',
]
# TODO(maruel): Make sure at least one file is modified first.
......
#!/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.
......@@ -32,19 +32,20 @@ class FakeRepos(fake_repos.FakeReposBase):
'origin': 'git/repo_2@3',
})
self._commit_git('repo_1', {
'DEPS': '\n'.join([
'deps = {',
' "src/foo": "%(git_base)srepo_2@%(repo_2_revision)s",',
'}',
'hooks = [',
' {"action": ["foo", "--android", "{checkout_android}"]}',
']',
]) % {
'git_base': self.git_base,
'repo_2_revision': self.git_hashes['repo_2'][1][0],
},
})
self._commit_git(
'repo_1', {
'DEPS': '\n'.join([
'deps = {',
' "src/foo": "file:///%(git_base)srepo_2@%(repo_2_revision)s",',
'}',
'hooks = [',
' {"action": ["foo", "--android", "{checkout_android}"]}',
']',
]) % {
'git_base': self.git_base.replace('\\', '\\\\'),
'repo_2_revision': self.git_hashes['repo_2'][1][0],
},
})
class RollDepTest(fake_repos.FakeReposTestBase):
......@@ -97,7 +98,8 @@ class RollDepTest(fake_repos.FakeReposTestBase):
self.assertEqual(self.gitrevparse(self.foo_dir), expected_revision)
self.assertEqual([
'deps = {',
' "src/foo": "' + self.git_base + 'repo_2@' + expected_revision + '",',
' "src/foo": "file:///' + self.git_base.replace('\\', '\\\\') +
'repo_2@' + expected_revision + '",',
'}',
'hooks = [',
' {"action": ["foo", "--android", "{checkout_android}"]}',
......@@ -128,7 +130,8 @@ class RollDepTest(fake_repos.FakeReposTestBase):
self.assertEqual(self.gitrevparse(self.foo_dir), expected_revision)
self.assertEqual([
'deps = {',
' "src/foo": "' + self.git_base + 'repo_2@' + expected_revision + '",',
' "src/foo": "file:///' + self.git_base.replace('\\', '\\\\') +
'repo_2@' + expected_revision + '",',
'}',
'hooks = [',
' {"action": ["foo", "--android", "{checkout_android}"]}',
......
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