Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
disable backup of sharepoint lists (#4960)
Browse files Browse the repository at this point in the history
disable backup of sharepoint lists

#### Does this PR need a docs update or release note?
- [x] ⛔ No

#### Test Plan

<!-- How will this be tested prior to merging.-->
- [x] 💪 Manual
- [x] ⚡ Unit test
- [x] 💚 E2E
  • Loading branch information
HiteshRepo authored Jan 2, 2024
1 parent e43fec2 commit 4224a98
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 21 deletions.
9 changes: 6 additions & 3 deletions src/cli/utils/sharepoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
}
}

Expand Down
37 changes: 19 additions & 18 deletions src/cli/utils/sharepoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down

0 comments on commit 4224a98

Please sign in to comment.