From efe99dbdb231228f1126bfcf55595fc96bdb87d9 Mon Sep 17 00:00:00 2001 From: zjhe Date: Thu, 4 Jan 2024 19:41:55 +0800 Subject: [PATCH] fix e2e test by querying msi's client id and pass it into the container --- .github/workflows/e2e.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 0c980f842..f503cdec5 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -32,11 +32,12 @@ jobs: az login --identity --username $MSI_ID > /dev/null export ARM_SUBSCRIPTION_ID=$(az login --identity --username $MSI_ID | jq -r '.[0] | .id') export ARM_TENANT_ID=$(az login --identity --username $MSI_ID | jq -r '.[0] | .tenantId') + ARM_CLIENT_ID=$(az identity list | jq -r --arg MSI_ID "$MSI_ID" '.[] | select(.principalId == $MSI_ID) | .clientId') export CHANGED_FOLDERS="${{ steps.changed-files.outputs.all_changed_files }}" - docker run --rm -v $(pwd):/src -w /src/test --network=host -e MSI_ID -e ARM_SUBSCRIPTION_ID -e ARM_TENANT_ID -e ARM_USE_MSI=true -e CHANGED_FOLDERS mcr.microsoft.com/azterraform:latest sh -c "go mod tidy && go test -timeout=360m -v ./e2e" + docker run --rm -v $(pwd):/src -w /src/test --network=host -e MSI_ID -e ARM_SUBSCRIPTION_ID -e ARM_TENANT_ID -e ARM_CLIENT_ID -e ARM_USE_MSI=true -e CHANGED_FOLDERS mcr.microsoft.com/azterraform:latest sh -c "go mod tidy && go test -timeout=360m -v ./e2e" - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 #v3.1.3 with: name: TestRecord-${{ github.event.number }} retention-days: 60 path: | - quickstart/**/TestRecord.md.tmp + quickstart/**/TestRecord.md.tmp \ No newline at end of file