From d2718e295894c9c693ac6e82d2841ace9a1b6302 Mon Sep 17 00:00:00 2001 From: Chandni Patel Date: Wed, 22 May 2024 13:22:37 -0500 Subject: [PATCH] e2e test --- .github/workflows/run-e2e-tests-dotnet3-lcon.yaml | 7 ++++++- .github/workflows/run-e2e-tests-dotnet3-wcon.yaml | 7 ++++++- .github/workflows/run-e2e-tests-java8-lcon.yaml | 7 ++++++- .github/workflows/run-e2e-tests-java8-wcon.yaml | 7 ++++++- .github/workflows/run-e2e-tests-node20-lcon.yaml | 7 ++++++- .github/workflows/run-e2e-tests-node20-wcon.yaml | 7 ++++++- .github/workflows/run-e2e-tests-powershell6-wcon.yaml | 7 ++++++- .github/workflows/run-e2e-tests-python310-flexcon.yaml | 7 ++++++- .github/workflows/run-e2e-tests-python310-lcon-msi.yaml | 4 ++-- .github/workflows/run-e2e-tests-python37-lcon.yaml | 7 ++++++- src/appservice-rest/Kudu/azure-app-kudu-service.ts | 1 - src/handlers/contentPreparer.ts | 2 +- src/handlers/parameterValidator.ts | 6 +++--- src/interfaces/IActionParameters.ts | 2 +- src/managers/builder.ts | 4 ++-- 15 files changed, 63 insertions(+), 19 deletions(-) diff --git a/.github/workflows/run-e2e-tests-dotnet3-lcon.yaml b/.github/workflows/run-e2e-tests-dotnet3-lcon.yaml index f11ffa285..dce0d0fab 100644 --- a/.github/workflows/run-e2e-tests-dotnet3-lcon.yaml +++ b/.github/workflows/run-e2e-tests-dotnet3-lcon.yaml @@ -11,6 +11,9 @@ on: paths-ignore: - '**.md' +permissions: + id-token: write + env: AZURE_FUNCTIONAPP_NAME: gae-fa-dotnet3-lcon AZURE_FUNCTIONAPP_PACKAGE_PATH: './tests/e2e/dotnet3' @@ -51,7 +54,9 @@ jobs: - name: 'Login via Azure CLI' uses: azure/login@v1 with: - creds: ${{ secrets.RBAC_GAE_FA_DOTNET3_LCON }} + client-id: ${{ secrets.AZURE_CLIENT_ID_FA_DOTNET3_LCON }} + tenant-id: ${{ secrets.AZURE_TENANT_ID_FA_E2E_TESTS }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID_FA_E2E_TESTS }} - name: E2E Run Azure Functions Action uses: ./ diff --git a/.github/workflows/run-e2e-tests-dotnet3-wcon.yaml b/.github/workflows/run-e2e-tests-dotnet3-wcon.yaml index 19bd173a3..3ce070de8 100644 --- a/.github/workflows/run-e2e-tests-dotnet3-wcon.yaml +++ b/.github/workflows/run-e2e-tests-dotnet3-wcon.yaml @@ -11,6 +11,9 @@ on: paths-ignore: - '**.md' +permissions: + id-token: write + env: AZURE_FUNCTIONAPP_NAME: gae-fa-dotnet3-wcon AZURE_FUNCTIONAPP_PACKAGE_PATH: './tests/e2e/dotnet3' @@ -51,7 +54,9 @@ jobs: - name: 'Login via Azure CLI' uses: azure/login@v1 with: - creds: ${{ secrets.RBAC_GAE_FA_DOTNET3_WCON }} + client-id: ${{ secrets.AZURE_CLIENT_ID_FA_DOTNET3_WCON }} + tenant-id: ${{ secrets.AZURE_TENANT_ID_FA_E2E_TESTS }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID_FA_E2E_TESTS }} - name: E2E Run Azure Functions Action uses: ./ diff --git a/.github/workflows/run-e2e-tests-java8-lcon.yaml b/.github/workflows/run-e2e-tests-java8-lcon.yaml index 067319cdb..d2c08c2cc 100644 --- a/.github/workflows/run-e2e-tests-java8-lcon.yaml +++ b/.github/workflows/run-e2e-tests-java8-lcon.yaml @@ -11,6 +11,9 @@ on: paths-ignore: - '**.md' +permissions: + id-token: write + env: AZURE_FUNCTIONAPP_NAME: gae-fa-java8-lcon POM_XML_DIRECTORY: './tests/e2e/java8' @@ -53,7 +56,9 @@ jobs: - name: 'Login via Azure CLI' uses: azure/login@v1 with: - creds: ${{ secrets.RBAC_GAE_FA_JAVA8_LCON }} + client-id: ${{ secrets.AZURE_CLIENT_ID_FA_JAVA8_LCON }} + tenant-id: ${{ secrets.AZURE_TENANT_ID_FA_E2E_TESTS }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID_FA_E2E_TESTS }} - name: E2E Run Azure Functions Action uses: ./ diff --git a/.github/workflows/run-e2e-tests-java8-wcon.yaml b/.github/workflows/run-e2e-tests-java8-wcon.yaml index 0c0ef36d0..57c67f4aa 100644 --- a/.github/workflows/run-e2e-tests-java8-wcon.yaml +++ b/.github/workflows/run-e2e-tests-java8-wcon.yaml @@ -11,6 +11,9 @@ on: paths-ignore: - '**.md' +permissions: + id-token: write + env: AZURE_FUNCTIONAPP_NAME: gae-fa-java8-wcon POM_XML_DIRECTORY: './tests/e2e/java8' @@ -53,7 +56,9 @@ jobs: - name: 'Login via Azure CLI' uses: azure/login@v1 with: - creds: ${{ secrets.RBAC_GAE_FA_JAVA8_WCON }} + client-id: ${{ secrets.AZURE_CLIENT_ID_FA_JAVA8_WCON }} + tenant-id: ${{ secrets.AZURE_TENANT_ID_FA_E2E_TESTS }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID_FA_E2E_TESTS }} - name: E2E Run Azure Functions Action uses: ./ diff --git a/.github/workflows/run-e2e-tests-node20-lcon.yaml b/.github/workflows/run-e2e-tests-node20-lcon.yaml index 6a55220b3..6b78a588a 100644 --- a/.github/workflows/run-e2e-tests-node20-lcon.yaml +++ b/.github/workflows/run-e2e-tests-node20-lcon.yaml @@ -11,6 +11,9 @@ on: paths-ignore: - '**.md' +permissions: + id-token: write + env: AZURE_FUNCTIONAPP_NAME: gae-fa-node20-lcon AZURE_FUNCTIONAPP_PACKAGE_PATH: './tests/e2e/node20' @@ -53,7 +56,9 @@ jobs: - name: 'Login via Azure CLI' uses: azure/login@v1 with: - creds: ${{ secrets.RBAC_GAE_FA_NODE20_LCON }} + client-id: ${{ secrets.AZURE_CLIENT_ID_FA_NODE20_LCON }} + tenant-id: ${{ secrets.AZURE_TENANT_ID_FA_E2E_TESTS }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID_FA_E2E_TESTS }} - name: E2E Run Azure Functions Action uses: ./ diff --git a/.github/workflows/run-e2e-tests-node20-wcon.yaml b/.github/workflows/run-e2e-tests-node20-wcon.yaml index 562127916..020d93954 100644 --- a/.github/workflows/run-e2e-tests-node20-wcon.yaml +++ b/.github/workflows/run-e2e-tests-node20-wcon.yaml @@ -11,6 +11,9 @@ on: paths-ignore: - '**.md' +permissions: + id-token: write + env: AZURE_FUNCTIONAPP_NAME: gae-fa-node20-wcon AZURE_FUNCTIONAPP_PACKAGE_PATH: './tests/e2e/node20' @@ -53,7 +56,9 @@ jobs: - name: 'Login via Azure CLI' uses: azure/login@v1 with: - creds: ${{ secrets.RBAC_GAE_FA_NODE20_WCON }} + client-id: ${{ secrets.AZURE_CLIENT_ID_FA_NODE20_WCON }} + tenant-id: ${{ secrets.AZURE_TENANT_ID_FA_E2E_TESTS }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID_FA_E2E_TESTS }} - name: E2E Run Azure Functions Action uses: ./ diff --git a/.github/workflows/run-e2e-tests-powershell6-wcon.yaml b/.github/workflows/run-e2e-tests-powershell6-wcon.yaml index aa591558b..107bb377a 100644 --- a/.github/workflows/run-e2e-tests-powershell6-wcon.yaml +++ b/.github/workflows/run-e2e-tests-powershell6-wcon.yaml @@ -11,6 +11,9 @@ on: paths-ignore: - '**.md' +permissions: + id-token: write + env: AZURE_FUNCTIONAPP_NAME: gae-fa-powershell6-wcon AZURE_FUNCTIONAPP_PACKAGE_PATH: './tests/e2e/powershell6' @@ -44,7 +47,9 @@ jobs: - name: 'Login via Azure CLI' uses: azure/login@v1 with: - creds: ${{ secrets.RBAC_GAE_FA_POWERSHELL6_WCON }} + client-id: ${{ secrets.AZURE_CLIENT_ID_FA_POWERSHELL6_WCON }} + tenant-id: ${{ secrets.AZURE_TENANT_ID_FA_E2E_TESTS }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID_FA_E2E_TESTS }} - name: E2E Run Azure Functions Action uses: ./ diff --git a/.github/workflows/run-e2e-tests-python310-flexcon.yaml b/.github/workflows/run-e2e-tests-python310-flexcon.yaml index d2ab78d46..d7efc8e9d 100644 --- a/.github/workflows/run-e2e-tests-python310-flexcon.yaml +++ b/.github/workflows/run-e2e-tests-python310-flexcon.yaml @@ -11,6 +11,9 @@ on: paths-ignore: - '**.md' +permissions: + id-token: write + env: AZURE_FUNCTIONAPP_NAME: gae-fa-python310-flexcon AZURE_FUNCTIONAPP_PACKAGE_PATH: './tests/e2e/python310' @@ -52,7 +55,9 @@ jobs: - name: 'Login via Azure CLI' uses: azure/login@v1 with: - creds: ${{ secrets.RBAC_GAE_FA_PYTHON310_FLEXCON }} + client-id: ${{ secrets.AZURE_CLIENT_ID_FA_PYTHON310_FLEXCON }} + tenant-id: ${{ secrets.AZURE_TENANT_ID_FA_E2E_TESTS }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID_FA_E2E_TESTS }} - name: E2E Run Azure Functions Action uses: ./ diff --git a/.github/workflows/run-e2e-tests-python310-lcon-msi.yaml b/.github/workflows/run-e2e-tests-python310-lcon-msi.yaml index b0bfdcc1d..8844305fd 100644 --- a/.github/workflows/run-e2e-tests-python310-lcon-msi.yaml +++ b/.github/workflows/run-e2e-tests-python310-lcon-msi.yaml @@ -56,8 +56,8 @@ jobs: uses: azure/login@v1 with: client-id: ${{ secrets.AZURE_CLIENT_ID_FA_PYTHON310_LCON_MSI }} - tenant-id: ${{ secrets.AZURE_TENANT_ID_FA_PYTHON310_LCON_MSI }} - subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID_FA_PYTHON310_LCON_MSI }} + tenant-id: ${{ secrets.AZURE_TENANT_ID_FA_E2E_TESTS }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID_FA_E2E_TESTS }} - name: E2E Run Azure Functions Action uses: ./ diff --git a/.github/workflows/run-e2e-tests-python37-lcon.yaml b/.github/workflows/run-e2e-tests-python37-lcon.yaml index e4560962a..6a73e87d6 100644 --- a/.github/workflows/run-e2e-tests-python37-lcon.yaml +++ b/.github/workflows/run-e2e-tests-python37-lcon.yaml @@ -11,6 +11,9 @@ on: paths-ignore: - '**.md' +permissions: + id-token: write + env: AZURE_FUNCTIONAPP_NAME: gae-fa-python37-lcon AZURE_FUNCTIONAPP_PACKAGE_PATH: './tests/e2e/python37' @@ -52,7 +55,9 @@ jobs: - name: 'Login via Azure CLI' uses: azure/login@v1 with: - creds: ${{ secrets.RBAC_GAE_FA_PYTHON37_LCON }} + client-id: ${{ secrets.AZURE_CLIENT_ID_FA_PYTHON37_LCON }} + tenant-id: ${{ secrets.AZURE_TENANT_ID_FA_E2E_TESTS }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID_FA_E2E_TESTS }} - name: E2E Run Azure Functions Action uses: ./ diff --git a/src/appservice-rest/Kudu/azure-app-kudu-service.ts b/src/appservice-rest/Kudu/azure-app-kudu-service.ts index a98df3a2f..cf01afe5c 100644 --- a/src/appservice-rest/Kudu/azure-app-kudu-service.ts +++ b/src/appservice-rest/Kudu/azure-app-kudu-service.ts @@ -6,7 +6,6 @@ import { KuduServiceClient } from './KuduServiceClient'; import { exists } from '@actions/io/lib/io-util'; import core = require('@actions/core'); -import { CANCELLED } from 'dns'; export const KUDU_DEPLOYMENT_CONSTANTS = { CANCELLED: -1, diff --git a/src/handlers/contentPreparer.ts b/src/handlers/contentPreparer.ts index 6b2197211..3cd62cce0 100644 --- a/src/handlers/contentPreparer.ts +++ b/src/handlers/contentPreparer.ts @@ -163,7 +163,7 @@ export class ContentPreparer implements IOrchestratable { "You can use it to exclude files from deployment.") return } - + FuncIgnore.removeFilesFromFuncIgnore(packagePath, funcignoreParser); return; } diff --git a/src/handlers/parameterValidator.ts b/src/handlers/parameterValidator.ts index d503c7349..dd3e6bf94 100644 --- a/src/handlers/parameterValidator.ts +++ b/src/handlers/parameterValidator.ts @@ -25,10 +25,10 @@ export class ParameterValidator implements IOrchestratable { private _respectPomXml: string; private _respectFuncignore: string; private _scmDoBuildDuringDeployment: string; - private _remoteBuild: string; private _enableOryxBuild: string; private _scmCredentials: IScmCredentials private _sku: string; + private _remoteBuild: string; constructor() { this.parseScmCredentials = this.parseScmCredentials.bind(this); @@ -44,9 +44,9 @@ export class ParameterValidator implements IOrchestratable { this._respectPomXml = core.getInput(ConfigurationConstant.ParamInRespectPomXml); this._respectFuncignore = core.getInput(ConfigurationConstant.ParamInRespectFuncignore); this._scmDoBuildDuringDeployment = core.getInput(ConfigurationConstant.ParamInScmDoBuildDuringDeployment); - this._remoteBuild = core.getInput(ConfigurationConstant.ParamInRemoteBuild); this._enableOryxBuild = core.getInput(ConfigurationConstant.ParamInEnableOryxBuild); this._sku = core.getInput(ConfigurationConstant.ParamInSku); + this._remoteBuild = core.getInput(ConfigurationConstant.ParamInRemoteBuild); // Validate field if (this._slot !== undefined && this._slot.trim() === "") { @@ -66,9 +66,9 @@ export class ParameterValidator implements IOrchestratable { params.respectPomXml = Parser.IsTrueLike(this._respectPomXml); params.respectFuncignore = Parser.IsTrueLike(this._respectFuncignore); params.scmDoBuildDuringDeployment = ScmBuildUtil.FromString(this._scmDoBuildDuringDeployment); - params.remoteBuild = Parser.IsTrueLike(this._remoteBuild); params.enableOryxBuild = EnableOryxBuildUtil.FromString(this._enableOryxBuild); params.sku = this._sku.toLowerCase(); + params.remoteBuild = Parser.IsTrueLike(this._remoteBuild); return params; } diff --git a/src/interfaces/IActionParameters.ts b/src/interfaces/IActionParameters.ts index ebae18779..b968f888b 100644 --- a/src/interfaces/IActionParameters.ts +++ b/src/interfaces/IActionParameters.ts @@ -9,7 +9,7 @@ export interface IActionParameters { respectPomXml: boolean; respectFuncignore: boolean; scmDoBuildDuringDeployment: ScmBuildConstant; - remoteBuild: boolean; enableOryxBuild: EnableOryxBuildConstant; sku: string; + remoteBuild: boolean; } \ No newline at end of file diff --git a/src/managers/builder.ts b/src/managers/builder.ts index 5deacf7e2..866e14bcc 100644 --- a/src/managers/builder.ts +++ b/src/managers/builder.ts @@ -23,9 +23,9 @@ export class Builder { respectPomXml: false, respectFuncignore: false, scmDoBuildDuringDeployment: ScmBuildConstant.Disabled, - remoteBuild: false, enableOryxBuild: EnableOryxBuildConstant.Disabled, - sku: undefined + sku: undefined, + remoteBuild: false } }