diff --git a/.github/workflows/solutionIntegration.yaml b/.github/workflows/solutionIntegration.yaml new file mode 100644 index 00000000000..96d5b300992 --- /dev/null +++ b/.github/workflows/solutionIntegration.yaml @@ -0,0 +1,115 @@ +name: Solution Integration Testing +run-name: Running Solution Integration Testing on ${{ github.ref_name }} + +on: + pull_request: + branches: + - master + paths: + - 'Solutions/**/Package/mainTemplate.json' + + workflow_dispatch: # Allows to run workflow manually from the Actions tab +permissions: + id-token: write + contents: read + pull-requests: write + +jobs: + Run-solutionIntegration-Testimio: + name: Solution Integration Testing - Testim.io + runs-on: ubuntu-latest + steps: + - name: Checkout pull request branch + uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + # persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token. + fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. + + - name: Setup git config + run: | + git config --local user.name "github-actions[bot]" + git config --local user.email "<>" + + - name: Azure Login to Dev Account + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZURE_SOLUTIONTESTING_DEV_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_SOLUTIONTESTING_DEV_TENANT_ID }} + allow-no-subscriptions: true + + - name: Whitelist Runner IP + run: | + agentIP=$(curl -s https://api.ipify.org/) + az keyvault network-rule add --name e2e-solIntegTesting-KV --ip-address $agentIP + + - name: Get Access Token + run: | + echo "accessToken=$(az account get-access-token -o tsv --query accessToken)" >> $GITHUB_ENV + + - name: Download files from ADO #TODO: update repo link to main + run: | + curl -u :${{ env.accessToken }} \ + -o evaluateAndExtractTemplate.py \ + "https://dev.azure.com/msazure/One/_apis/git/repositories/Sentinel-CATUtilities/items?path=/SolutionIntegrationTesting/.scripts/evaluateAndExtractTemplate.py&versionDescriptor.versionType=Branch&versionDescriptor.version=users/tanishqarora/solutionIntegrationTesting&api-version=6.0" \ + -o runUITests.py \ + "https://dev.azure.com/msazure/One/_apis/git/repositories/Sentinel-CATUtilities/items?path=/SolutionIntegrationTesting/.scripts/runUITests.py&versionDescriptor.versionType=Branch&versionDescriptor.version=users/tanishqarora/solutionIntegrationTesting&api-version=6.0" \ + -o requirements.txt \ + "https://dev.azure.com/msazure/One/_apis/git/repositories/Sentinel-CATUtilities/items?path=/SolutionIntegrationTesting/requirements.txt&versionDescriptor.versionType=Branch&versionDescriptor.version=users/tanishqarora/solutionIntegrationTesting&api-version=6.0" + + - name: Setup Python Environment + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Get Test Tenant Client ID and Tenant ID + run: | + echo "AZURE_TEST_CLIENT_ID=$(az keyvault secret show --name ClientId-Test --vault-name e2e-solIntegTesting-KV --query value -o tsv)" >> $GITHUB_ENV + echo "AZURE_TEST_TENANT_ID=$(az keyvault secret show --name TenantId-Test --vault-name e2e-solIntegTesting-KV --query value -o tsv)" >> $GITHUB_ENV + + - name: Azure Login to Test Tenant Account + uses: azure/login@v2 + with: + client-id: ${{ env.AZURE_TEST_CLIENT_ID }} + tenant-id: ${{ env.AZURE_TEST_TENANT_ID }} + allow-no-subscriptions: true + + - name: Get Test Tenant Subscription + run: | + echo "TEST_TENANT_SUBSCRIPTION_ID=$(az account show --query id -o tsv)" >> $GITHUB_ENV + + - name: Deploy Solution to Workspace, Evaluate and Extract Template Files + continue-on-error: true # Continues even after failing so as to not block the PR + run: | + filePath="evaluateAndExtractTemplate.py" + python $filePath + + - name: Azure Login to Dev Account + uses: azure/login@v2 + if: '!cancelled()' + with: + client-id: ${{ secrets.AZURE_SOLUTIONTESTING_DEV_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_SOLUTIONTESTING_DEV_TENANT_ID }} + allow-no-subscriptions: true + + - name: Execute Tests on Testim + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_REPOSITORY: ${{ github.repository }} + PR_NUMBER: ${{ github.event.pull_request.number }} + continue-on-error: true # Continues even after failing so as to not block the PR + run: | + filePath="runUITests.py" + python $filePath + + - name: Delist Runner IP + if: '!cancelled()' + run: | + agentIP=$(curl -s https://api.ipify.org/) + az keyvault network-rule remove --name e2e-solIntegTesting-KV --ip-address $agentIP \ No newline at end of file diff --git a/Solutions/Cisco Meraki Events via REST API/Package/mainTemplate.json b/Solutions/Cisco Meraki Events via REST API/Package/mainTemplate.json index 2862f284afc..45e62607c53 100644 --- a/Solutions/Cisco Meraki Events via REST API/Package/mainTemplate.json +++ b/Solutions/Cisco Meraki Events via REST API/Package/mainTemplate.json @@ -11,7 +11,7 @@ "minLength": 1, "defaultValue": "[resourceGroup().location]", "metadata": { - "description": "Not used, but needed to pass arm-ttk test `Location-Should-Not-Be-Hardcoded`. We instead use the `workspace-location` which is derived from the LA workspace" + "description": "Not used, but needed to ass arm-ttk test `Location-Should-Not-Be-Hardcoded`. We instead use the `workspace-location` which is derived from the LA workspace" } }, "workspace-location": { diff --git a/Solutions/Microsoft Entra ID/Package/mainTemplate.json b/Solutions/Microsoft Entra ID/Package/mainTemplate.json index 8586a0c5661..cd93b3b46ac 100644 --- a/Solutions/Microsoft Entra ID/Package/mainTemplate.json +++ b/Solutions/Microsoft Entra ID/Package/mainTemplate.json @@ -25,7 +25,7 @@ "defaultValue": "", "type": "string", "metadata": { - "description": "Workspace name for Log Analytics where Microsoft Sentinel is setup" + "description": "Workspace name for Lo Analytics where Microsoft Sentinel is setup" } }, "workbook1-name": {