From 4224a98927db02707d7f3d32992629071b44a99f Mon Sep 17 00:00:00 2001 From: Hitesh Pattanayak <48874082+HiteshRepo@users.noreply.github.com> Date: Wed, 3 Jan 2024 01:11:35 +0530 Subject: [PATCH] disable backup of sharepoint lists (#4960) disable backup of sharepoint lists #### Does this PR need a docs update or release note? - [x] :no_entry: No #### Test Plan - [x] :muscle: Manual - [x] :zap: Unit test - [x] :green_heart: E2E --- src/cli/utils/sharepoint.go | 9 +++++--- src/cli/utils/sharepoint_test.go | 37 ++++++++++++++++---------------- 2 files changed, 25 insertions(+), 21 deletions(-) diff --git a/src/cli/utils/sharepoint.go b/src/cli/utils/sharepoint.go index 0c164c579..bac8298b1 100644 --- a/src/cli/utils/sharepoint.go +++ b/src/cli/utils/sharepoint.go @@ -75,15 +75,18 @@ func SharePointAllowedCategories() map[string]struct{} { func AddCategories(sel *selectors.SharePointBackup, cats []string) *selectors.SharePointBackup { if len(cats) == 0 { - sel.Include(sel.LibraryFolders(selectors.Any()), sel.Lists(selectors.Any())) + // backup of sharepoint lists not enabled yet + // sel.Include(sel.LibraryFolders(selectors.Any()), sel.Lists(selectors.Any())) + sel.Include(sel.LibraryFolders(selectors.Any())) } for _, d := range cats { switch d { + // backup of sharepoint lists not enabled yet + // case flags.DataLists: + // sel.Include(sel.Lists(selectors.Any())) case flags.DataLibraries: sel.Include(sel.LibraryFolders(selectors.Any())) - case flags.DataLists: - sel.Include(sel.Lists(selectors.Any())) } } diff --git a/src/cli/utils/sharepoint_test.go b/src/cli/utils/sharepoint_test.go index f6d4cd75f..2523685d7 100644 --- a/src/cli/utils/sharepoint_test.go +++ b/src/cli/utils/sharepoint_test.go @@ -378,35 +378,36 @@ func (suite *SharePointUtilsSuite) TestValidateSharePointRestoreFlags() { } } +// [TODO] uncomment the test cases once sharepoint list backup is enabled func (suite *SharePointUtilsSuite) TestAddSharepointCategories() { table := []struct { name string cats []string expectScopeLen int }{ - { - name: "none", - cats: []string{}, - expectScopeLen: 2, - }, + // { + // name: "none", + // cats: []string{}, + // expectScopeLen: 2, + // }, { name: "libraries", cats: []string{flags.DataLibraries}, expectScopeLen: 1, }, - { - name: "lists", - cats: []string{flags.DataLists}, - expectScopeLen: 1, - }, - { - name: "all allowed", - cats: []string{ - flags.DataLibraries, - flags.DataLists, - }, - expectScopeLen: 2, - }, + // { + // name: "lists", + // cats: []string{flags.DataLists}, + // expectScopeLen: 1, + // }, + // { + // name: "all allowed", + // cats: []string{ + // flags.DataLibraries, + // flags.DataLists, + // }, + // expectScopeLen: 2, + // }, { name: "bad inputs", cats: []string{"foo"},