Fix disable-incrementals flag in OneDrive (#3104)
It seems to have been accidentally removed in e4be050. --- #### Does this PR need a docs update or release note? - [ ] ✅ Yes, it's included - [ ] 🕐 Yes, but in a later PR - [x] ⛔ No #### Type of change <!--- Please check the type of change your PR introduces: ---> - [ ] 🌻 Feature - [x] 🐛 Bugfix - [ ] 🗺️ Documentation - [ ] 🤖 Supportability/Tests - [ ] 💻 CI/Deployment - [ ] 🧹 Tech Debt/Cleanup #### Issue(s) <!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. --> * #<issue> #### Test Plan <!-- How will this be tested prior to merging.--> - [ ] 💪 Manual - [x] ⚡ Unit test - [ ] 💚 E2E
This commit is contained in:
parent
ec064e539b
commit
f65df4b039
@ -9,20 +9,21 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
"github.com/stretchr/testify/suite"
|
||||
|
||||
"github.com/alcionai/corso/src/cli/options"
|
||||
"github.com/alcionai/corso/src/cli/utils"
|
||||
"github.com/alcionai/corso/src/cli/utils/testdata"
|
||||
"github.com/alcionai/corso/src/internal/tester"
|
||||
)
|
||||
|
||||
type ExchangeSuite struct {
|
||||
type ExchangeUnitSuite struct {
|
||||
tester.Suite
|
||||
}
|
||||
|
||||
func TestExchangeSuite(t *testing.T) {
|
||||
suite.Run(t, &ExchangeSuite{Suite: tester.NewUnitSuite(t)})
|
||||
func TestExchangeUnitSuite(t *testing.T) {
|
||||
suite.Run(t, &ExchangeUnitSuite{Suite: tester.NewUnitSuite(t)})
|
||||
}
|
||||
|
||||
func (suite *ExchangeSuite) TestAddExchangeCommands() {
|
||||
func (suite *ExchangeUnitSuite) TestAddExchangeCommands() {
|
||||
expectUse := exchangeServiceCommand
|
||||
|
||||
table := []struct {
|
||||
@ -30,23 +31,71 @@ func (suite *ExchangeSuite) TestAddExchangeCommands() {
|
||||
use string
|
||||
expectUse string
|
||||
expectShort string
|
||||
flags []string
|
||||
expectRunE func(*cobra.Command, []string) error
|
||||
}{
|
||||
{
|
||||
"create exchange", createCommand, expectUse + " " + exchangeServiceCommandCreateUseSuffix,
|
||||
exchangeCreateCmd().Short, createExchangeCmd,
|
||||
"create exchange",
|
||||
createCommand,
|
||||
expectUse + " " + exchangeServiceCommandCreateUseSuffix,
|
||||
exchangeCreateCmd().Short,
|
||||
[]string{
|
||||
utils.UserFN,
|
||||
utils.CategoryDataFN,
|
||||
options.DisableIncrementalsFN,
|
||||
options.FailFastFN,
|
||||
options.FetchParallelismFN,
|
||||
options.SkipReduceFN,
|
||||
options.NoStatsFN,
|
||||
},
|
||||
createExchangeCmd,
|
||||
},
|
||||
{
|
||||
"list exchange", listCommand, expectUse,
|
||||
exchangeListCmd().Short, listExchangeCmd,
|
||||
"list exchange",
|
||||
listCommand,
|
||||
expectUse,
|
||||
exchangeListCmd().Short,
|
||||
[]string{
|
||||
utils.BackupFN,
|
||||
failedItemsFN,
|
||||
skippedItemsFN,
|
||||
recoveredErrorsFN,
|
||||
},
|
||||
listExchangeCmd,
|
||||
},
|
||||
{
|
||||
"details exchange", detailsCommand, expectUse + " " + exchangeServiceCommandDetailsUseSuffix,
|
||||
exchangeDetailsCmd().Short, detailsExchangeCmd,
|
||||
"details exchange",
|
||||
detailsCommand,
|
||||
expectUse + " " + exchangeServiceCommandDetailsUseSuffix,
|
||||
exchangeDetailsCmd().Short,
|
||||
[]string{
|
||||
utils.BackupFN,
|
||||
utils.ContactFN,
|
||||
utils.ContactFolderFN,
|
||||
utils.ContactNameFN,
|
||||
utils.EmailFN,
|
||||
utils.EmailFolderFN,
|
||||
utils.EmailReceivedAfterFN,
|
||||
utils.EmailReceivedBeforeFN,
|
||||
utils.EmailSenderFN,
|
||||
utils.EmailSubjectFN,
|
||||
utils.EventFN,
|
||||
utils.EventCalendarFN,
|
||||
utils.EventOrganizerFN,
|
||||
utils.EventRecursFN,
|
||||
utils.EventStartsAfterFN,
|
||||
utils.EventStartsBeforeFN,
|
||||
utils.EventSubjectFN,
|
||||
},
|
||||
detailsExchangeCmd,
|
||||
},
|
||||
{
|
||||
"delete exchange", deleteCommand, expectUse + " " + exchangeServiceCommandDeleteUseSuffix,
|
||||
exchangeDeleteCmd().Short, deleteExchangeCmd,
|
||||
"delete exchange",
|
||||
deleteCommand,
|
||||
expectUse + " " + exchangeServiceCommandDeleteUseSuffix,
|
||||
exchangeDeleteCmd().Short,
|
||||
[]string{utils.BackupFN},
|
||||
deleteExchangeCmd,
|
||||
},
|
||||
}
|
||||
for _, test := range table {
|
||||
@ -69,7 +118,7 @@ func (suite *ExchangeSuite) TestAddExchangeCommands() {
|
||||
}
|
||||
}
|
||||
|
||||
func (suite *ExchangeSuite) TestValidateBackupCreateFlags() {
|
||||
func (suite *ExchangeUnitSuite) TestValidateBackupCreateFlags() {
|
||||
table := []struct {
|
||||
name string
|
||||
user, data []string
|
||||
@ -106,7 +155,7 @@ func (suite *ExchangeSuite) TestValidateBackupCreateFlags() {
|
||||
}
|
||||
}
|
||||
|
||||
func (suite *ExchangeSuite) TestExchangeBackupCreateSelectors() {
|
||||
func (suite *ExchangeUnitSuite) TestExchangeBackupCreateSelectors() {
|
||||
table := []struct {
|
||||
name string
|
||||
user, data []string
|
||||
@ -221,7 +270,7 @@ func (suite *ExchangeSuite) TestExchangeBackupCreateSelectors() {
|
||||
}
|
||||
}
|
||||
|
||||
func (suite *ExchangeSuite) TestExchangeBackupDetailsSelectors() {
|
||||
func (suite *ExchangeUnitSuite) TestExchangeBackupDetailsSelectors() {
|
||||
ctx, flush := tester.NewContext()
|
||||
defer flush()
|
||||
|
||||
@ -241,7 +290,7 @@ func (suite *ExchangeSuite) TestExchangeBackupDetailsSelectors() {
|
||||
}
|
||||
}
|
||||
|
||||
func (suite *ExchangeSuite) TestExchangeBackupDetailsSelectorsBadFormats() {
|
||||
func (suite *ExchangeUnitSuite) TestExchangeBackupDetailsSelectorsBadFormats() {
|
||||
ctx, flush := tester.NewContext()
|
||||
defer flush()
|
||||
|
||||
|
||||
@ -73,6 +73,7 @@ func addOneDriveCommands(cmd *cobra.Command) *cobra.Command {
|
||||
|
||||
utils.AddUserFlag(c)
|
||||
options.AddFailFastFlag(c)
|
||||
options.AddDisableIncrementalsFlag(c)
|
||||
|
||||
case listCommand:
|
||||
c, fs = utils.AddCommand(cmd, oneDriveListCmd())
|
||||
|
||||
@ -9,19 +9,21 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
"github.com/stretchr/testify/suite"
|
||||
|
||||
"github.com/alcionai/corso/src/cli/options"
|
||||
"github.com/alcionai/corso/src/cli/utils"
|
||||
"github.com/alcionai/corso/src/cli/utils/testdata"
|
||||
"github.com/alcionai/corso/src/internal/tester"
|
||||
)
|
||||
|
||||
type OneDriveSuite struct {
|
||||
type OneDriveUnitSuite struct {
|
||||
tester.Suite
|
||||
}
|
||||
|
||||
func TestOneDriveSuite(t *testing.T) {
|
||||
suite.Run(t, &OneDriveSuite{Suite: tester.NewUnitSuite(t)})
|
||||
func TestOneDriveUnitSuite(t *testing.T) {
|
||||
suite.Run(t, &OneDriveUnitSuite{Suite: tester.NewUnitSuite(t)})
|
||||
}
|
||||
|
||||
func (suite *OneDriveSuite) TestAddOneDriveCommands() {
|
||||
func (suite *OneDriveUnitSuite) TestAddOneDriveCommands() {
|
||||
expectUse := oneDriveServiceCommand
|
||||
|
||||
table := []struct {
|
||||
@ -29,25 +31,60 @@ func (suite *OneDriveSuite) TestAddOneDriveCommands() {
|
||||
use string
|
||||
expectUse string
|
||||
expectShort string
|
||||
flags []string
|
||||
expectRunE func(*cobra.Command, []string) error
|
||||
}{
|
||||
{
|
||||
"create onedrive", createCommand, expectUse + " " + oneDriveServiceCommandCreateUseSuffix,
|
||||
oneDriveCreateCmd().Short, createOneDriveCmd,
|
||||
"create onedrive",
|
||||
createCommand,
|
||||
expectUse + " " + oneDriveServiceCommandCreateUseSuffix,
|
||||
oneDriveCreateCmd().Short,
|
||||
[]string{
|
||||
utils.UserFN,
|
||||
options.DisableIncrementalsFN,
|
||||
options.FailFastFN,
|
||||
},
|
||||
createOneDriveCmd,
|
||||
},
|
||||
{
|
||||
"list onedrive", listCommand, expectUse,
|
||||
oneDriveListCmd().Short, listOneDriveCmd,
|
||||
"list onedrive",
|
||||
listCommand,
|
||||
expectUse,
|
||||
oneDriveListCmd().Short,
|
||||
[]string{
|
||||
utils.BackupFN,
|
||||
failedItemsFN,
|
||||
skippedItemsFN,
|
||||
recoveredErrorsFN,
|
||||
},
|
||||
listOneDriveCmd,
|
||||
},
|
||||
{
|
||||
"details onedrive", detailsCommand, expectUse + " " + oneDriveServiceCommandDetailsUseSuffix,
|
||||
oneDriveDetailsCmd().Short, detailsOneDriveCmd,
|
||||
"details onedrive",
|
||||
detailsCommand,
|
||||
expectUse + " " + oneDriveServiceCommandDetailsUseSuffix,
|
||||
oneDriveDetailsCmd().Short,
|
||||
[]string{
|
||||
utils.BackupFN,
|
||||
utils.FolderFN,
|
||||
utils.FileFN,
|
||||
utils.FileCreatedAfterFN,
|
||||
utils.FileCreatedBeforeFN,
|
||||
utils.FileModifiedAfterFN,
|
||||
utils.FileModifiedBeforeFN,
|
||||
},
|
||||
detailsOneDriveCmd,
|
||||
},
|
||||
{
|
||||
"delete onedrive", deleteCommand, expectUse + " " + oneDriveServiceCommandDeleteUseSuffix,
|
||||
oneDriveDeleteCmd().Short, deleteOneDriveCmd,
|
||||
"delete onedrive",
|
||||
deleteCommand,
|
||||
expectUse + " " + oneDriveServiceCommandDeleteUseSuffix,
|
||||
oneDriveDeleteCmd().Short,
|
||||
[]string{utils.BackupFN},
|
||||
deleteOneDriveCmd,
|
||||
},
|
||||
}
|
||||
|
||||
for _, test := range table {
|
||||
suite.Run(test.name, func() {
|
||||
t := suite.T()
|
||||
@ -64,11 +101,15 @@ func (suite *OneDriveSuite) TestAddOneDriveCommands() {
|
||||
assert.Equal(t, test.expectUse, child.Use)
|
||||
assert.Equal(t, test.expectShort, child.Short)
|
||||
tester.AreSameFunc(t, test.expectRunE, child.RunE)
|
||||
|
||||
for _, f := range test.flags {
|
||||
assert.NotNil(t, c.Flag(f), f+" flag")
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func (suite *OneDriveSuite) TestValidateOneDriveBackupCreateFlags() {
|
||||
func (suite *OneDriveUnitSuite) TestValidateOneDriveBackupCreateFlags() {
|
||||
table := []struct {
|
||||
name string
|
||||
user []string
|
||||
@ -92,7 +133,7 @@ func (suite *OneDriveSuite) TestValidateOneDriveBackupCreateFlags() {
|
||||
}
|
||||
}
|
||||
|
||||
func (suite *OneDriveSuite) TestOneDriveBackupDetailsSelectors() {
|
||||
func (suite *OneDriveUnitSuite) TestOneDriveBackupDetailsSelectors() {
|
||||
ctx, flush := tester.NewContext()
|
||||
defer flush()
|
||||
|
||||
@ -112,7 +153,7 @@ func (suite *OneDriveSuite) TestOneDriveBackupDetailsSelectors() {
|
||||
}
|
||||
}
|
||||
|
||||
func (suite *OneDriveSuite) TestOneDriveBackupDetailsSelectorsBadFormats() {
|
||||
func (suite *OneDriveUnitSuite) TestOneDriveBackupDetailsSelectorsBadFormats() {
|
||||
ctx, flush := tester.NewContext()
|
||||
defer flush()
|
||||
|
||||
|
||||
@ -84,6 +84,7 @@ func addSharePointCommands(cmd *cobra.Command) *cobra.Command {
|
||||
utils.AddSiteIDFlag(c)
|
||||
utils.AddDataFlag(c, []string{dataLibraries}, true)
|
||||
options.AddFailFastFlag(c)
|
||||
options.AddDisableIncrementalsFlag(c)
|
||||
|
||||
case listCommand:
|
||||
c, fs = utils.AddCommand(cmd, sharePointListCmd())
|
||||
|
||||
@ -9,6 +9,7 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
"github.com/stretchr/testify/suite"
|
||||
|
||||
"github.com/alcionai/corso/src/cli/options"
|
||||
"github.com/alcionai/corso/src/cli/utils"
|
||||
"github.com/alcionai/corso/src/cli/utils/testdata"
|
||||
"github.com/alcionai/corso/src/internal/common"
|
||||
@ -16,15 +17,15 @@ import (
|
||||
"github.com/alcionai/corso/src/pkg/selectors"
|
||||
)
|
||||
|
||||
type SharePointSuite struct {
|
||||
type SharePointUnitSuite struct {
|
||||
tester.Suite
|
||||
}
|
||||
|
||||
func TestSharePointSuite(t *testing.T) {
|
||||
suite.Run(t, &SharePointSuite{tester.NewUnitSuite(t)})
|
||||
func TestSharePointUnitSuite(t *testing.T) {
|
||||
suite.Run(t, &SharePointUnitSuite{tester.NewUnitSuite(t)})
|
||||
}
|
||||
|
||||
func (suite *SharePointSuite) TestAddSharePointCommands() {
|
||||
func (suite *SharePointUnitSuite) TestAddSharePointCommands() {
|
||||
expectUse := sharePointServiceCommand
|
||||
|
||||
table := []struct {
|
||||
@ -32,23 +33,58 @@ func (suite *SharePointSuite) TestAddSharePointCommands() {
|
||||
use string
|
||||
expectUse string
|
||||
expectShort string
|
||||
flags []string
|
||||
expectRunE func(*cobra.Command, []string) error
|
||||
}{
|
||||
{
|
||||
"create sharepoint", createCommand, expectUse + " " + sharePointServiceCommandCreateUseSuffix,
|
||||
sharePointCreateCmd().Short, createSharePointCmd,
|
||||
"create sharepoint",
|
||||
createCommand,
|
||||
expectUse + " " + sharePointServiceCommandCreateUseSuffix,
|
||||
sharePointCreateCmd().Short,
|
||||
[]string{
|
||||
utils.SiteFN,
|
||||
options.DisableIncrementalsFN,
|
||||
options.FailFastFN,
|
||||
},
|
||||
createSharePointCmd,
|
||||
},
|
||||
{
|
||||
"list sharepoint", listCommand, expectUse,
|
||||
sharePointListCmd().Short, listSharePointCmd,
|
||||
"list sharepoint",
|
||||
listCommand,
|
||||
expectUse,
|
||||
sharePointListCmd().Short,
|
||||
[]string{
|
||||
utils.BackupFN,
|
||||
failedItemsFN,
|
||||
skippedItemsFN,
|
||||
recoveredErrorsFN,
|
||||
},
|
||||
listSharePointCmd,
|
||||
},
|
||||
{
|
||||
"details sharepoint", detailsCommand, expectUse + " " + sharePointServiceCommandDetailsUseSuffix,
|
||||
sharePointDetailsCmd().Short, detailsSharePointCmd,
|
||||
"details sharepoint",
|
||||
detailsCommand,
|
||||
expectUse + " " + sharePointServiceCommandDetailsUseSuffix,
|
||||
sharePointDetailsCmd().Short,
|
||||
[]string{
|
||||
utils.BackupFN,
|
||||
utils.LibraryFN,
|
||||
utils.FolderFN,
|
||||
utils.FileFN,
|
||||
utils.FileCreatedAfterFN,
|
||||
utils.FileCreatedBeforeFN,
|
||||
utils.FileModifiedAfterFN,
|
||||
utils.FileModifiedBeforeFN,
|
||||
},
|
||||
detailsSharePointCmd,
|
||||
},
|
||||
{
|
||||
"delete sharepoint", deleteCommand, expectUse + " " + sharePointServiceCommandDeleteUseSuffix,
|
||||
sharePointDeleteCmd().Short, deleteSharePointCmd,
|
||||
"delete sharepoint",
|
||||
deleteCommand,
|
||||
expectUse + " " + sharePointServiceCommandDeleteUseSuffix,
|
||||
sharePointDeleteCmd().Short,
|
||||
[]string{utils.BackupFN},
|
||||
deleteSharePointCmd,
|
||||
},
|
||||
}
|
||||
for _, test := range table {
|
||||
@ -67,11 +103,15 @@ func (suite *SharePointSuite) TestAddSharePointCommands() {
|
||||
assert.Equal(t, test.expectUse, child.Use)
|
||||
assert.Equal(t, test.expectShort, child.Short)
|
||||
tester.AreSameFunc(t, test.expectRunE, child.RunE)
|
||||
|
||||
for _, f := range test.flags {
|
||||
assert.NotNil(t, c.Flag(f), f+" flag")
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func (suite *SharePointSuite) TestValidateSharePointBackupCreateFlags() {
|
||||
func (suite *SharePointUnitSuite) TestValidateSharePointBackupCreateFlags() {
|
||||
table := []struct {
|
||||
name string
|
||||
site []string
|
||||
@ -107,7 +147,7 @@ func (suite *SharePointSuite) TestValidateSharePointBackupCreateFlags() {
|
||||
}
|
||||
}
|
||||
|
||||
func (suite *SharePointSuite) TestSharePointBackupCreateSelectors() {
|
||||
func (suite *SharePointUnitSuite) TestSharePointBackupCreateSelectors() {
|
||||
const (
|
||||
id1 = "id_1"
|
||||
id2 = "id_2"
|
||||
@ -215,7 +255,7 @@ func (suite *SharePointSuite) TestSharePointBackupCreateSelectors() {
|
||||
}
|
||||
}
|
||||
|
||||
func (suite *SharePointSuite) TestSharePointBackupDetailsSelectors() {
|
||||
func (suite *SharePointUnitSuite) TestSharePointBackupDetailsSelectors() {
|
||||
ctx, flush := tester.NewContext()
|
||||
defer flush()
|
||||
|
||||
@ -235,7 +275,7 @@ func (suite *SharePointSuite) TestSharePointBackupDetailsSelectors() {
|
||||
}
|
||||
}
|
||||
|
||||
func (suite *SharePointSuite) TestSharePointBackupDetailsSelectorsBadFormats() {
|
||||
func (suite *SharePointUnitSuite) TestSharePointBackupDetailsSelectorsBadFormats() {
|
||||
ctx, flush := tester.NewContext()
|
||||
defer flush()
|
||||
|
||||
|
||||
@ -28,11 +28,12 @@ func Control() control.Options {
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
const (
|
||||
failFastFN = "fail-fast"
|
||||
fetchParallelismFN = "fetch-parallelism"
|
||||
noStatsFN = "no-stats"
|
||||
restorePermissionsFN = "restore-permissions"
|
||||
skipReduceFN = "skip-reduce"
|
||||
FailFastFN = "fail-fast"
|
||||
FetchParallelismFN = "fetch-parallelism"
|
||||
NoStatsFN = "no-stats"
|
||||
RestorePermissionsFN = "restore-permissions"
|
||||
SkipReduceFN = "skip-reduce"
|
||||
DisableIncrementalsFN = "disable-incrementals"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -46,29 +47,29 @@ var (
|
||||
// AddGlobalOperationFlags adds the global operations flag set.
|
||||
func AddGlobalOperationFlags(cmd *cobra.Command) {
|
||||
fs := cmd.PersistentFlags()
|
||||
fs.BoolVar(&noStatsFV, noStatsFN, false, "disable anonymous usage statistics gathering")
|
||||
fs.BoolVar(&noStatsFV, NoStatsFN, false, "disable anonymous usage statistics gathering")
|
||||
}
|
||||
|
||||
// AddFailFastFlag adds a flag to toggle fail-fast error handling behavior.
|
||||
func AddFailFastFlag(cmd *cobra.Command) {
|
||||
fs := cmd.Flags()
|
||||
fs.BoolVar(&failFastFV, failFastFN, false, "stop processing immediately if any error occurs")
|
||||
fs.BoolVar(&failFastFV, FailFastFN, false, "stop processing immediately if any error occurs")
|
||||
// TODO: reveal this flag when fail-fast support is implemented
|
||||
cobra.CheckErr(fs.MarkHidden(failFastFN))
|
||||
cobra.CheckErr(fs.MarkHidden(FailFastFN))
|
||||
}
|
||||
|
||||
// AddRestorePermissionsFlag adds OneDrive flag for restoring permissions
|
||||
func AddRestorePermissionsFlag(cmd *cobra.Command) {
|
||||
fs := cmd.Flags()
|
||||
fs.BoolVar(&restorePermissionsFV, restorePermissionsFN, false, "Restore permissions for files and folders")
|
||||
fs.BoolVar(&restorePermissionsFV, RestorePermissionsFN, false, "Restore permissions for files and folders")
|
||||
}
|
||||
|
||||
// AddSkipReduceFlag adds a hidden flag that allows callers to skip the selector
|
||||
// reduction step. Currently only intended for details commands, not restore.
|
||||
func AddSkipReduceFlag(cmd *cobra.Command) {
|
||||
fs := cmd.Flags()
|
||||
fs.BoolVar(&skipReduceFV, skipReduceFN, false, "Skip the selector reduce filtering")
|
||||
cobra.CheckErr(fs.MarkHidden(skipReduceFN))
|
||||
fs.BoolVar(&skipReduceFV, SkipReduceFN, false, "Skip the selector reduce filtering")
|
||||
cobra.CheckErr(fs.MarkHidden(SkipReduceFN))
|
||||
}
|
||||
|
||||
// AddFetchParallelismFlag adds a hidden flag that allows callers to reduce call
|
||||
@ -77,18 +78,16 @@ func AddFetchParallelismFlag(cmd *cobra.Command) {
|
||||
fs := cmd.Flags()
|
||||
fs.IntVar(
|
||||
&fetchParallelismFV,
|
||||
fetchParallelismFN,
|
||||
FetchParallelismFN,
|
||||
4,
|
||||
"Control the number of concurrent data fetches for Exchange. Valid range is [1-4]. Default: 4")
|
||||
cobra.CheckErr(fs.MarkHidden(fetchParallelismFN))
|
||||
cobra.CheckErr(fs.MarkHidden(FetchParallelismFN))
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Feature Flags
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
const disableIncrementalsFN = "disable-incrementals"
|
||||
|
||||
var disableIncrementalsFV bool
|
||||
|
||||
// Adds the hidden '--disable-incrementals' cli flag which, when set, disables
|
||||
@ -97,8 +96,8 @@ func AddDisableIncrementalsFlag(cmd *cobra.Command) {
|
||||
fs := cmd.Flags()
|
||||
fs.BoolVar(
|
||||
&disableIncrementalsFV,
|
||||
disableIncrementalsFN,
|
||||
DisableIncrementalsFN,
|
||||
false,
|
||||
"Disable incremental data retrieval in backups.")
|
||||
cobra.CheckErr(fs.MarkHidden(disableIncrementalsFN))
|
||||
cobra.CheckErr(fs.MarkHidden(DisableIncrementalsFN))
|
||||
}
|
||||
|
||||
@ -26,12 +26,12 @@ func (suite *OptionsUnitSuite) TestAddExchangeCommands() {
|
||||
cmd := &cobra.Command{
|
||||
Use: "test",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
assert.True(t, failFastFV, failFastFN)
|
||||
assert.True(t, disableIncrementalsFV, disableIncrementalsFN)
|
||||
assert.True(t, noStatsFV, noStatsFN)
|
||||
assert.True(t, restorePermissionsFV, restorePermissionsFN)
|
||||
assert.True(t, skipReduceFV, skipReduceFN)
|
||||
assert.Equal(t, 2, fetchParallelismFV, fetchParallelismFN)
|
||||
assert.True(t, failFastFV, FailFastFN)
|
||||
assert.True(t, disableIncrementalsFV, DisableIncrementalsFN)
|
||||
assert.True(t, noStatsFV, NoStatsFN)
|
||||
assert.True(t, restorePermissionsFV, RestorePermissionsFN)
|
||||
assert.True(t, skipReduceFV, SkipReduceFN)
|
||||
assert.Equal(t, 2, fetchParallelismFV, FetchParallelismFN)
|
||||
},
|
||||
}
|
||||
|
||||
@ -48,13 +48,13 @@ func (suite *OptionsUnitSuite) TestAddExchangeCommands() {
|
||||
// Test arg parsing for few args
|
||||
cmd.SetArgs([]string{
|
||||
"test",
|
||||
"--" + failFastFN,
|
||||
"--" + disableIncrementalsFN,
|
||||
"--" + noStatsFN,
|
||||
"--" + restorePermissionsFN,
|
||||
"--" + skipReduceFN,
|
||||
"--" + FailFastFN,
|
||||
"--" + DisableIncrementalsFN,
|
||||
"--" + NoStatsFN,
|
||||
"--" + RestorePermissionsFN,
|
||||
"--" + SkipReduceFN,
|
||||
|
||||
"--" + fetchParallelismFN, "2",
|
||||
"--" + FetchParallelismFN, "2",
|
||||
})
|
||||
|
||||
err := cmd.Execute()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user