mirror of
https://gerrit.googlesource.com/git-repo
synced 2026-05-07 19:39:18 +00:00
sync: Switch to using self._bloated_projects
Store bloated projects in self._bloated_projects and print warnings at the end of execution. This sets up for moving the check to workers. Bug: 498290329 Change-Id: I993f1fd741db2994d480994861588eb18f6c5503 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/574922 Reviewed-by: Becky Siegel <beckysiegel@google.com> Tested-by: Gavin Mak <gavinmak@google.com> Commit-Queue: Gavin Mak <gavinmak@google.com>
This commit is contained in:
committed by
gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com
parent
61bd6b3ccb
commit
7e9079b7cf
@@ -490,6 +490,7 @@ class CheckForBloatedProjects(unittest.TestCase):
|
||||
self.project.Exists = True
|
||||
self.project.worktree = "worktree"
|
||||
self.cmd.git_event_log = mock.MagicMock()
|
||||
self.cmd._bloated_projects = []
|
||||
|
||||
@mock.patch("subcmds.sync.git_require")
|
||||
def test_git_version_unsupported(self, mock_git_require):
|
||||
@@ -509,7 +510,7 @@ class CheckForBloatedProjects(unittest.TestCase):
|
||||
@mock.patch("subcmds.sync.git_require")
|
||||
@mock.patch("subcmds.sync.Progress")
|
||||
def test_bloated_project_found(self, mock_progress, mock_git_require):
|
||||
"""Test that it logs warning for bloated project."""
|
||||
"""Test that it adds project to _bloated_projects."""
|
||||
mock_git_require.return_value = True
|
||||
|
||||
self.cmd.get_parallel_context = mock.Mock(
|
||||
@@ -527,7 +528,7 @@ class CheckForBloatedProjects(unittest.TestCase):
|
||||
with mock.patch.object(self.cmd, "ParallelContext"):
|
||||
self.cmd._CheckForBloatedProjects([self.project], self.opt)
|
||||
|
||||
self.cmd.git_event_log.ErrorEvent.assert_called_once()
|
||||
self.assertEqual(self.cmd._bloated_projects, ["project"])
|
||||
|
||||
|
||||
class GCProjectsTest(unittest.TestCase):
|
||||
|
||||
Reference in New Issue
Block a user