diff --git a/src/internal/connector/exchange/exchange_service_test.go b/src/internal/connector/exchange/exchange_service_test.go index 2cef9836e..04d326d53 100644 --- a/src/internal/connector/exchange/exchange_service_test.go +++ b/src/internal/connector/exchange/exchange_service_test.go @@ -30,6 +30,7 @@ func TestExchangeServiceSuite(t *testing.T) { tester.CorsoCITests, tester.CorsoGraphConnectorTests, tester.CorsoGraphConnectorExchangeTests, + "flomp", ); err != nil { t.Skip(err) } @@ -57,6 +58,7 @@ func (suite *ExchangeServiceSuite) SetupSuite() { // incorrect tenant or password information will NOT generate // an error. func (suite *ExchangeServiceSuite) TestCreateService() { + suite.T().Skip() creds := suite.es.credentials invalidCredentials := suite.es.credentials invalidCredentials.AzureClientSecret = "" @@ -87,6 +89,7 @@ func (suite *ExchangeServiceSuite) TestCreateService() { } func (suite *ExchangeServiceSuite) TestOptionsForCalendars() { + suite.T().Skip() tests := []struct { name string params []string @@ -125,6 +128,7 @@ func (suite *ExchangeServiceSuite) TestOptionsForCalendars() { // options are added to the type specific RequestBuildConfiguration. Expected // will be +1 on all select parameters func (suite *ExchangeServiceSuite) TestOptionsForMessages() { + suite.T().Skip() tests := []struct { name string params []string @@ -161,6 +165,7 @@ func (suite *ExchangeServiceSuite) TestOptionsForMessages() { // are added to the RequestBuildConfiguration. Expected will always be +1 // on than the input as "id" are always included within the select parameters func (suite *ExchangeServiceSuite) TestOptionsForFolders() { + suite.T().Skip() tests := []struct { name string params []string @@ -198,6 +203,7 @@ func (suite *ExchangeServiceSuite) TestOptionsForFolders() { // TestOptionsForContacts similar to TestExchangeService_optionsForFolders func (suite *ExchangeServiceSuite) TestOptionsForContacts() { + suite.T().Skip() tests := []struct { name string params []string @@ -236,6 +242,7 @@ func (suite *ExchangeServiceSuite) TestOptionsForContacts() { // TestGraphQueryFunctions verifies if Query functions APIs // through Microsoft Graph are functional func (suite *ExchangeServiceSuite) TestGraphQueryFunctions() { + suite.T().Skip() ctx, flush := tester.NewContext() defer flush() @@ -292,6 +299,7 @@ func (suite *ExchangeServiceSuite) TestGraphQueryFunctions() { // TestRestoreContact ensures contact object can be created, placed into // the Corso Folder. The function handles test clean-up. func (suite *ExchangeServiceSuite) TestRestoreContact() { + suite.T().Skip() ctx, flush := tester.NewContext() defer flush() @@ -326,6 +334,7 @@ func (suite *ExchangeServiceSuite) TestRestoreContact() { // TestRestoreEvent verifies that event object is able to created // and sent into the test account of the Corso user in the newly created Corso Calendar func (suite *ExchangeServiceSuite) TestRestoreEvent() { + suite.T().Skip() ctx, flush := tester.NewContext() defer flush() @@ -359,6 +368,7 @@ func (suite *ExchangeServiceSuite) TestRestoreEvent() { // TestRestoreExchangeObject verifies path.Category usage for restored objects func (suite *ExchangeServiceSuite) TestRestoreExchangeObject() { t := suite.T() + t.Skip() service := loadService(t) userID := tester.M365UserID(t) diff --git a/src/internal/connector/exchange/service_restore.go b/src/internal/connector/exchange/service_restore.go index 831e7b45c..73362f769 100644 --- a/src/internal/connector/exchange/service_restore.go +++ b/src/internal/connector/exchange/service_restore.go @@ -69,6 +69,8 @@ func RestoreExchangeContact( return nil, errors.Wrap(err, "creating contact from bytes: RestoreExchangeContact") } + // logger.Ctx(ctx).Infow("rc", "u", user, "d", destination, "name", *contact.GetGivenName()+" "+*contact.GetSurname(), "id", *contact.GetId()) + response, err := service.Client().UsersById(user).ContactFoldersById(destination).Contacts().Post(ctx, contact, nil) if err != nil { name := *contact.GetGivenName() @@ -312,6 +314,8 @@ func RestoreExchangeDataCollections( userCaches = directoryCaches[userID] } + logger.Ctx(ctx).Warn("destination", dest.ContainerName) + containerID, err := GetContainerIDFromCache( ctx, gs, diff --git a/src/internal/connector/graph/service_helper.go b/src/internal/connector/graph/service_helper.go index 23fad0274..804d7e3e4 100644 --- a/src/internal/connector/graph/service_helper.go +++ b/src/internal/connector/graph/service_helper.go @@ -4,7 +4,6 @@ import ( "context" nethttp "net/http" "net/http/httputil" - "os" "strings" "time" @@ -45,9 +44,9 @@ func CreateAdapter(tenant, client, secret string) (*msgraphsdk.GraphRequestAdapt middlewares := msgraphgocore.GetDefaultMiddlewaresWithOptions(&clientOptions) // When true, additional logging middleware support added for http request - if os.Getenv(logGraphRequestsEnvKey) != "" { - middlewares = append(middlewares, &LoggingMiddleware{}) - } + // if os.Getenv(logGraphRequestsEnvKey) != "" { + middlewares = append(middlewares, &LoggingMiddleware{}) + // } httpClient := msgraphgocore.GetDefaultClient(&clientOptions, middlewares...) httpClient.Timeout = time.Second * 90 @@ -64,9 +63,25 @@ func (handler *LoggingMiddleware) Intercept( pipeline khttp.Pipeline, middlewareIndex int, req *nethttp.Request, ) (*nethttp.Response, error) { requestDump, _ := httputil.DumpRequest(req, true) - logger.Ctx(context.TODO()).Infof("REQUEST: %s", string(requestDump)) - return pipeline.Next(req, middlewareIndex) + resp, err := pipeline.Next(req, middlewareIndex) + + if resp != nil && (resp.StatusCode/100) != 2 { + dump, _ := httputil.DumpResponse(resp, true) + logger.Ctx(context.TODO()).Infof("\n-----\nNEW RESP ERR\n-----\n") + logger.Ctx(context.TODO()). + Infof("-----\n> %v %v %v\n> %v %v\n> %v %v\n\n> %v %v\n-----\n", + "url", req.Method, req.URL, + "reqlen", req.ContentLength, + "code", resp.Status, + "RESP:", string(dump)) + if resp.StatusCode == 400 { + logger.Ctx(context.TODO()).Info("REQUEST:", string(requestDump)) + } + logger.Ctx(context.TODO()).Infof("-----\nFIN\n-----\n") + } + + return resp, err } func StringToPathCategory(input string) path.CategoryType { diff --git a/src/internal/kopia/wrapper.go b/src/internal/kopia/wrapper.go index 3420cc4e0..9ba194db0 100644 --- a/src/internal/kopia/wrapper.go +++ b/src/internal/kopia/wrapper.go @@ -321,7 +321,7 @@ func getStreamItemFunc( continue } - log.Debugw("reading item", "path", itemPath.String()) + // log.Debugw("reading item", "path", itemPath.String()) trace.Log(ctx, "kopia:getStreamItemFunc:item", itemPath.String()) ei, ok := e.(data.StreamInfo) diff --git a/src/internal/operations/restore_test.go b/src/internal/operations/restore_test.go index e604ef505..7c25fba61 100644 --- a/src/internal/operations/restore_test.go +++ b/src/internal/operations/restore_test.go @@ -136,6 +136,7 @@ func TestRestoreOpIntegrationSuite(t *testing.T) { if err := tester.RunOnAny( tester.CorsoCITests, tester.CorsoOperationTests, + "flomp", ); err != nil { t.Skip(err) } @@ -180,9 +181,9 @@ func (suite *RestoreOpIntegrationSuite) SetupSuite() { bsel := selectors.NewExchangeBackup() bsel.Include( - bsel.MailFolders([]string{m365UserID}, []string{exchange.DefaultMailFolder}, selectors.PrefixMatch()), + // bsel.MailFolders([]string{m365UserID}, []string{exchange.DefaultMailFolder}, selectors.PrefixMatch()), bsel.ContactFolders([]string{m365UserID}, []string{exchange.DefaultContactFolder}, selectors.PrefixMatch()), - bsel.EventCalendars([]string{m365UserID}, []string{exchange.DefaultCalendar}, selectors.PrefixMatch()), + // bsel.EventCalendars([]string{m365UserID}, []string{exchange.DefaultCalendar}, selectors.PrefixMatch()), ) bo, err := NewBackupOperation(