From 8286bb1ffeafb1dfda8578ccfac23f0800256d60 Mon Sep 17 00:00:00 2001 From: HiteshRepo Date: Sun, 4 Feb 2024 12:59:30 +0530 Subject: [PATCH] pass all m365 acc for trusted tests --- .github/workflows/ci.yml | 13 ++++++++- .../test/m365/exchange/exchange_test.go | 27 ++++++++++--------- src/pkg/credentials/m365.go | 4 +++ 3 files changed, 30 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 90a3a255b..01612c2d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,7 +52,18 @@ jobs: # SetM365App will decide which M365 app to use for this CI run SetM365App: - uses: alcionai/corso/.github/workflows/accSelector.yaml@ci-cache-enable + environment: Testing + runs-on: ubuntu-latest + outputs: + client_app_slot: ${{ steps.roundrobin.outputs.CLIENT_APP_SLOT }} + client_id_env: ${{ steps.roundrobin.outputs.CLIENT_ID_ENV }} + client_secret_env: ${{ steps.roundrobin.outputs.CLIENT_SECRET_ENV }} + steps: + - name: sets all client id and secrets + id: roundrobin + run: | + echo "CLIENT_ID_ENV=CLIENT_ID,CLIENT_ID_2,CLIENT_ID_3,CLIENT_ID_4" >> $GITHUB_OUTPUT + echo "CLIENT_SECRET_ENV=CLIENT_SECRET,CLIENT_SECRET_2,CLIENT_SECRET_3,CLIENT_SECRET_4" >> $GITHUB_OUTPUT SetEnv: environment: Testing diff --git a/src/internal/operations/test/m365/exchange/exchange_test.go b/src/internal/operations/test/m365/exchange/exchange_test.go index ed6b5ead8..4357e7516 100644 --- a/src/internal/operations/test/m365/exchange/exchange_test.go +++ b/src/internal/operations/test/m365/exchange/exchange_test.go @@ -48,7 +48,7 @@ func TestExchangeBackupIntgSuite(t *testing.T) { suite.Run(t, &ExchangeBackupIntgSuite{ Suite: tester.NewIntegrationSuite( t, - [][]string{tconfig.M365AcctCredEnvs}), // , storeTD.AWSStorageCredEnvs + [][]string{tconfig.M365AcctCredEnvs, storeTD.AWSStorageCredEnvs}), }) } @@ -114,21 +114,22 @@ func (suite *ExchangeBackupIntgSuite) TestBackup_Run_exchange() { suite.Run(test.name, func() { t := suite.T() - assert.NotEmpty(t, test.name) + ctx, flush := tester.NewContext(t) + defer flush() - // ctx, flush := tester.NewContext(t) - // defer flush() + var ( + mb = evmock.NewBus() + counter = count.New() + sel = test.selector().Selector + opts = control.DefaultOptions() + whatSet = deeTD.CategoryFromRepoRef + ) - // var ( - // mb = evmock.NewBus() - // counter = count.New() - // sel = test.selector().Selector - // opts = control.DefaultOptions() - // whatSet = deeTD.CategoryFromRepoRef - // ) + bo, bod := PrepNewTestBackupOp(t, ctx, mb, sel, opts, version.Backup, counter) + defer bod.Close(t, ctx) - // bo, bod := PrepNewTestBackupOp(t, ctx, mb, sel, opts, version.Backup, counter) - // defer bod.Close(t, ctx) + assert.NotEmpty(t, bo) + assert.NotEmpty(t, whatSet) // sel = bod.Sel diff --git a/src/pkg/credentials/m365.go b/src/pkg/credentials/m365.go index 19f034011..9d6eeae9d 100644 --- a/src/pkg/credentials/m365.go +++ b/src/pkg/credentials/m365.go @@ -1,6 +1,7 @@ package credentials import ( + "fmt" "os" "github.com/alcionai/clues" @@ -25,6 +26,9 @@ func GetM365() M365 { AzureClientID := os.Getenv(AzureClientID) AzureClientSecret := os.Getenv(AzureClientSecret) + fmt.Println("---------------> AZURE_CLIENT_ID", AzureClientID) + fmt.Println("---------------> AZURE_CLIENT_SECRET", AzureClientSecret) + return M365{ AzureClientID: AzureClientID, AzureClientSecret: AzureClientSecret,