parent
07faa7bffb
commit
ce1f4406f1
@ -50,13 +50,11 @@ type NoBackupExchangeIntegrationSuite struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestNoBackupExchangeIntegrationSuite(t *testing.T) {
|
func TestNoBackupExchangeIntegrationSuite(t *testing.T) {
|
||||||
if err := tester.RunOnAny(
|
tester.RunOnAny(
|
||||||
|
t,
|
||||||
tester.CorsoCITests,
|
tester.CorsoCITests,
|
||||||
tester.CorsoCLITests,
|
tester.CorsoCLITests,
|
||||||
tester.CorsoCLIBackupTests,
|
tester.CorsoCLIBackupTests)
|
||||||
); err != nil {
|
|
||||||
t.Skip(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
suite.Run(t, new(NoBackupExchangeIntegrationSuite))
|
suite.Run(t, new(NoBackupExchangeIntegrationSuite))
|
||||||
}
|
}
|
||||||
@ -67,10 +65,7 @@ func (suite *NoBackupExchangeIntegrationSuite) SetupSuite() {
|
|||||||
|
|
||||||
defer flush()
|
defer flush()
|
||||||
|
|
||||||
_, err := tester.GetRequiredEnvSls(
|
tester.MustGetEnvSets(t, tester.AWSStorageCredEnvs, tester.M365AcctCredEnvs)
|
||||||
tester.AWSStorageCredEnvs,
|
|
||||||
tester.M365AcctCredEnvs)
|
|
||||||
require.NoError(t, err)
|
|
||||||
|
|
||||||
// prepare common details
|
// prepare common details
|
||||||
suite.acct = tester.NewM365Account(t)
|
suite.acct = tester.NewM365Account(t)
|
||||||
@ -138,13 +133,11 @@ type BackupExchangeIntegrationSuite struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestBackupExchangeIntegrationSuite(t *testing.T) {
|
func TestBackupExchangeIntegrationSuite(t *testing.T) {
|
||||||
if err := tester.RunOnAny(
|
tester.RunOnAny(
|
||||||
|
t,
|
||||||
tester.CorsoCITests,
|
tester.CorsoCITests,
|
||||||
tester.CorsoCLITests,
|
tester.CorsoCLITests,
|
||||||
tester.CorsoCLIBackupTests,
|
tester.CorsoCLIBackupTests)
|
||||||
); err != nil {
|
|
||||||
t.Skip(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
suite.Run(t, new(BackupExchangeIntegrationSuite))
|
suite.Run(t, new(BackupExchangeIntegrationSuite))
|
||||||
}
|
}
|
||||||
@ -155,10 +148,7 @@ func (suite *BackupExchangeIntegrationSuite) SetupSuite() {
|
|||||||
|
|
||||||
defer flush()
|
defer flush()
|
||||||
|
|
||||||
_, err := tester.GetRequiredEnvSls(
|
tester.MustGetEnvSets(t, tester.AWSStorageCredEnvs, tester.M365AcctCredEnvs)
|
||||||
tester.AWSStorageCredEnvs,
|
|
||||||
tester.M365AcctCredEnvs)
|
|
||||||
require.NoError(t, err)
|
|
||||||
|
|
||||||
// prepare common details
|
// prepare common details
|
||||||
suite.acct = tester.NewM365Account(t)
|
suite.acct = tester.NewM365Account(t)
|
||||||
@ -234,23 +224,18 @@ type PreparedBackupExchangeIntegrationSuite struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestPreparedBackupExchangeIntegrationSuite(t *testing.T) {
|
func TestPreparedBackupExchangeIntegrationSuite(t *testing.T) {
|
||||||
if err := tester.RunOnAny(
|
tester.RunOnAny(
|
||||||
|
t,
|
||||||
tester.CorsoCITests,
|
tester.CorsoCITests,
|
||||||
tester.CorsoCLITests,
|
tester.CorsoCLITests,
|
||||||
tester.CorsoCLIBackupTests,
|
tester.CorsoCLIBackupTests)
|
||||||
); err != nil {
|
|
||||||
t.Skip(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
suite.Run(t, new(PreparedBackupExchangeIntegrationSuite))
|
suite.Run(t, new(PreparedBackupExchangeIntegrationSuite))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (suite *PreparedBackupExchangeIntegrationSuite) SetupSuite() {
|
func (suite *PreparedBackupExchangeIntegrationSuite) SetupSuite() {
|
||||||
t := suite.T()
|
t := suite.T()
|
||||||
_, err := tester.GetRequiredEnvSls(
|
tester.MustGetEnvSets(t, tester.AWSStorageCredEnvs, tester.M365AcctCredEnvs)
|
||||||
tester.AWSStorageCredEnvs,
|
|
||||||
tester.M365AcctCredEnvs)
|
|
||||||
require.NoError(t, err)
|
|
||||||
|
|
||||||
// prepare common details
|
// prepare common details
|
||||||
suite.acct = tester.NewM365Account(t)
|
suite.acct = tester.NewM365Account(t)
|
||||||
@ -471,23 +456,18 @@ type BackupDeleteExchangeIntegrationSuite struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestBackupDeleteExchangeIntegrationSuite(t *testing.T) {
|
func TestBackupDeleteExchangeIntegrationSuite(t *testing.T) {
|
||||||
if err := tester.RunOnAny(
|
tester.RunOnAny(
|
||||||
|
t,
|
||||||
tester.CorsoCITests,
|
tester.CorsoCITests,
|
||||||
tester.CorsoCLITests,
|
tester.CorsoCLITests,
|
||||||
tester.CorsoCLIBackupTests,
|
tester.CorsoCLIBackupTests)
|
||||||
); err != nil {
|
|
||||||
t.Skip(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
suite.Run(t, new(BackupDeleteExchangeIntegrationSuite))
|
suite.Run(t, new(BackupDeleteExchangeIntegrationSuite))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (suite *BackupDeleteExchangeIntegrationSuite) SetupSuite() {
|
func (suite *BackupDeleteExchangeIntegrationSuite) SetupSuite() {
|
||||||
t := suite.T()
|
t := suite.T()
|
||||||
_, err := tester.GetRequiredEnvSls(
|
tester.MustGetEnvSets(t, tester.AWSStorageCredEnvs, tester.M365AcctCredEnvs)
|
||||||
tester.AWSStorageCredEnvs,
|
|
||||||
tester.M365AcctCredEnvs)
|
|
||||||
require.NoError(t, err)
|
|
||||||
|
|
||||||
// prepare common details
|
// prepare common details
|
||||||
suite.acct = tester.NewM365Account(t)
|
suite.acct = tester.NewM365Account(t)
|
||||||
|
|||||||
@ -40,13 +40,7 @@ type NoBackupOneDriveIntegrationSuite struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestNoBackupOneDriveIntegrationSuite(t *testing.T) {
|
func TestNoBackupOneDriveIntegrationSuite(t *testing.T) {
|
||||||
if err := tester.RunOnAny(
|
tester.RunOnAny(t, tester.CorsoCITests, tester.CorsoCLITests, tester.CorsoCLIBackupTests)
|
||||||
tester.CorsoCITests,
|
|
||||||
tester.CorsoCLITests,
|
|
||||||
tester.CorsoCLIBackupTests,
|
|
||||||
); err != nil {
|
|
||||||
t.Skip(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
suite.Run(t, new(NoBackupOneDriveIntegrationSuite))
|
suite.Run(t, new(NoBackupOneDriveIntegrationSuite))
|
||||||
}
|
}
|
||||||
@ -57,10 +51,7 @@ func (suite *NoBackupOneDriveIntegrationSuite) SetupSuite() {
|
|||||||
|
|
||||||
defer flush()
|
defer flush()
|
||||||
|
|
||||||
_, err := tester.GetRequiredEnvSls(
|
tester.MustGetEnvSets(t, tester.AWSStorageCredEnvs, tester.M365AcctCredEnvs)
|
||||||
tester.AWSStorageCredEnvs,
|
|
||||||
tester.M365AcctCredEnvs)
|
|
||||||
require.NoError(t, err)
|
|
||||||
|
|
||||||
// prepare common details
|
// prepare common details
|
||||||
suite.acct = tester.NewM365Account(t)
|
suite.acct = tester.NewM365Account(t)
|
||||||
@ -128,23 +119,18 @@ type BackupDeleteOneDriveIntegrationSuite struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestBackupDeleteOneDriveIntegrationSuite(t *testing.T) {
|
func TestBackupDeleteOneDriveIntegrationSuite(t *testing.T) {
|
||||||
if err := tester.RunOnAny(
|
tester.RunOnAny(
|
||||||
|
t,
|
||||||
tester.CorsoCITests,
|
tester.CorsoCITests,
|
||||||
tester.CorsoCLITests,
|
tester.CorsoCLITests,
|
||||||
tester.CorsoCLIBackupTests,
|
tester.CorsoCLIBackupTests)
|
||||||
); err != nil {
|
|
||||||
t.Skip(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
suite.Run(t, new(BackupDeleteOneDriveIntegrationSuite))
|
suite.Run(t, new(BackupDeleteOneDriveIntegrationSuite))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (suite *BackupDeleteOneDriveIntegrationSuite) SetupSuite() {
|
func (suite *BackupDeleteOneDriveIntegrationSuite) SetupSuite() {
|
||||||
t := suite.T()
|
t := suite.T()
|
||||||
_, err := tester.GetRequiredEnvSls(
|
tester.MustGetEnvSets(t, tester.AWSStorageCredEnvs, tester.M365AcctCredEnvs)
|
||||||
tester.AWSStorageCredEnvs,
|
|
||||||
tester.M365AcctCredEnvs)
|
|
||||||
require.NoError(t, err)
|
|
||||||
|
|
||||||
// prepare common details
|
// prepare common details
|
||||||
suite.acct = tester.NewM365Account(t)
|
suite.acct = tester.NewM365Account(t)
|
||||||
|
|||||||
@ -40,13 +40,7 @@ type NoBackupSharePointIntegrationSuite struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestNoBackupSharePointIntegrationSuite(t *testing.T) {
|
func TestNoBackupSharePointIntegrationSuite(t *testing.T) {
|
||||||
if err := tester.RunOnAny(
|
tester.RunOnAny(t, tester.CorsoCITests, tester.CorsoCLITests, tester.CorsoCLIBackupTests)
|
||||||
tester.CorsoCITests,
|
|
||||||
tester.CorsoCLITests,
|
|
||||||
tester.CorsoCLIBackupTests,
|
|
||||||
); err != nil {
|
|
||||||
t.Skip(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
suite.Run(t, new(NoBackupSharePointIntegrationSuite))
|
suite.Run(t, new(NoBackupSharePointIntegrationSuite))
|
||||||
}
|
}
|
||||||
@ -57,10 +51,7 @@ func (suite *NoBackupSharePointIntegrationSuite) SetupSuite() {
|
|||||||
|
|
||||||
defer flush()
|
defer flush()
|
||||||
|
|
||||||
_, err := tester.GetRequiredEnvSls(
|
tester.MustGetEnvSets(t, tester.AWSStorageCredEnvs, tester.M365AcctCredEnvs)
|
||||||
tester.AWSStorageCredEnvs,
|
|
||||||
tester.M365AcctCredEnvs)
|
|
||||||
require.NoError(t, err)
|
|
||||||
|
|
||||||
// prepare common details
|
// prepare common details
|
||||||
suite.acct = tester.NewM365Account(t)
|
suite.acct = tester.NewM365Account(t)
|
||||||
@ -128,23 +119,14 @@ type BackupDeleteSharePointIntegrationSuite struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestBackupDeleteSharePointIntegrationSuite(t *testing.T) {
|
func TestBackupDeleteSharePointIntegrationSuite(t *testing.T) {
|
||||||
if err := tester.RunOnAny(
|
tester.RunOnAny(t, tester.CorsoCITests, tester.CorsoCLITests, tester.CorsoCLIBackupTests)
|
||||||
tester.CorsoCITests,
|
|
||||||
tester.CorsoCLITests,
|
|
||||||
tester.CorsoCLIBackupTests,
|
|
||||||
); err != nil {
|
|
||||||
t.Skip(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
suite.Run(t, new(BackupDeleteSharePointIntegrationSuite))
|
suite.Run(t, new(BackupDeleteSharePointIntegrationSuite))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (suite *BackupDeleteSharePointIntegrationSuite) SetupSuite() {
|
func (suite *BackupDeleteSharePointIntegrationSuite) SetupSuite() {
|
||||||
t := suite.T()
|
t := suite.T()
|
||||||
_, err := tester.GetRequiredEnvSls(
|
tester.MustGetEnvSets(t, tester.AWSStorageCredEnvs, tester.M365AcctCredEnvs)
|
||||||
tester.AWSStorageCredEnvs,
|
|
||||||
tester.M365AcctCredEnvs)
|
|
||||||
require.NoError(t, err)
|
|
||||||
|
|
||||||
// prepare common details
|
// prepare common details
|
||||||
suite.acct = tester.NewM365Account(t)
|
suite.acct = tester.NewM365Account(t)
|
||||||
|
|||||||
@ -187,21 +187,16 @@ type ConfigIntegrationSuite struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestConfigIntegrationSuite(t *testing.T) {
|
func TestConfigIntegrationSuite(t *testing.T) {
|
||||||
if err := tester.RunOnAny(
|
tester.RunOnAny(
|
||||||
|
t,
|
||||||
tester.CorsoCITests,
|
tester.CorsoCITests,
|
||||||
tester.CorsoCLIConfigTests,
|
tester.CorsoCLIConfigTests)
|
||||||
); err != nil {
|
|
||||||
t.Skip(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
suite.Run(t, new(ConfigIntegrationSuite))
|
suite.Run(t, new(ConfigIntegrationSuite))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (suite *ConfigIntegrationSuite) SetupSuite() {
|
func (suite *ConfigIntegrationSuite) SetupSuite() {
|
||||||
_, err := tester.GetRequiredEnvSls(
|
tester.MustGetEnvSets(suite.T(), tester.AWSStorageCredEnvs, tester.M365AcctCredEnvs)
|
||||||
tester.AWSStorageCredEnvs,
|
|
||||||
tester.M365AcctCredEnvs)
|
|
||||||
require.NoError(suite.T(), err)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (suite *ConfigIntegrationSuite) TestGetStorageAndAccount() {
|
func (suite *ConfigIntegrationSuite) TestGetStorageAndAccount() {
|
||||||
|
|||||||
@ -20,22 +20,17 @@ type S3IntegrationSuite struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestS3IntegrationSuite(t *testing.T) {
|
func TestS3IntegrationSuite(t *testing.T) {
|
||||||
if err := tester.RunOnAny(
|
tester.RunOnAny(
|
||||||
|
t,
|
||||||
tester.CorsoCITests,
|
tester.CorsoCITests,
|
||||||
tester.CorsoCLITests,
|
tester.CorsoCLITests,
|
||||||
tester.CorsoCLIRepoTests,
|
tester.CorsoCLIRepoTests)
|
||||||
); err != nil {
|
|
||||||
t.Skip(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
suite.Run(t, new(S3IntegrationSuite))
|
suite.Run(t, new(S3IntegrationSuite))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (suite *S3IntegrationSuite) SetupSuite() {
|
func (suite *S3IntegrationSuite) SetupSuite() {
|
||||||
_, err := tester.GetRequiredEnvSls(
|
tester.MustGetEnvSets(suite.T(), tester.AWSStorageCredEnvs, tester.M365AcctCredEnvs)
|
||||||
tester.AWSStorageCredEnvs,
|
|
||||||
tester.M365AcctCredEnvs)
|
|
||||||
require.NoError(suite.T(), err)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (suite *S3IntegrationSuite) TestInitS3Cmd() {
|
func (suite *S3IntegrationSuite) TestInitS3Cmd() {
|
||||||
|
|||||||
@ -42,13 +42,11 @@ type RestoreExchangeIntegrationSuite struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestRestoreExchangeIntegrationSuite(t *testing.T) {
|
func TestRestoreExchangeIntegrationSuite(t *testing.T) {
|
||||||
if err := tester.RunOnAny(
|
tester.RunOnAny(
|
||||||
|
t,
|
||||||
tester.CorsoCITests,
|
tester.CorsoCITests,
|
||||||
tester.CorsoCLITests,
|
tester.CorsoCLITests,
|
||||||
tester.CorsoCLIRestoreTests,
|
tester.CorsoCLIRestoreTests)
|
||||||
); err != nil {
|
|
||||||
t.Skip(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
suite.Run(t, new(RestoreExchangeIntegrationSuite))
|
suite.Run(t, new(RestoreExchangeIntegrationSuite))
|
||||||
}
|
}
|
||||||
@ -59,11 +57,7 @@ func (suite *RestoreExchangeIntegrationSuite) SetupSuite() {
|
|||||||
ctx, flush := tester.NewContext()
|
ctx, flush := tester.NewContext()
|
||||||
defer flush()
|
defer flush()
|
||||||
|
|
||||||
_, err := tester.GetRequiredEnvSls(
|
tester.MustGetEnvSets(t, tester.AWSStorageCredEnvs, tester.M365AcctCredEnvs)
|
||||||
tester.AWSStorageCredEnvs,
|
|
||||||
tester.M365AcctCredEnvs,
|
|
||||||
)
|
|
||||||
require.NoError(t, err)
|
|
||||||
|
|
||||||
// aggregate required details
|
// aggregate required details
|
||||||
suite.acct = tester.NewM365Account(t)
|
suite.acct = tester.NewM365Account(t)
|
||||||
|
|||||||
@ -28,12 +28,10 @@ type ConnectorDataCollectionIntegrationSuite struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestConnectorDataCollectionIntegrationSuite(t *testing.T) {
|
func TestConnectorDataCollectionIntegrationSuite(t *testing.T) {
|
||||||
if err := tester.RunOnAny(
|
tester.RunOnAny(t,
|
||||||
tester.CorsoCITests,
|
tester.CorsoCITests,
|
||||||
tester.CorsoConnectorDataCollectionTests,
|
tester.CorsoConnectorDataCollectionTests,
|
||||||
); err != nil {
|
)
|
||||||
t.Skip(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
suite.Run(t, new(ConnectorDataCollectionIntegrationSuite))
|
suite.Run(t, new(ConnectorDataCollectionIntegrationSuite))
|
||||||
}
|
}
|
||||||
@ -42,11 +40,12 @@ func (suite *ConnectorDataCollectionIntegrationSuite) SetupSuite() {
|
|||||||
ctx, flush := tester.NewContext()
|
ctx, flush := tester.NewContext()
|
||||||
defer flush()
|
defer flush()
|
||||||
|
|
||||||
_, err := tester.GetRequiredEnvVars(tester.M365AcctCredEnvs...)
|
tester.MustGetEnvVars(suite.T(), tester.M365AcctCredEnvs...)
|
||||||
require.NoError(suite.T(), err)
|
|
||||||
suite.connector = loadConnector(ctx, suite.T(), AllResources)
|
suite.connector = loadConnector(ctx, suite.T(), AllResources)
|
||||||
suite.user = tester.M365UserID(suite.T())
|
suite.user = tester.M365UserID(suite.T())
|
||||||
suite.site = tester.M365SiteID(suite.T())
|
suite.site = tester.M365SiteID(suite.T())
|
||||||
|
|
||||||
tester.LogTimeOfTest(suite.T())
|
tester.LogTimeOfTest(suite.T())
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -260,12 +259,10 @@ type ConnectorCreateSharePointCollectionIntegrationSuite struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestConnectorCreateSharePointCollectionIntegrationSuite(t *testing.T) {
|
func TestConnectorCreateSharePointCollectionIntegrationSuite(t *testing.T) {
|
||||||
if err := tester.RunOnAny(
|
tester.RunOnAny(
|
||||||
|
t,
|
||||||
tester.CorsoCITests,
|
tester.CorsoCITests,
|
||||||
tester.CorsoConnectorCreateSharePointCollectionTests,
|
tester.CorsoConnectorCreateSharePointCollectionTests)
|
||||||
); err != nil {
|
|
||||||
t.Skip(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
suite.Run(t, new(ConnectorCreateSharePointCollectionIntegrationSuite))
|
suite.Run(t, new(ConnectorCreateSharePointCollectionIntegrationSuite))
|
||||||
}
|
}
|
||||||
@ -274,10 +271,11 @@ func (suite *ConnectorCreateSharePointCollectionIntegrationSuite) SetupSuite() {
|
|||||||
ctx, flush := tester.NewContext()
|
ctx, flush := tester.NewContext()
|
||||||
defer flush()
|
defer flush()
|
||||||
|
|
||||||
_, err := tester.GetRequiredEnvVars(tester.M365AcctCredEnvs...)
|
tester.MustGetEnvSets(suite.T(), tester.M365AcctCredEnvs)
|
||||||
require.NoError(suite.T(), err)
|
|
||||||
suite.connector = loadConnector(ctx, suite.T(), Sites)
|
suite.connector = loadConnector(ctx, suite.T(), Sites)
|
||||||
suite.user = tester.M365UserID(suite.T())
|
suite.user = tester.M365UserID(suite.T())
|
||||||
|
|
||||||
tester.LogTimeOfTest(suite.T())
|
tester.LogTimeOfTest(suite.T())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -209,19 +209,16 @@ type DataCollectionsIntegrationSuite struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestDataCollectionsIntegrationSuite(t *testing.T) {
|
func TestDataCollectionsIntegrationSuite(t *testing.T) {
|
||||||
if err := tester.RunOnAny(
|
tester.RunOnAny(
|
||||||
|
t,
|
||||||
tester.CorsoCITests,
|
tester.CorsoCITests,
|
||||||
tester.CorsoConnectorCreateExchangeCollectionTests,
|
tester.CorsoConnectorCreateExchangeCollectionTests)
|
||||||
); err != nil {
|
|
||||||
t.Skip(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
suite.Run(t, new(DataCollectionsIntegrationSuite))
|
suite.Run(t, new(DataCollectionsIntegrationSuite))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (suite *DataCollectionsIntegrationSuite) SetupSuite() {
|
func (suite *DataCollectionsIntegrationSuite) SetupSuite() {
|
||||||
_, err := tester.GetRequiredEnvVars(tester.M365AcctCredEnvs...)
|
tester.MustGetEnvSets(suite.T(), tester.M365AcctCredEnvs)
|
||||||
require.NoError(suite.T(), err)
|
|
||||||
|
|
||||||
suite.user = tester.M365UserID(suite.T())
|
suite.user = tester.M365UserID(suite.T())
|
||||||
suite.site = tester.M365SiteID(suite.T())
|
suite.site = tester.M365SiteID(suite.T())
|
||||||
|
|||||||
@ -26,25 +26,20 @@ type ExchangeServiceSuite struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestExchangeServiceSuite(t *testing.T) {
|
func TestExchangeServiceSuite(t *testing.T) {
|
||||||
if err := tester.RunOnAny(
|
tester.RunOnAny(
|
||||||
|
t,
|
||||||
tester.CorsoCITests,
|
tester.CorsoCITests,
|
||||||
tester.CorsoGraphConnectorTests,
|
tester.CorsoGraphConnectorTests,
|
||||||
tester.CorsoGraphConnectorExchangeTests,
|
tester.CorsoGraphConnectorExchangeTests)
|
||||||
); err != nil {
|
|
||||||
t.Skip(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
suite.Run(t, new(ExchangeServiceSuite))
|
suite.Run(t, new(ExchangeServiceSuite))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (suite *ExchangeServiceSuite) SetupSuite() {
|
func (suite *ExchangeServiceSuite) SetupSuite() {
|
||||||
t := suite.T()
|
t := suite.T()
|
||||||
_, err := tester.GetRequiredEnvVars(tester.M365AcctCredEnvs...)
|
tester.MustGetEnvSets(t, tester.M365AcctCredEnvs)
|
||||||
require.NoError(t, err)
|
|
||||||
|
|
||||||
a := tester.NewM365Account(t)
|
a := tester.NewM365Account(t)
|
||||||
require.NoError(t, err)
|
|
||||||
|
|
||||||
m365, err := a.M365Config()
|
m365, err := a.M365Config()
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
|||||||
@ -17,13 +17,11 @@ type CacheResolverSuite struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestCacheResolverIntegrationSuite(t *testing.T) {
|
func TestCacheResolverIntegrationSuite(t *testing.T) {
|
||||||
if err := tester.RunOnAny(
|
tester.RunOnAny(
|
||||||
|
t,
|
||||||
tester.CorsoCITests,
|
tester.CorsoCITests,
|
||||||
tester.CorsoGraphConnectorTests,
|
tester.CorsoGraphConnectorTests,
|
||||||
tester.CorsoGraphConnectorExchangeTests,
|
tester.CorsoGraphConnectorExchangeTests)
|
||||||
); err != nil {
|
|
||||||
t.Skip(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
suite.Run(t, new(CacheResolverSuite))
|
suite.Run(t, new(CacheResolverSuite))
|
||||||
}
|
}
|
||||||
@ -31,12 +29,9 @@ func TestCacheResolverIntegrationSuite(t *testing.T) {
|
|||||||
func (suite *CacheResolverSuite) SetupSuite() {
|
func (suite *CacheResolverSuite) SetupSuite() {
|
||||||
t := suite.T()
|
t := suite.T()
|
||||||
|
|
||||||
_, err := tester.GetRequiredEnvVars(tester.M365AcctCredEnvs...)
|
tester.MustGetEnvSets(t, tester.M365AcctCredEnvs)
|
||||||
require.NoError(t, err)
|
|
||||||
|
|
||||||
a := tester.NewM365Account(t)
|
a := tester.NewM365Account(t)
|
||||||
require.NoError(t, err)
|
|
||||||
|
|
||||||
m365, err := a.M365Config()
|
m365, err := a.M365Config()
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
|||||||
@ -22,13 +22,11 @@ type ExchangeIteratorSuite struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestExchangeIteratorSuite(t *testing.T) {
|
func TestExchangeIteratorSuite(t *testing.T) {
|
||||||
if err := tester.RunOnAny(
|
tester.RunOnAny(
|
||||||
|
t,
|
||||||
tester.CorsoCITests,
|
tester.CorsoCITests,
|
||||||
tester.CorsoGraphConnectorTests,
|
tester.CorsoGraphConnectorTests,
|
||||||
tester.CorsoGraphConnectorExchangeTests,
|
tester.CorsoGraphConnectorExchangeTests)
|
||||||
); err != nil {
|
|
||||||
t.Skip(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
suite.Run(t, new(ExchangeIteratorSuite))
|
suite.Run(t, new(ExchangeIteratorSuite))
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,15 +29,22 @@ type MailFolderCacheIntegrationSuite struct {
|
|||||||
gs graph.Servicer
|
gs graph.Servicer
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestMailFolderCacheIntegrationSuite(t *testing.T) {
|
||||||
|
tester.RunOnAny(
|
||||||
|
t,
|
||||||
|
tester.CorsoCITests,
|
||||||
|
tester.CorsoGraphConnectorTests,
|
||||||
|
tester.CorsoGraphConnectorExchangeTests)
|
||||||
|
|
||||||
|
suite.Run(t, new(MailFolderCacheIntegrationSuite))
|
||||||
|
}
|
||||||
|
|
||||||
func (suite *MailFolderCacheIntegrationSuite) SetupSuite() {
|
func (suite *MailFolderCacheIntegrationSuite) SetupSuite() {
|
||||||
t := suite.T()
|
t := suite.T()
|
||||||
|
|
||||||
_, err := tester.GetRequiredEnvVars(tester.M365AcctCredEnvs...)
|
tester.MustGetEnvSets(t, tester.M365AcctCredEnvs)
|
||||||
require.NoError(t, err)
|
|
||||||
|
|
||||||
a := tester.NewM365Account(t)
|
a := tester.NewM365Account(t)
|
||||||
require.NoError(t, err)
|
|
||||||
|
|
||||||
m365, err := a.M365Config()
|
m365, err := a.M365Config()
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
@ -47,18 +54,6 @@ func (suite *MailFolderCacheIntegrationSuite) SetupSuite() {
|
|||||||
suite.gs = service
|
suite.gs = service
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestMailFolderCacheIntegrationSuite(t *testing.T) {
|
|
||||||
if err := tester.RunOnAny(
|
|
||||||
tester.CorsoCITests,
|
|
||||||
tester.CorsoGraphConnectorTests,
|
|
||||||
tester.CorsoGraphConnectorExchangeTests,
|
|
||||||
); err != nil {
|
|
||||||
t.Skip(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
suite.Run(t, new(MailFolderCacheIntegrationSuite))
|
|
||||||
}
|
|
||||||
|
|
||||||
func (suite *MailFolderCacheIntegrationSuite) TestDeltaFetch() {
|
func (suite *MailFolderCacheIntegrationSuite) TestDeltaFetch() {
|
||||||
suite.T().Skipf("Test depends on hardcoded folder names. Skipping till that is fixed")
|
suite.T().Skipf("Test depends on hardcoded folder names. Skipping till that is fixed")
|
||||||
|
|
||||||
|
|||||||
@ -138,13 +138,11 @@ type GraphConnectorIntegrationSuite struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestGraphConnectorIntegrationSuite(t *testing.T) {
|
func TestGraphConnectorIntegrationSuite(t *testing.T) {
|
||||||
if err := tester.RunOnAny(
|
tester.RunOnAny(
|
||||||
|
t,
|
||||||
tester.CorsoCITests,
|
tester.CorsoCITests,
|
||||||
tester.CorsoGraphConnectorTests,
|
tester.CorsoGraphConnectorTests,
|
||||||
tester.CorsoGraphConnectorExchangeTests,
|
tester.CorsoGraphConnectorExchangeTests)
|
||||||
); err != nil {
|
|
||||||
t.Skip(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
suite.Run(t, new(GraphConnectorIntegrationSuite))
|
suite.Run(t, new(GraphConnectorIntegrationSuite))
|
||||||
}
|
}
|
||||||
@ -153,10 +151,11 @@ func (suite *GraphConnectorIntegrationSuite) SetupSuite() {
|
|||||||
ctx, flush := tester.NewContext()
|
ctx, flush := tester.NewContext()
|
||||||
defer flush()
|
defer flush()
|
||||||
|
|
||||||
_, err := tester.GetRequiredEnvVars(tester.M365AcctCredEnvs...)
|
tester.MustGetEnvSets(suite.T(), tester.M365AcctCredEnvs)
|
||||||
require.NoError(suite.T(), err)
|
|
||||||
suite.connector = loadConnector(ctx, suite.T(), Users)
|
suite.connector = loadConnector(ctx, suite.T(), Users)
|
||||||
suite.user = tester.M365UserID(suite.T())
|
suite.user = tester.M365UserID(suite.T())
|
||||||
|
|
||||||
tester.LogTimeOfTest(suite.T())
|
tester.LogTimeOfTest(suite.T())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -21,12 +21,10 @@ type OneDriveSuite struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestOneDriveDriveSuite(t *testing.T) {
|
func TestOneDriveDriveSuite(t *testing.T) {
|
||||||
if err := tester.RunOnAny(
|
tester.RunOnAny(
|
||||||
|
t,
|
||||||
tester.CorsoCITests,
|
tester.CorsoCITests,
|
||||||
tester.CorsoOneDriveTests,
|
tester.CorsoOneDriveTests)
|
||||||
); err != nil {
|
|
||||||
t.Skip(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
suite.Run(t, new(OneDriveSuite))
|
suite.Run(t, new(OneDriveSuite))
|
||||||
}
|
}
|
||||||
|
|||||||
@ -35,13 +35,11 @@ func (suite *ItemIntegrationSuite) Adapter() *msgraphsdk.GraphRequestAdapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestItemIntegrationSuite(t *testing.T) {
|
func TestItemIntegrationSuite(t *testing.T) {
|
||||||
if err := tester.RunOnAny(
|
tester.RunOnAny(
|
||||||
|
t,
|
||||||
tester.CorsoCITests,
|
tester.CorsoCITests,
|
||||||
tester.CorsoGraphConnectorTests,
|
tester.CorsoGraphConnectorTests,
|
||||||
tester.CorsoGraphConnectorOneDriveTests,
|
tester.CorsoGraphConnectorOneDriveTests)
|
||||||
); err != nil {
|
|
||||||
t.Skip(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
suite.Run(t, new(ItemIntegrationSuite))
|
suite.Run(t, new(ItemIntegrationSuite))
|
||||||
}
|
}
|
||||||
@ -52,11 +50,9 @@ func (suite *ItemIntegrationSuite) SetupSuite() {
|
|||||||
ctx, flush := tester.NewContext()
|
ctx, flush := tester.NewContext()
|
||||||
defer flush()
|
defer flush()
|
||||||
|
|
||||||
_, err := tester.GetRequiredEnvVars(tester.M365AcctCredEnvs...)
|
tester.MustGetEnvSets(t, tester.M365AcctCredEnvs)
|
||||||
require.NoError(t, err)
|
|
||||||
|
|
||||||
a := tester.NewM365Account(t)
|
a := tester.NewM365Account(t)
|
||||||
|
|
||||||
m365, err := a.M365Config()
|
m365, err := a.M365Config()
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
|||||||
@ -26,13 +26,10 @@ func (suite *SharePointSuite) SetupSuite() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestSharePointSuite(t *testing.T) {
|
func TestSharePointSuite(t *testing.T) {
|
||||||
if err := tester.RunOnAny(
|
tester.RunOnAny(
|
||||||
|
t,
|
||||||
tester.CorsoCITests,
|
tester.CorsoCITests,
|
||||||
tester.CorsoGraphConnectorSharePointTests,
|
tester.CorsoGraphConnectorSharePointTests)
|
||||||
); err != nil {
|
|
||||||
t.Skip(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
suite.Run(t, new(SharePointSuite))
|
suite.Run(t, new(SharePointSuite))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -19,10 +19,7 @@ type EventsIntegrationSuite struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestMetricsIntegrationSuite(t *testing.T) {
|
func TestMetricsIntegrationSuite(t *testing.T) {
|
||||||
if err := tester.RunOnAny(tester.CorsoCITests); err != nil {
|
tester.RunOnAny(t, tester.CorsoCITests)
|
||||||
t.Skip(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
suite.Run(t, new(EventsIntegrationSuite))
|
suite.Run(t, new(EventsIntegrationSuite))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -59,19 +59,16 @@ type WrapperIntegrationSuite struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestWrapperIntegrationSuite(t *testing.T) {
|
func TestWrapperIntegrationSuite(t *testing.T) {
|
||||||
if err := tester.RunOnAny(
|
tester.RunOnAny(
|
||||||
|
t,
|
||||||
tester.CorsoCITests,
|
tester.CorsoCITests,
|
||||||
tester.CorsoKopiaWrapperTests,
|
tester.CorsoKopiaWrapperTests)
|
||||||
); err != nil {
|
|
||||||
t.Skip(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
suite.Run(t, new(WrapperIntegrationSuite))
|
suite.Run(t, new(WrapperIntegrationSuite))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (suite *WrapperIntegrationSuite) SetupSuite() {
|
func (suite *WrapperIntegrationSuite) SetupSuite() {
|
||||||
_, err := tester.GetRequiredEnvVars(tester.AWSStorageCredEnvs...)
|
tester.MustGetEnvSets(suite.T(), tester.AWSStorageCredEnvs)
|
||||||
require.NoError(suite.T(), err)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (suite *WrapperIntegrationSuite) TestRepoExistsError() {
|
func (suite *WrapperIntegrationSuite) TestRepoExistsError() {
|
||||||
|
|||||||
@ -63,19 +63,16 @@ type ModelStoreIntegrationSuite struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestModelStoreIntegrationSuite(t *testing.T) {
|
func TestModelStoreIntegrationSuite(t *testing.T) {
|
||||||
if err := tester.RunOnAny(
|
tester.RunOnAny(
|
||||||
|
t,
|
||||||
tester.CorsoCITests,
|
tester.CorsoCITests,
|
||||||
tester.CorsoModelStoreTests,
|
tester.CorsoModelStoreTests)
|
||||||
); err != nil {
|
|
||||||
t.Skip(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
suite.Run(t, new(ModelStoreIntegrationSuite))
|
suite.Run(t, new(ModelStoreIntegrationSuite))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (suite *ModelStoreIntegrationSuite) SetupSuite() {
|
func (suite *ModelStoreIntegrationSuite) SetupSuite() {
|
||||||
_, err := tester.GetRequiredEnvVars(tester.AWSStorageCredEnvs...)
|
tester.MustGetEnvSets(suite.T(), tester.AWSStorageCredEnvs)
|
||||||
require.NoError(suite.T(), err)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (suite *ModelStoreIntegrationSuite) SetupTest() {
|
func (suite *ModelStoreIntegrationSuite) SetupTest() {
|
||||||
@ -712,19 +709,16 @@ type ModelStoreRegressionSuite struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestModelStoreRegressionSuite(t *testing.T) {
|
func TestModelStoreRegressionSuite(t *testing.T) {
|
||||||
if err := tester.RunOnAny(
|
tester.RunOnAny(
|
||||||
|
t,
|
||||||
tester.CorsoCITests,
|
tester.CorsoCITests,
|
||||||
tester.CorsoModelStoreTests,
|
tester.CorsoModelStoreTests)
|
||||||
); err != nil {
|
|
||||||
t.Skip(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
suite.Run(t, new(ModelStoreRegressionSuite))
|
suite.Run(t, new(ModelStoreRegressionSuite))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (suite *ModelStoreRegressionSuite) SetupSuite() {
|
func (suite *ModelStoreRegressionSuite) SetupSuite() {
|
||||||
_, err := tester.GetRequiredEnvVars(tester.AWSStorageCredEnvs...)
|
tester.MustGetEnvSets(suite.T(), tester.AWSStorageCredEnvs)
|
||||||
require.NoError(suite.T(), err)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(ashmrtn): Make a mock of whatever controls the handle to kopia so we can
|
// TODO(ashmrtn): Make a mock of whatever controls the handle to kopia so we can
|
||||||
|
|||||||
@ -148,19 +148,16 @@ type KopiaIntegrationSuite struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestKopiaIntegrationSuite(t *testing.T) {
|
func TestKopiaIntegrationSuite(t *testing.T) {
|
||||||
if err := tester.RunOnAny(
|
tester.RunOnAny(
|
||||||
|
t,
|
||||||
tester.CorsoCITests,
|
tester.CorsoCITests,
|
||||||
tester.CorsoKopiaWrapperTests,
|
tester.CorsoKopiaWrapperTests)
|
||||||
); err != nil {
|
|
||||||
t.Skip(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
suite.Run(t, new(KopiaIntegrationSuite))
|
suite.Run(t, new(KopiaIntegrationSuite))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (suite *KopiaIntegrationSuite) SetupSuite() {
|
func (suite *KopiaIntegrationSuite) SetupSuite() {
|
||||||
_, err := tester.GetRequiredEnvVars(tester.AWSStorageCredEnvs...)
|
tester.MustGetEnvSets(suite.T(), tester.AWSStorageCredEnvs)
|
||||||
require.NoError(suite.T(), err)
|
|
||||||
|
|
||||||
tmp, err := path.Builder{}.Append(testInboxDir).ToDataLayerExchangePathForCategory(
|
tmp, err := path.Builder{}.Append(testInboxDir).ToDataLayerExchangePathForCategory(
|
||||||
testTenant,
|
testTenant,
|
||||||
@ -509,19 +506,16 @@ type KopiaSimpleRepoIntegrationSuite struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestKopiaSimpleRepoIntegrationSuite(t *testing.T) {
|
func TestKopiaSimpleRepoIntegrationSuite(t *testing.T) {
|
||||||
if err := tester.RunOnAny(
|
tester.RunOnAny(
|
||||||
|
t,
|
||||||
tester.CorsoCITests,
|
tester.CorsoCITests,
|
||||||
tester.CorsoKopiaWrapperTests,
|
tester.CorsoKopiaWrapperTests)
|
||||||
); err != nil {
|
|
||||||
t.Skip(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
suite.Run(t, new(KopiaSimpleRepoIntegrationSuite))
|
suite.Run(t, new(KopiaSimpleRepoIntegrationSuite))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (suite *KopiaSimpleRepoIntegrationSuite) SetupSuite() {
|
func (suite *KopiaSimpleRepoIntegrationSuite) SetupSuite() {
|
||||||
_, err := tester.GetRequiredEnvVars(tester.AWSStorageCredEnvs...)
|
tester.MustGetEnvSets(suite.T(), tester.AWSStorageCredEnvs)
|
||||||
require.NoError(suite.T(), err)
|
|
||||||
|
|
||||||
tmp, err := path.Builder{}.Append(testInboxDir).ToDataLayerExchangePathForCategory(
|
tmp, err := path.Builder{}.Append(testInboxDir).ToDataLayerExchangePathForCategory(
|
||||||
testTenant,
|
testTenant,
|
||||||
|
|||||||
@ -437,22 +437,17 @@ type BackupOpIntegrationSuite struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestBackupOpIntegrationSuite(t *testing.T) {
|
func TestBackupOpIntegrationSuite(t *testing.T) {
|
||||||
if err := tester.RunOnAny(
|
tester.RunOnAny(
|
||||||
|
t,
|
||||||
tester.CorsoCITests,
|
tester.CorsoCITests,
|
||||||
tester.CorsoOperationTests,
|
tester.CorsoOperationTests,
|
||||||
tester.CorsoOperationBackupTests,
|
tester.CorsoOperationBackupTests)
|
||||||
); err != nil {
|
|
||||||
t.Skip(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
suite.Run(t, new(BackupOpIntegrationSuite))
|
suite.Run(t, new(BackupOpIntegrationSuite))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (suite *BackupOpIntegrationSuite) SetupSuite() {
|
func (suite *BackupOpIntegrationSuite) SetupSuite() {
|
||||||
_, err := tester.GetRequiredEnvSls(
|
tester.MustGetEnvSets(suite.T(), tester.AWSStorageCredEnvs, tester.M365AcctCredEnvs)
|
||||||
tester.AWSStorageCredEnvs,
|
|
||||||
tester.M365AcctCredEnvs)
|
|
||||||
require.NoError(suite.T(), err)
|
|
||||||
|
|
||||||
suite.user = tester.M365UserID(suite.T())
|
suite.user = tester.M365UserID(suite.T())
|
||||||
suite.site = tester.M365SiteID(suite.T())
|
suite.site = tester.M365SiteID(suite.T())
|
||||||
|
|||||||
@ -133,12 +133,10 @@ type RestoreOpIntegrationSuite struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestRestoreOpIntegrationSuite(t *testing.T) {
|
func TestRestoreOpIntegrationSuite(t *testing.T) {
|
||||||
if err := tester.RunOnAny(
|
tester.RunOnAny(
|
||||||
|
t,
|
||||||
tester.CorsoCITests,
|
tester.CorsoCITests,
|
||||||
tester.CorsoOperationTests,
|
tester.CorsoOperationTests)
|
||||||
); err != nil {
|
|
||||||
t.Skip(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
suite.Run(t, new(RestoreOpIntegrationSuite))
|
suite.Run(t, new(RestoreOpIntegrationSuite))
|
||||||
}
|
}
|
||||||
@ -147,8 +145,7 @@ func (suite *RestoreOpIntegrationSuite) SetupSuite() {
|
|||||||
ctx, flush := tester.NewContext()
|
ctx, flush := tester.NewContext()
|
||||||
defer flush()
|
defer flush()
|
||||||
|
|
||||||
_, err := tester.GetRequiredEnvVars(tester.M365AcctCredEnvs...)
|
tester.MustGetEnvSets(suite.T(), tester.M365AcctCredEnvs)
|
||||||
require.NoError(suite.T(), err)
|
|
||||||
|
|
||||||
t := suite.T()
|
t := suite.T()
|
||||||
|
|
||||||
|
|||||||
@ -18,12 +18,7 @@ type StreamStoreIntegrationSuite struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestStreamStoreIntegrationSuite(t *testing.T) {
|
func TestStreamStoreIntegrationSuite(t *testing.T) {
|
||||||
if err := tester.RunOnAny(
|
tester.RunOnAny(t, tester.CorsoCITests)
|
||||||
tester.CorsoCITests,
|
|
||||||
); err != nil {
|
|
||||||
t.Skip(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
suite.Run(t, new(StreamStoreIntegrationSuite))
|
suite.Run(t, new(StreamStoreIntegrationSuite))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,44 +0,0 @@
|
|||||||
package tester
|
|
||||||
|
|
||||||
import (
|
|
||||||
"errors"
|
|
||||||
"os"
|
|
||||||
|
|
||||||
"golang.org/x/exp/maps"
|
|
||||||
)
|
|
||||||
|
|
||||||
// GetRequiredEnvVars retrieves the provided env vars from the os.
|
|
||||||
// Retrieved values are populated into the resulting map.
|
|
||||||
// If any of the env values are zero length, returns an error.
|
|
||||||
func GetRequiredEnvVars(evs ...string) (map[string]string, error) {
|
|
||||||
vals := map[string]string{}
|
|
||||||
|
|
||||||
for _, ev := range evs {
|
|
||||||
ge := os.Getenv(ev)
|
|
||||||
if len(ge) == 0 {
|
|
||||||
return nil, errors.New(ev + " env var required for test suite")
|
|
||||||
}
|
|
||||||
|
|
||||||
vals[ev] = ge
|
|
||||||
}
|
|
||||||
|
|
||||||
return vals, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetRequiredEnvSls retrieves the provided env vars from the os.
|
|
||||||
// Retrieved values are populated into the resulting map.
|
|
||||||
// If any of the env values are zero length, returns an error.
|
|
||||||
func GetRequiredEnvSls(evs ...[]string) (map[string]string, error) {
|
|
||||||
vals := map[string]string{}
|
|
||||||
|
|
||||||
for _, ev := range evs {
|
|
||||||
r, err := GetRequiredEnvVars(ev...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
maps.Copy(vals, r)
|
|
||||||
}
|
|
||||||
|
|
||||||
return vals, nil
|
|
||||||
}
|
|
||||||
@ -1,47 +0,0 @@
|
|||||||
package tester
|
|
||||||
|
|
||||||
import (
|
|
||||||
"os"
|
|
||||||
"testing"
|
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
|
||||||
"github.com/stretchr/testify/suite"
|
|
||||||
)
|
|
||||||
|
|
||||||
type EnvvarsTestSuite struct {
|
|
||||||
suite.Suite
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestEnvvarsSuite(t *testing.T) {
|
|
||||||
suite.Run(t, new(EnvvarsTestSuite))
|
|
||||||
}
|
|
||||||
|
|
||||||
func (suite *EnvvarsTestSuite) TestRunOnAny() {
|
|
||||||
envVariable := "TEST_ENVVARS_SUITE"
|
|
||||||
os.Setenv(envVariable, "1")
|
|
||||||
|
|
||||||
table := []struct {
|
|
||||||
name string
|
|
||||||
param string
|
|
||||||
function assert.ErrorAssertionFunc
|
|
||||||
}{
|
|
||||||
{
|
|
||||||
name: "Valid Environment",
|
|
||||||
param: envVariable,
|
|
||||||
function: assert.NoError,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "Invalid Environment",
|
|
||||||
param: "TEST_ENVVARS_SUITE_INVALID",
|
|
||||||
function: assert.Error,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
for _, test := range table {
|
|
||||||
suite.T().Run(test.name, func(t *testing.T) {
|
|
||||||
result := RunOnAny(test.param)
|
|
||||||
test.function(suite.T(), result)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
os.Unsetenv(envVariable)
|
|
||||||
}
|
|
||||||
@ -1,11 +1,13 @@
|
|||||||
package tester
|
package tester
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
|
"golang.org/x/exp/maps"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -40,19 +42,17 @@ const CorsoGraphConnectorTestSupportFile = "CORSO_TEST_SUPPORT_FILE"
|
|||||||
// an error if all of them are zero valued. Implication being:
|
// an error if all of them are zero valued. Implication being:
|
||||||
// if any of those env vars are truthy, you should run the
|
// if any of those env vars are truthy, you should run the
|
||||||
// subsequent tests.
|
// subsequent tests.
|
||||||
func RunOnAny(tests ...string) error {
|
func RunOnAny(t *testing.T, tests ...string) {
|
||||||
var l int
|
var l int
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
l += len(os.Getenv(test))
|
l += len(os.Getenv(test))
|
||||||
}
|
}
|
||||||
|
|
||||||
if l == 0 {
|
if l == 0 {
|
||||||
return fmt.Errorf(
|
t.Skipf(
|
||||||
"%s env vars are not flagged for testing",
|
"one or more env vars mus be flagged to run this test: %v",
|
||||||
strings.Join(tests, ", "))
|
strings.Join(tests, ", "))
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// LogTimeOfTest logs the test name and the time that it was run.
|
// LogTimeOfTest logs the test name and the time that it was run.
|
||||||
@ -69,3 +69,33 @@ func LogTimeOfTest(t *testing.T) string {
|
|||||||
|
|
||||||
return now
|
return now
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MustGetEnvVars retrieves the provided env vars from the os.
|
||||||
|
// Retrieved values are populated into the resulting map.
|
||||||
|
// If any of the env values are zero length, the test errors.
|
||||||
|
func MustGetEnvVars(t *testing.T, evs ...string) map[string]string {
|
||||||
|
vals := map[string]string{}
|
||||||
|
|
||||||
|
for _, ev := range evs {
|
||||||
|
ge := os.Getenv(ev)
|
||||||
|
require.NotEmpty(t, ev, ev+" env var required for test suite")
|
||||||
|
|
||||||
|
vals[ev] = ge
|
||||||
|
}
|
||||||
|
|
||||||
|
return vals
|
||||||
|
}
|
||||||
|
|
||||||
|
// MustGetEnvSls retrieves the provided env vars from the os.
|
||||||
|
// Retrieved values are populated into the resulting map.
|
||||||
|
// If any of the env values are zero length, the test errors.
|
||||||
|
func MustGetEnvSets(t *testing.T, evs ...[]string) map[string]string {
|
||||||
|
vals := map[string]string{}
|
||||||
|
|
||||||
|
for _, ev := range evs {
|
||||||
|
r := MustGetEnvVars(t, ev...)
|
||||||
|
maps.Copy(vals, r)
|
||||||
|
}
|
||||||
|
|
||||||
|
return vals
|
||||||
|
}
|
||||||
|
|||||||
@ -48,24 +48,23 @@ func singleUserSet(t *testing.T) []string {
|
|||||||
var loadCtx context.Context
|
var loadCtx context.Context
|
||||||
|
|
||||||
func TestMain(m *testing.M) {
|
func TestMain(m *testing.M) {
|
||||||
ctx, logFlush := tester.NewContext()
|
if len(os.Getenv(tester.CorsoLoadTests)) == 0 {
|
||||||
loadCtx = ctx
|
return
|
||||||
flush := func() {
|
|
||||||
logFlush()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := tester.RunOnAny(tester.CorsoLoadTests); err == nil {
|
ctx, logFlush := tester.NewContext()
|
||||||
if err := D.InitCollector(); err != nil {
|
loadCtx = ctx
|
||||||
fmt.Println("initializing load tests:", err)
|
|
||||||
os.Exit(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx, spanFlush := D.Start(ctx, "Load_Testing_Main")
|
if err := D.InitCollector(); err != nil {
|
||||||
loadCtx = ctx
|
fmt.Println("initializing load tests:", err)
|
||||||
flush = func() {
|
os.Exit(1)
|
||||||
spanFlush()
|
}
|
||||||
logFlush()
|
|
||||||
}
|
ctx, spanFlush := D.Start(ctx, "Load_Testing_Main")
|
||||||
|
loadCtx = ctx
|
||||||
|
flush := func() {
|
||||||
|
spanFlush()
|
||||||
|
logFlush()
|
||||||
}
|
}
|
||||||
|
|
||||||
exitVal := m.Run()
|
exitVal := m.Run()
|
||||||
@ -80,13 +79,12 @@ func TestMain(m *testing.M) {
|
|||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
func initM365Repo(t *testing.T) (
|
func initM365Repo(t *testing.T) (
|
||||||
context.Context, repository.Repository, account.Account, storage.Storage,
|
context.Context,
|
||||||
|
repository.Repository,
|
||||||
|
account.Account,
|
||||||
|
storage.Storage,
|
||||||
) {
|
) {
|
||||||
_, err := tester.GetRequiredEnvSls(
|
tester.MustGetEnvSets(t, tester.AWSStorageCredEnvs, tester.M365AcctCredEnvs)
|
||||||
tester.AWSStorageCredEnvs,
|
|
||||||
tester.M365AcctCredEnvs,
|
|
||||||
)
|
|
||||||
require.NoError(t, err)
|
|
||||||
|
|
||||||
ctx, flush := tester.WithContext(loadCtx)
|
ctx, flush := tester.WithContext(loadCtx)
|
||||||
defer flush()
|
defer flush()
|
||||||
@ -378,10 +376,7 @@ type RepositoryLoadTestExchangeSuite struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestRepositoryLoadTestExchangeSuite(t *testing.T) {
|
func TestRepositoryLoadTestExchangeSuite(t *testing.T) {
|
||||||
if err := tester.RunOnAny(tester.CorsoLoadTests); err != nil {
|
tester.RunOnAny(t, tester.CorsoLoadTests)
|
||||||
t.Skip(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
suite.Run(t, new(RepositoryLoadTestExchangeSuite))
|
suite.Run(t, new(RepositoryLoadTestExchangeSuite))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -428,10 +423,7 @@ type RepositoryIndividualLoadTestExchangeSuite struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestRepositoryIndividualLoadTestExchangeSuite(t *testing.T) {
|
func TestRepositoryIndividualLoadTestExchangeSuite(t *testing.T) {
|
||||||
if err := tester.RunOnAny(tester.CorsoLoadTests); err != nil {
|
tester.RunOnAny(t, tester.CorsoLoadTests)
|
||||||
t.Skip(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
suite.Run(t, new(RepositoryIndividualLoadTestExchangeSuite))
|
suite.Run(t, new(RepositoryIndividualLoadTestExchangeSuite))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -481,10 +473,7 @@ type RepositoryLoadTestOneDriveSuite struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestRepositoryLoadTestOneDriveSuite(t *testing.T) {
|
func TestRepositoryLoadTestOneDriveSuite(t *testing.T) {
|
||||||
if err := tester.RunOnAny(tester.CorsoLoadTests); err != nil {
|
tester.RunOnAny(t, tester.CorsoLoadTests)
|
||||||
t.Skip(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
suite.Run(t, new(RepositoryLoadTestOneDriveSuite))
|
suite.Run(t, new(RepositoryLoadTestOneDriveSuite))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -528,10 +517,7 @@ type RepositoryIndividualLoadTestOneDriveSuite struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestRepositoryIndividualLoadTestOneDriveSuite(t *testing.T) {
|
func TestRepositoryIndividualLoadTestOneDriveSuite(t *testing.T) {
|
||||||
if err := tester.RunOnAny(tester.CorsoLoadTests); err != nil {
|
tester.RunOnAny(t, tester.CorsoLoadTests)
|
||||||
t.Skip(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
suite.Run(t, new(RepositoryIndividualLoadTestOneDriveSuite))
|
suite.Run(t, new(RepositoryIndividualLoadTestOneDriveSuite))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -579,10 +565,7 @@ type RepositoryLoadTestSharePointSuite struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestRepositoryLoadTestSharePointSuite(t *testing.T) {
|
func TestRepositoryLoadTestSharePointSuite(t *testing.T) {
|
||||||
if err := tester.RunOnAny(tester.CorsoLoadTests); err != nil {
|
tester.RunOnAny(t, tester.CorsoLoadTests)
|
||||||
t.Skip(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
suite.Run(t, new(RepositoryLoadTestSharePointSuite))
|
suite.Run(t, new(RepositoryLoadTestSharePointSuite))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -626,10 +609,7 @@ type RepositoryIndividualLoadTestSharePointSuite struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestRepositoryIndividualLoadTestSharePointSuite(t *testing.T) {
|
func TestRepositoryIndividualLoadTestSharePointSuite(t *testing.T) {
|
||||||
if err := tester.RunOnAny(tester.CorsoLoadTests); err != nil {
|
tester.RunOnAny(t, tester.CorsoLoadTests)
|
||||||
t.Skip(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
suite.Run(t, new(RepositoryIndividualLoadTestOneDriveSuite))
|
suite.Run(t, new(RepositoryIndividualLoadTestOneDriveSuite))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -96,22 +96,17 @@ type RepositoryIntegrationSuite struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestRepositoryIntegrationSuite(t *testing.T) {
|
func TestRepositoryIntegrationSuite(t *testing.T) {
|
||||||
if err := tester.RunOnAny(
|
tester.RunOnAny(
|
||||||
|
t,
|
||||||
tester.CorsoCITests,
|
tester.CorsoCITests,
|
||||||
tester.CorsoRepositoryTests,
|
tester.CorsoRepositoryTests)
|
||||||
); err != nil {
|
|
||||||
t.Skip(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
suite.Run(t, new(RepositoryIntegrationSuite))
|
suite.Run(t, new(RepositoryIntegrationSuite))
|
||||||
}
|
}
|
||||||
|
|
||||||
// ensure all required env values are populated
|
// ensure all required env values are populated
|
||||||
func (suite *RepositoryIntegrationSuite) SetupSuite() {
|
func (suite *RepositoryIntegrationSuite) SetupSuite() {
|
||||||
_, err := tester.GetRequiredEnvSls(
|
tester.MustGetEnvSets(suite.T(), tester.AWSStorageCredEnvs, tester.M365AcctCredEnvs)
|
||||||
tester.AWSStorageCredEnvs,
|
|
||||||
tester.M365AcctCredEnvs)
|
|
||||||
require.NoError(suite.T(), err)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (suite *RepositoryIntegrationSuite) TestInitialize() {
|
func (suite *RepositoryIntegrationSuite) TestInitialize() {
|
||||||
|
|||||||
@ -16,22 +16,17 @@ type RepositoryModelSuite struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestRepositoryModelSuite(t *testing.T) {
|
func TestRepositoryModelSuite(t *testing.T) {
|
||||||
if err := tester.RunOnAny(
|
tester.RunOnAny(
|
||||||
|
t,
|
||||||
tester.CorsoCITests,
|
tester.CorsoCITests,
|
||||||
tester.CorsoRepositoryTests,
|
tester.CorsoRepositoryTests)
|
||||||
); err != nil {
|
|
||||||
t.Skip(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
suite.Run(t, new(RepositoryModelSuite))
|
suite.Run(t, new(RepositoryModelSuite))
|
||||||
}
|
}
|
||||||
|
|
||||||
// ensure all required env values are populated
|
// ensure all required env values are populated
|
||||||
func (suite *RepositoryModelSuite) SetupSuite() {
|
func (suite *RepositoryModelSuite) SetupSuite() {
|
||||||
_, err := tester.GetRequiredEnvSls(
|
tester.MustGetEnvSets(suite.T(), tester.AWSStorageCredEnvs, tester.M365AcctCredEnvs)
|
||||||
tester.AWSStorageCredEnvs,
|
|
||||||
tester.M365AcctCredEnvs)
|
|
||||||
require.NoError(suite.T(), err)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (suite *RepositoryModelSuite) TestWriteGetModel() {
|
func (suite *RepositoryModelSuite) TestWriteGetModel() {
|
||||||
|
|||||||
@ -15,19 +15,12 @@ type M365IntegrationSuite struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestM365IntegrationSuite(t *testing.T) {
|
func TestM365IntegrationSuite(t *testing.T) {
|
||||||
if err := tester.RunOnAny(
|
tester.RunOnAny(t, tester.CorsoCITests)
|
||||||
tester.CorsoCITests,
|
|
||||||
); err != nil {
|
|
||||||
t.Skip(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
suite.Run(t, new(M365IntegrationSuite))
|
suite.Run(t, new(M365IntegrationSuite))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (suite *M365IntegrationSuite) SetupSuite() {
|
func (suite *M365IntegrationSuite) SetupSuite() {
|
||||||
_, err := tester.GetRequiredEnvSls(
|
tester.MustGetEnvSets(suite.T(), tester.M365AcctCredEnvs)
|
||||||
tester.M365AcctCredEnvs)
|
|
||||||
require.NoError(suite.T(), err)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (suite *M365IntegrationSuite) TestUsers() {
|
func (suite *M365IntegrationSuite) TestUsers() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user