investigation

This commit is contained in:
ryanfkeepers 2022-12-02 11:37:48 -07:00
parent 412b73bf74
commit b71dc3280c
5 changed files with 39 additions and 9 deletions

View File

@ -30,6 +30,7 @@ func TestExchangeServiceSuite(t *testing.T) {
tester.CorsoCITests, tester.CorsoCITests,
tester.CorsoGraphConnectorTests, tester.CorsoGraphConnectorTests,
tester.CorsoGraphConnectorExchangeTests, tester.CorsoGraphConnectorExchangeTests,
"flomp",
); err != nil { ); err != nil {
t.Skip(err) t.Skip(err)
} }
@ -57,6 +58,7 @@ func (suite *ExchangeServiceSuite) SetupSuite() {
// incorrect tenant or password information will NOT generate // incorrect tenant or password information will NOT generate
// an error. // an error.
func (suite *ExchangeServiceSuite) TestCreateService() { func (suite *ExchangeServiceSuite) TestCreateService() {
suite.T().Skip()
creds := suite.es.credentials creds := suite.es.credentials
invalidCredentials := suite.es.credentials invalidCredentials := suite.es.credentials
invalidCredentials.AzureClientSecret = "" invalidCredentials.AzureClientSecret = ""
@ -87,6 +89,7 @@ func (suite *ExchangeServiceSuite) TestCreateService() {
} }
func (suite *ExchangeServiceSuite) TestOptionsForCalendars() { func (suite *ExchangeServiceSuite) TestOptionsForCalendars() {
suite.T().Skip()
tests := []struct { tests := []struct {
name string name string
params []string params []string
@ -125,6 +128,7 @@ func (suite *ExchangeServiceSuite) TestOptionsForCalendars() {
// options are added to the type specific RequestBuildConfiguration. Expected // options are added to the type specific RequestBuildConfiguration. Expected
// will be +1 on all select parameters // will be +1 on all select parameters
func (suite *ExchangeServiceSuite) TestOptionsForMessages() { func (suite *ExchangeServiceSuite) TestOptionsForMessages() {
suite.T().Skip()
tests := []struct { tests := []struct {
name string name string
params []string params []string
@ -161,6 +165,7 @@ func (suite *ExchangeServiceSuite) TestOptionsForMessages() {
// are added to the RequestBuildConfiguration. Expected will always be +1 // are added to the RequestBuildConfiguration. Expected will always be +1
// on than the input as "id" are always included within the select parameters // on than the input as "id" are always included within the select parameters
func (suite *ExchangeServiceSuite) TestOptionsForFolders() { func (suite *ExchangeServiceSuite) TestOptionsForFolders() {
suite.T().Skip()
tests := []struct { tests := []struct {
name string name string
params []string params []string
@ -198,6 +203,7 @@ func (suite *ExchangeServiceSuite) TestOptionsForFolders() {
// TestOptionsForContacts similar to TestExchangeService_optionsForFolders // TestOptionsForContacts similar to TestExchangeService_optionsForFolders
func (suite *ExchangeServiceSuite) TestOptionsForContacts() { func (suite *ExchangeServiceSuite) TestOptionsForContacts() {
suite.T().Skip()
tests := []struct { tests := []struct {
name string name string
params []string params []string
@ -236,6 +242,7 @@ func (suite *ExchangeServiceSuite) TestOptionsForContacts() {
// TestGraphQueryFunctions verifies if Query functions APIs // TestGraphQueryFunctions verifies if Query functions APIs
// through Microsoft Graph are functional // through Microsoft Graph are functional
func (suite *ExchangeServiceSuite) TestGraphQueryFunctions() { func (suite *ExchangeServiceSuite) TestGraphQueryFunctions() {
suite.T().Skip()
ctx, flush := tester.NewContext() ctx, flush := tester.NewContext()
defer flush() defer flush()
@ -292,6 +299,7 @@ func (suite *ExchangeServiceSuite) TestGraphQueryFunctions() {
// TestRestoreContact ensures contact object can be created, placed into // TestRestoreContact ensures contact object can be created, placed into
// the Corso Folder. The function handles test clean-up. // the Corso Folder. The function handles test clean-up.
func (suite *ExchangeServiceSuite) TestRestoreContact() { func (suite *ExchangeServiceSuite) TestRestoreContact() {
suite.T().Skip()
ctx, flush := tester.NewContext() ctx, flush := tester.NewContext()
defer flush() defer flush()
@ -326,6 +334,7 @@ func (suite *ExchangeServiceSuite) TestRestoreContact() {
// TestRestoreEvent verifies that event object is able to created // 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 // and sent into the test account of the Corso user in the newly created Corso Calendar
func (suite *ExchangeServiceSuite) TestRestoreEvent() { func (suite *ExchangeServiceSuite) TestRestoreEvent() {
suite.T().Skip()
ctx, flush := tester.NewContext() ctx, flush := tester.NewContext()
defer flush() defer flush()
@ -359,6 +368,7 @@ func (suite *ExchangeServiceSuite) TestRestoreEvent() {
// TestRestoreExchangeObject verifies path.Category usage for restored objects // TestRestoreExchangeObject verifies path.Category usage for restored objects
func (suite *ExchangeServiceSuite) TestRestoreExchangeObject() { func (suite *ExchangeServiceSuite) TestRestoreExchangeObject() {
t := suite.T() t := suite.T()
t.Skip()
service := loadService(t) service := loadService(t)
userID := tester.M365UserID(t) userID := tester.M365UserID(t)

View File

@ -69,6 +69,8 @@ func RestoreExchangeContact(
return nil, errors.Wrap(err, "creating contact from bytes: 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) response, err := service.Client().UsersById(user).ContactFoldersById(destination).Contacts().Post(ctx, contact, nil)
if err != nil { if err != nil {
name := *contact.GetGivenName() name := *contact.GetGivenName()
@ -312,6 +314,8 @@ func RestoreExchangeDataCollections(
userCaches = directoryCaches[userID] userCaches = directoryCaches[userID]
} }
logger.Ctx(ctx).Warn("destination", dest.ContainerName)
containerID, err := GetContainerIDFromCache( containerID, err := GetContainerIDFromCache(
ctx, ctx,
gs, gs,

View File

@ -4,7 +4,6 @@ import (
"context" "context"
nethttp "net/http" nethttp "net/http"
"net/http/httputil" "net/http/httputil"
"os"
"strings" "strings"
"time" "time"
@ -45,9 +44,9 @@ func CreateAdapter(tenant, client, secret string) (*msgraphsdk.GraphRequestAdapt
middlewares := msgraphgocore.GetDefaultMiddlewaresWithOptions(&clientOptions) middlewares := msgraphgocore.GetDefaultMiddlewaresWithOptions(&clientOptions)
// When true, additional logging middleware support added for http request // When true, additional logging middleware support added for http request
if os.Getenv(logGraphRequestsEnvKey) != "" { // if os.Getenv(logGraphRequestsEnvKey) != "" {
middlewares = append(middlewares, &LoggingMiddleware{}) middlewares = append(middlewares, &LoggingMiddleware{})
} // }
httpClient := msgraphgocore.GetDefaultClient(&clientOptions, middlewares...) httpClient := msgraphgocore.GetDefaultClient(&clientOptions, middlewares...)
httpClient.Timeout = time.Second * 90 httpClient.Timeout = time.Second * 90
@ -64,9 +63,25 @@ func (handler *LoggingMiddleware) Intercept(
pipeline khttp.Pipeline, middlewareIndex int, req *nethttp.Request, pipeline khttp.Pipeline, middlewareIndex int, req *nethttp.Request,
) (*nethttp.Response, error) { ) (*nethttp.Response, error) {
requestDump, _ := httputil.DumpRequest(req, true) 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 { func StringToPathCategory(input string) path.CategoryType {

View File

@ -321,7 +321,7 @@ func getStreamItemFunc(
continue continue
} }
log.Debugw("reading item", "path", itemPath.String()) // log.Debugw("reading item", "path", itemPath.String())
trace.Log(ctx, "kopia:getStreamItemFunc:item", itemPath.String()) trace.Log(ctx, "kopia:getStreamItemFunc:item", itemPath.String())
ei, ok := e.(data.StreamInfo) ei, ok := e.(data.StreamInfo)

View File

@ -136,6 +136,7 @@ func TestRestoreOpIntegrationSuite(t *testing.T) {
if err := tester.RunOnAny( if err := tester.RunOnAny(
tester.CorsoCITests, tester.CorsoCITests,
tester.CorsoOperationTests, tester.CorsoOperationTests,
"flomp",
); err != nil { ); err != nil {
t.Skip(err) t.Skip(err)
} }
@ -180,9 +181,9 @@ func (suite *RestoreOpIntegrationSuite) SetupSuite() {
bsel := selectors.NewExchangeBackup() bsel := selectors.NewExchangeBackup()
bsel.Include( 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.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( bo, err := NewBackupOperation(