add connect cli integration tests (#493)
This commit is contained in:
parent
20aa3d3a28
commit
5070296e18
@ -53,7 +53,7 @@ func addExchangeCommands(parent *cobra.Command) *cobra.Command {
|
|||||||
switch parent.Use {
|
switch parent.Use {
|
||||||
|
|
||||||
case createCommand:
|
case createCommand:
|
||||||
c, fs = utils.AddCommand(parent, exchangeCreateCmd)
|
c, fs = utils.AddCommand(parent, exchangeCreateCmd())
|
||||||
fs.StringSliceVar(&user, "user", nil, "Backup Exchange data by user ID; accepts "+utils.Wildcard+" to select all users")
|
fs.StringSliceVar(&user, "user", nil, "Backup Exchange data by user ID; accepts "+utils.Wildcard+" to select all users")
|
||||||
fs.BoolVar(&exchangeAll, "all", false, "Backup all Exchange data for all users")
|
fs.BoolVar(&exchangeAll, "all", false, "Backup all Exchange data for all users")
|
||||||
fs.StringSliceVar(
|
fs.StringSliceVar(
|
||||||
@ -64,10 +64,10 @@ func addExchangeCommands(parent *cobra.Command) *cobra.Command {
|
|||||||
options.AddOperationFlags(c)
|
options.AddOperationFlags(c)
|
||||||
|
|
||||||
case listCommand:
|
case listCommand:
|
||||||
c, _ = utils.AddCommand(parent, exchangeListCmd)
|
c, _ = utils.AddCommand(parent, exchangeListCmd())
|
||||||
|
|
||||||
case detailsCommand:
|
case detailsCommand:
|
||||||
c, fs = utils.AddCommand(parent, exchangeDetailsCmd)
|
c, fs = utils.AddCommand(parent, exchangeDetailsCmd())
|
||||||
fs.StringVar(&backupID, "backup", "", "ID of the backup containing the details to be shown")
|
fs.StringVar(&backupID, "backup", "", "ID of the backup containing the details to be shown")
|
||||||
cobra.CheckErr(c.MarkFlagRequired("backup"))
|
cobra.CheckErr(c.MarkFlagRequired("backup"))
|
||||||
|
|
||||||
@ -107,11 +107,13 @@ func addExchangeCommands(parent *cobra.Command) *cobra.Command {
|
|||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
// `corso backup create exchange [<flag>...]`
|
// `corso backup create exchange [<flag>...]`
|
||||||
var exchangeCreateCmd = &cobra.Command{
|
func exchangeCreateCmd() *cobra.Command {
|
||||||
Use: exchangeServiceCommand,
|
return &cobra.Command{
|
||||||
Short: "Backup M365 Exchange service data",
|
Use: exchangeServiceCommand,
|
||||||
RunE: createExchangeCmd,
|
Short: "Backup M365 Exchange service data",
|
||||||
Args: cobra.NoArgs,
|
RunE: createExchangeCmd,
|
||||||
|
Args: cobra.NoArgs,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// processes an exchange service backup.
|
// processes an exchange service backup.
|
||||||
@ -213,11 +215,13 @@ func validateExchangeBackupCreateFlags(all bool, users, data []string) error {
|
|||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
// `corso backup list exchange [<flag>...]`
|
// `corso backup list exchange [<flag>...]`
|
||||||
var exchangeListCmd = &cobra.Command{
|
func exchangeListCmd() *cobra.Command {
|
||||||
Use: exchangeServiceCommand,
|
return &cobra.Command{
|
||||||
Short: "List the history of M365 Exchange service backups",
|
Use: exchangeServiceCommand,
|
||||||
RunE: listExchangeCmd,
|
Short: "List the history of M365 Exchange service backups",
|
||||||
Args: cobra.NoArgs,
|
RunE: listExchangeCmd,
|
||||||
|
Args: cobra.NoArgs,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// lists the history of backup operations
|
// lists the history of backup operations
|
||||||
@ -258,11 +262,13 @@ func listExchangeCmd(cmd *cobra.Command, args []string) error {
|
|||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
// `corso backup details exchange [<flag>...]`
|
// `corso backup details exchange [<flag>...]`
|
||||||
var exchangeDetailsCmd = &cobra.Command{
|
func exchangeDetailsCmd() *cobra.Command {
|
||||||
Use: exchangeServiceCommand,
|
return &cobra.Command{
|
||||||
Short: "Shows the details of a M365 Exchange service backup",
|
Use: exchangeServiceCommand,
|
||||||
RunE: detailsExchangeCmd,
|
Short: "Shows the details of a M365 Exchange service backup",
|
||||||
Args: cobra.NoArgs,
|
RunE: detailsExchangeCmd,
|
||||||
|
Args: cobra.NoArgs,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// lists the history of backup operations
|
// lists the history of backup operations
|
||||||
|
|||||||
@ -30,9 +30,9 @@ func (suite *ExchangeSuite) TestAddExchangeCommands() {
|
|||||||
expectShort string
|
expectShort string
|
||||||
expectRunE func(*cobra.Command, []string) error
|
expectRunE func(*cobra.Command, []string) error
|
||||||
}{
|
}{
|
||||||
{"create exchange", createCommand, expectUse, exchangeCreateCmd.Short, createExchangeCmd},
|
{"create exchange", createCommand, expectUse, exchangeCreateCmd().Short, createExchangeCmd},
|
||||||
{"list exchange", listCommand, expectUse, exchangeListCmd.Short, listExchangeCmd},
|
{"list exchange", listCommand, expectUse, exchangeListCmd().Short, listExchangeCmd},
|
||||||
{"details exchange", detailsCommand, expectUse, exchangeDetailsCmd.Short, detailsExchangeCmd},
|
{"details exchange", detailsCommand, expectUse, exchangeDetailsCmd().Short, detailsExchangeCmd},
|
||||||
}
|
}
|
||||||
for _, test := range table {
|
for _, test := range table {
|
||||||
suite.T().Run(test.name, func(t *testing.T) {
|
suite.T().Run(test.name, func(t *testing.T) {
|
||||||
|
|||||||
@ -90,7 +90,7 @@ func initWithViper(vpr *viper.Viper, configFP string) error {
|
|||||||
return errors.New("config file requires an extension e.g. `toml`")
|
return errors.New("config file requires an extension e.g. `toml`")
|
||||||
}
|
}
|
||||||
fileName = strings.TrimSuffix(fileName, ext)
|
fileName = strings.TrimSuffix(fileName, ext)
|
||||||
vpr.SetConfigType(ext[1:])
|
vpr.SetConfigType(strings.TrimPrefix(ext, "."))
|
||||||
vpr.SetConfigName(fileName)
|
vpr.SetConfigName(fileName)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@ -107,7 +107,7 @@ func initS3Cmd(cmd *cobra.Command, args []string) error {
|
|||||||
}
|
}
|
||||||
defer utils.CloseRepo(ctx, r)
|
defer utils.CloseRepo(ctx, r)
|
||||||
|
|
||||||
Infof("Initialized a S3 repository within bucket %s.\n", s3Cfg.Bucket)
|
Infof("Initialized a S3 repository within bucket %s.", s3Cfg.Bucket)
|
||||||
|
|
||||||
if err = config.WriteRepoConfig(ctx, s3Cfg, m365); err != nil {
|
if err = config.WriteRepoConfig(ctx, s3Cfg, m365); err != nil {
|
||||||
return Only(errors.Wrap(err, "Failed to write repository configuration"))
|
return Only(errors.Wrap(err, "Failed to write repository configuration"))
|
||||||
@ -166,7 +166,7 @@ func connectS3Cmd(cmd *cobra.Command, args []string) error {
|
|||||||
}
|
}
|
||||||
defer utils.CloseRepo(ctx, r)
|
defer utils.CloseRepo(ctx, r)
|
||||||
|
|
||||||
Infof("Connected to S3 bucket %s.\n", s3Cfg.Bucket)
|
Infof("Connected to S3 bucket %s.", s3Cfg.Bucket)
|
||||||
|
|
||||||
if err = config.WriteRepoConfig(ctx, s3Cfg, m365); err != nil {
|
if err = config.WriteRepoConfig(ctx, s3Cfg, m365); err != nil {
|
||||||
return Only(errors.Wrap(err, "Failed to write repository configuration"))
|
return Only(errors.Wrap(err, "Failed to write repository configuration"))
|
||||||
|
|||||||
@ -9,6 +9,8 @@ import (
|
|||||||
"github.com/alcionai/corso/cli"
|
"github.com/alcionai/corso/cli"
|
||||||
"github.com/alcionai/corso/cli/config"
|
"github.com/alcionai/corso/cli/config"
|
||||||
"github.com/alcionai/corso/internal/tester"
|
"github.com/alcionai/corso/internal/tester"
|
||||||
|
"github.com/alcionai/corso/pkg/account"
|
||||||
|
"github.com/alcionai/corso/pkg/repository"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------------------------------------
|
||||||
@ -48,12 +50,10 @@ func (suite *S3IntegrationSuite) TestInitS3Cmd() {
|
|||||||
cfg, err := st.S3Config()
|
cfg, err := st.S3Config()
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
vpr, configFP, err := tester.MakeTempTestConfigClone(t)
|
vpr, configFP, err := tester.MakeTempTestConfigClone(t, nil)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
ctx = config.SetViper(ctx, vpr)
|
ctx = config.SetViper(ctx, vpr)
|
||||||
|
|
||||||
require.NoError(t, err)
|
|
||||||
|
|
||||||
cmd := tester.StubRootCmd(
|
cmd := tester.StubRootCmd(
|
||||||
"repo", "init", "s3",
|
"repo", "init", "s3",
|
||||||
"--config-file", configFP,
|
"--config-file", configFP,
|
||||||
@ -64,3 +64,108 @@ func (suite *S3IntegrationSuite) TestInitS3Cmd() {
|
|||||||
// run the command
|
// run the command
|
||||||
require.NoError(t, cmd.ExecuteContext(ctx))
|
require.NoError(t, cmd.ExecuteContext(ctx))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (suite *S3IntegrationSuite) TestInitS3Cmd_missingBucket() {
|
||||||
|
ctx := tester.NewContext()
|
||||||
|
t := suite.T()
|
||||||
|
|
||||||
|
st, err := tester.NewPrefixedS3Storage(t)
|
||||||
|
require.NoError(t, err)
|
||||||
|
cfg, err := st.S3Config()
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
vpr, configFP, err := tester.MakeTempTestConfigClone(t, nil)
|
||||||
|
require.NoError(t, err)
|
||||||
|
ctx = config.SetViper(ctx, vpr)
|
||||||
|
|
||||||
|
cmd := tester.StubRootCmd(
|
||||||
|
"repo", "init", "s3",
|
||||||
|
"--config-file", configFP,
|
||||||
|
"--prefix", cfg.Prefix)
|
||||||
|
cli.BuildCommandTree(cmd)
|
||||||
|
|
||||||
|
// run the command
|
||||||
|
require.Error(t, cmd.ExecuteContext(ctx))
|
||||||
|
}
|
||||||
|
|
||||||
|
func (suite *S3IntegrationSuite) TestConnectS3Cmd() {
|
||||||
|
ctx := tester.NewContext()
|
||||||
|
t := suite.T()
|
||||||
|
|
||||||
|
st, err := tester.NewPrefixedS3Storage(t)
|
||||||
|
require.NoError(t, err)
|
||||||
|
cfg, err := st.S3Config()
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
force := map[string]string{
|
||||||
|
tester.TestCfgAccountProvider: "M365",
|
||||||
|
tester.TestCfgStorageProvider: "S3",
|
||||||
|
tester.TestCfgPrefix: cfg.Prefix,
|
||||||
|
}
|
||||||
|
vpr, configFP, err := tester.MakeTempTestConfigClone(t, force)
|
||||||
|
require.NoError(t, err)
|
||||||
|
ctx = config.SetViper(ctx, vpr)
|
||||||
|
|
||||||
|
// init the repo first
|
||||||
|
_, err = repository.Initialize(ctx, account.Account{}, st)
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
// then connect to it
|
||||||
|
cmd := tester.StubRootCmd(
|
||||||
|
"repo", "connect", "s3",
|
||||||
|
"--config-file", configFP,
|
||||||
|
"--bucket", cfg.Bucket,
|
||||||
|
"--prefix", cfg.Prefix)
|
||||||
|
cli.BuildCommandTree(cmd)
|
||||||
|
|
||||||
|
// run the command
|
||||||
|
require.NoError(t, cmd.ExecuteContext(ctx))
|
||||||
|
}
|
||||||
|
|
||||||
|
func (suite *S3IntegrationSuite) TestConnectS3Cmd_BadBucket() {
|
||||||
|
ctx := tester.NewContext()
|
||||||
|
t := suite.T()
|
||||||
|
|
||||||
|
st, err := tester.NewPrefixedS3Storage(t)
|
||||||
|
require.NoError(t, err)
|
||||||
|
cfg, err := st.S3Config()
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
vpr, configFP, err := tester.MakeTempTestConfigClone(t, nil)
|
||||||
|
require.NoError(t, err)
|
||||||
|
ctx = config.SetViper(ctx, vpr)
|
||||||
|
|
||||||
|
cmd := tester.StubRootCmd(
|
||||||
|
"repo", "connect", "s3",
|
||||||
|
"--config-file", configFP,
|
||||||
|
"--bucket", "wrong",
|
||||||
|
"--prefix", cfg.Prefix)
|
||||||
|
cli.BuildCommandTree(cmd)
|
||||||
|
|
||||||
|
// run the command
|
||||||
|
require.Error(t, cmd.ExecuteContext(ctx))
|
||||||
|
}
|
||||||
|
|
||||||
|
func (suite *S3IntegrationSuite) TestConnectS3Cmd_BadPrefix() {
|
||||||
|
ctx := tester.NewContext()
|
||||||
|
t := suite.T()
|
||||||
|
|
||||||
|
st, err := tester.NewPrefixedS3Storage(t)
|
||||||
|
require.NoError(t, err)
|
||||||
|
cfg, err := st.S3Config()
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
vpr, configFP, err := tester.MakeTempTestConfigClone(t, nil)
|
||||||
|
require.NoError(t, err)
|
||||||
|
ctx = config.SetViper(ctx, vpr)
|
||||||
|
|
||||||
|
cmd := tester.StubRootCmd(
|
||||||
|
"repo", "connect", "s3",
|
||||||
|
"--config-file", configFP,
|
||||||
|
"--bucket", cfg.Bucket,
|
||||||
|
"--prefix", "wrong")
|
||||||
|
cli.BuildCommandTree(cmd)
|
||||||
|
|
||||||
|
// run the command
|
||||||
|
require.Error(t, cmd.ExecuteContext(ctx))
|
||||||
|
}
|
||||||
|
|||||||
@ -38,7 +38,7 @@ func addExchangeCommands(parent *cobra.Command) *cobra.Command {
|
|||||||
|
|
||||||
switch parent.Use {
|
switch parent.Use {
|
||||||
case restoreCommand:
|
case restoreCommand:
|
||||||
c, fs = utils.AddCommand(parent, exchangeRestoreCmd)
|
c, fs = utils.AddCommand(parent, exchangeRestoreCmd())
|
||||||
fs.StringVar(&backupID, "backup", "", "ID of the backup to restore")
|
fs.StringVar(&backupID, "backup", "", "ID of the backup to restore")
|
||||||
cobra.CheckErr(c.MarkFlagRequired("backup"))
|
cobra.CheckErr(c.MarkFlagRequired("backup"))
|
||||||
|
|
||||||
@ -78,11 +78,13 @@ func addExchangeCommands(parent *cobra.Command) *cobra.Command {
|
|||||||
const exchangeServiceCommand = "exchange"
|
const exchangeServiceCommand = "exchange"
|
||||||
|
|
||||||
// `corso restore exchange [<flag>...]`
|
// `corso restore exchange [<flag>...]`
|
||||||
var exchangeRestoreCmd = &cobra.Command{
|
func exchangeRestoreCmd() *cobra.Command {
|
||||||
Use: exchangeServiceCommand,
|
return &cobra.Command{
|
||||||
Short: "Restore M365 Exchange service data",
|
Use: exchangeServiceCommand,
|
||||||
RunE: restoreExchangeCmd,
|
Short: "Restore M365 Exchange service data",
|
||||||
Args: cobra.NoArgs,
|
RunE: restoreExchangeCmd,
|
||||||
|
Args: cobra.NoArgs,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// processes an exchange service restore.
|
// processes an exchange service restore.
|
||||||
|
|||||||
@ -30,7 +30,7 @@ func (suite *ExchangeSuite) TestAddExchangeCommands() {
|
|||||||
expectShort string
|
expectShort string
|
||||||
expectRunE func(*cobra.Command, []string) error
|
expectRunE func(*cobra.Command, []string) error
|
||||||
}{
|
}{
|
||||||
{"restore exchange", restoreCommand, expectUse, exchangeRestoreCmd.Short, restoreExchangeCmd},
|
{"restore exchange", restoreCommand, expectUse, exchangeRestoreCmd().Short, restoreExchangeCmd},
|
||||||
}
|
}
|
||||||
for _, test := range table {
|
for _, test := range table {
|
||||||
suite.T().Run(test.name, func(t *testing.T) {
|
suite.T().Run(test.name, func(t *testing.T) {
|
||||||
|
|||||||
@ -24,7 +24,7 @@ func NewM365Account() (account.Account, error) {
|
|||||||
account.ProviderM365,
|
account.ProviderM365,
|
||||||
account.M365Config{
|
account.M365Config{
|
||||||
M365: credentials.GetM365(),
|
M365: credentials.GetM365(),
|
||||||
TenantID: cfg[testCfgTenantID],
|
TenantID: cfg[TestCfgTenantID],
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,13 +14,15 @@ import (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
// S3 config
|
// S3 config
|
||||||
testCfgBucket = "bucket"
|
TestCfgBucket = "bucket"
|
||||||
testCfgEndpoint = "endpoint"
|
TestCfgEndpoint = "endpoint"
|
||||||
testCfgPrefix = "prefix"
|
TestCfgPrefix = "prefix"
|
||||||
|
TestCfgStorageProvider = "provider"
|
||||||
|
|
||||||
// M365 config
|
// M365 config
|
||||||
testCfgTenantID = "tenantid"
|
TestCfgTenantID = "tenantid"
|
||||||
testCfgUserID = "m365userid"
|
TestCfgUserID = "m365userid"
|
||||||
|
TestCfgAccountProvider = "account_provider"
|
||||||
)
|
)
|
||||||
|
|
||||||
// test specific env vars
|
// test specific env vars
|
||||||
@ -90,11 +92,13 @@ func readTestConfig() (map[string]string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
testEnv := map[string]string{}
|
testEnv := map[string]string{}
|
||||||
fallbackTo(testEnv, testCfgBucket, vpr.GetString(testCfgBucket), "test-corso-repo-init")
|
fallbackTo(testEnv, TestCfgStorageProvider, vpr.GetString(TestCfgStorageProvider))
|
||||||
fallbackTo(testEnv, testCfgEndpoint, vpr.GetString(testCfgEndpoint), "s3.amazonaws.com")
|
fallbackTo(testEnv, TestCfgAccountProvider, vpr.GetString(TestCfgAccountProvider))
|
||||||
fallbackTo(testEnv, testCfgPrefix, vpr.GetString(testCfgPrefix))
|
fallbackTo(testEnv, TestCfgBucket, vpr.GetString(TestCfgBucket), "test-corso-repo-init")
|
||||||
fallbackTo(testEnv, testCfgTenantID, os.Getenv(account.TenantID), vpr.GetString(testCfgTenantID))
|
fallbackTo(testEnv, TestCfgEndpoint, vpr.GetString(TestCfgEndpoint), "s3.amazonaws.com")
|
||||||
fallbackTo(testEnv, testCfgUserID, os.Getenv(EnvCorsoM365TestUserID), vpr.GetString(testCfgTenantID), "lidiah@8qzvrj.onmicrosoft.com")
|
fallbackTo(testEnv, TestCfgPrefix, vpr.GetString(TestCfgPrefix))
|
||||||
|
fallbackTo(testEnv, TestCfgTenantID, os.Getenv(account.TenantID), vpr.GetString(TestCfgTenantID))
|
||||||
|
fallbackTo(testEnv, TestCfgUserID, os.Getenv(EnvCorsoM365TestUserID), vpr.GetString(TestCfgTenantID), "lidiah@8qzvrj.onmicrosoft.com")
|
||||||
testEnv[EnvCorsoTestConfigFilePath] = os.Getenv(EnvCorsoTestConfigFilePath)
|
testEnv[EnvCorsoTestConfigFilePath] = os.Getenv(EnvCorsoTestConfigFilePath)
|
||||||
|
|
||||||
testConfig = testEnv
|
testConfig = testEnv
|
||||||
@ -106,8 +110,11 @@ func readTestConfig() (map[string]string, error) {
|
|||||||
// (such as the CLI) to safely manipulate file contents without amending the user's
|
// (such as the CLI) to safely manipulate file contents without amending the user's
|
||||||
// original file.
|
// original file.
|
||||||
//
|
//
|
||||||
|
// Attempts to copy values sourced from the caller's test config file.
|
||||||
|
// The overrides prop replaces config values with the provided value.
|
||||||
|
//
|
||||||
// Returns a filepath string pointing to the location of the temp file.
|
// Returns a filepath string pointing to the location of the temp file.
|
||||||
func MakeTempTestConfigClone(t *testing.T) (*viper.Viper, string, error) {
|
func MakeTempTestConfigClone(t *testing.T, overrides map[string]string) (*viper.Viper, string, error) {
|
||||||
cfg, err := readTestConfig()
|
cfg, err := readTestConfig()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, "", err
|
return nil, "", err
|
||||||
@ -125,15 +132,20 @@ func MakeTempTestConfigClone(t *testing.T) (*viper.Viper, string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
vpr := viper.New()
|
vpr := viper.New()
|
||||||
|
ext := path.Ext(fName)
|
||||||
vpr.SetConfigFile(tDirFp)
|
vpr.SetConfigFile(tDirFp)
|
||||||
vpr.AddConfigPath(tDir)
|
vpr.AddConfigPath(tDir)
|
||||||
vpr.SetConfigType(path.Ext(fName))
|
vpr.SetConfigType(strings.TrimPrefix(ext, "."))
|
||||||
vpr.SetConfigName(fName)
|
vpr.SetConfigName(strings.TrimSuffix(fName, ext))
|
||||||
|
|
||||||
for k, v := range cfg {
|
for k, v := range cfg {
|
||||||
vpr.Set(k, v)
|
vpr.Set(k, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for k, v := range overrides {
|
||||||
|
vpr.Set(k, v)
|
||||||
|
}
|
||||||
|
|
||||||
if err := vpr.WriteConfig(); err != nil {
|
if err := vpr.WriteConfig(); err != nil {
|
||||||
return nil, "", err
|
return nil, "", err
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,7 +29,7 @@ func NewPrefixedS3Storage(t *testing.T) (storage.Storage, error) {
|
|||||||
storage.ProviderS3,
|
storage.ProviderS3,
|
||||||
storage.S3Config{
|
storage.S3Config{
|
||||||
AWS: credentials.GetAWS(nil),
|
AWS: credentials.GetAWS(nil),
|
||||||
Bucket: cfg[testCfgBucket],
|
Bucket: cfg[TestCfgBucket],
|
||||||
Prefix: t.Name() + "-" + now,
|
Prefix: t.Name() + "-" + now,
|
||||||
},
|
},
|
||||||
storage.CommonConfig{
|
storage.CommonConfig{
|
||||||
|
|||||||
@ -14,5 +14,5 @@ func M365UserID() (string, error) {
|
|||||||
return "", errors.Wrap(err, "retrieving m365 user id from test configuration")
|
return "", errors.Wrap(err, "retrieving m365 user id from test configuration")
|
||||||
}
|
}
|
||||||
|
|
||||||
return cfg[testCfgUserID], nil
|
return cfg[TestCfgUserID], nil
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user