More consistent folder cleanup for OneDrive test (#1663)

## Description

Cleanup all folders instead of just some of them. Log errors instead of failing test

## Type of change

- [ ] 🌻 Feature
- [ ] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [x] 🤖 Test
- [ ] 💻 CI/Deployment
- [x] 🐹 Trivial/Minor

## Issue(s)

* closes #1661

## Test Plan

<!-- How will this be tested prior to merging.-->
- [ ] 💪 Manual
- [x]  Unit test
- [ ] 💚 E2E
This commit is contained in:
ashmrtn 2022-12-02 08:37:01 -08:00 committed by GitHub
parent 743c614ce4
commit 9963e50b99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,6 +10,7 @@ import (
"github.com/alcionai/corso/src/internal/common"
"github.com/alcionai/corso/src/internal/tester"
"github.com/alcionai/corso/src/pkg/logger"
"github.com/alcionai/corso/src/pkg/selectors"
)
@ -49,15 +50,20 @@ func (suite *OneDriveSuite) TestCreateGetDeleteFolder() {
driveID := *drives[0].GetId()
defer func() {
for _, id := range folderIDs {
err := DeleteItem(ctx, gs, driveID, id)
if err != nil {
logger.Ctx(ctx).Warnw("deleting folder", "id", id, "error", err)
}
}
}()
folderID, err := createRestoreFolders(ctx, gs, driveID, folderElements)
require.NoError(t, err)
folderIDs = append(folderIDs, folderID)
defer func() {
assert.NoError(t, DeleteItem(ctx, gs, driveID, folderIDs[0]))
}()
folderName2 := "Corso_Folder_Test_" + common.FormatNow(common.SimpleTimeTesting)
folderElements = append(folderElements, folderName2)