mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
split: update SelectReviewersForFiles to work with repository root
The current implementation relies on the current working directory, when it traverses the file tree to find the nearest OWNERS. It also causes an infinite loop when it cannot find any OWNERS. This CL changes the implementation so that it works no matter what the cwd is. Bug: 412904761 Change-Id: Ic4e25217aa64bd2eb6514ccdd486fe3b57a82312 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6484531 Commit-Queue: Scott Lee <ddoman@chromium.org> Reviewed-by: Gavin Mak <gavinmak@google.com>
This commit is contained in:
@@ -104,7 +104,6 @@ class SplitClTest(unittest.TestCase):
|
||||
@mock.patch("os.path.isfile")
|
||||
def testSelectReviewersForFiles(self, mock_is_file):
|
||||
mock_is_file.side_effect = self.MockIsFile
|
||||
|
||||
owners_client = mock.Mock(SuggestOwners=self.MockSuggestOwners,
|
||||
EVERYONE="*")
|
||||
cl = mock.Mock(owners_client=owners_client)
|
||||
@@ -116,7 +115,7 @@ class SplitClTest(unittest.TestCase):
|
||||
("M", os.path.join("baz", "owner3", "e.txt"))]
|
||||
|
||||
files_split_by_reviewers = split_cl.SelectReviewersForFiles(
|
||||
cl, "author", files, 0)
|
||||
cl, "author", files, 0, "")
|
||||
|
||||
self.assertEqual(3, len(files_split_by_reviewers.keys()))
|
||||
info1 = files_split_by_reviewers[tuple(["owner1", "owner2"])]
|
||||
|
||||
Reference in New Issue
Block a user