Compare commits

...

1 Commits
main ... dec1ci

Author SHA1 Message Date
ryanfkeepers
b71dc3280c investigation 2022-12-02 11:37:48 -07:00
5 changed files with 39 additions and 9 deletions

View File

@ -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)

View File

@ -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,

View File

@ -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 {

View File

@ -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)

View File

@ -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(