This is a final project submission for Udacity Azure DevOps Course: Ensuring Quality Releases.
Resource Created with Terraform | Status |
---|---|
AppService | ✅ |
Network | ✅ |
Network Security Group | ✅ |
Public IP | ✅ |
Resource Group | ✅ |
Linux VM (created using Packer -- using a Standard_B1s size for lowest cost) | ✅ |
Test Type | Technology | Stage in CI/CD pipeline | Status |
---|---|---|---|
Integration | Postman | Test Stage - runs in Microsoft-hosted VM | ✅ |
Functional | Selenium | Test Stage - runs in custom linux VM | ✅ |
Performance | JMeter | Test Stage - runs against the AppService | ✅ |
Goal | Status |
---|---|
Configure an Action Group (email) | ✅ |
Configure an alert to trigger given a condition from the AppService. | ✅ |
The time the alert triggers and the time the Performance test is executed ought to be very close. | ✅ |
Direct the output of the Selenium Test Suite to a log file, and execute the Test Suite. | ✅ |
Configure custom logging in Azure Monitor to ingest this log file. This may be done non-CI/CD. | ✅ |
- Create a Regression Test Suite from the Starter APIs.
- Use the Publish Test Results task to publish the test results to Azure Pipelines.
- Create a Data Validation Test Suite from the Starter APIs.
- Create a UI Test Suite that adds all products to a cart, and then removes them.
- Include print() commands throughout the tests so the actions of the tests can easily be determined.
- Deploy the UI Test Suite to the linux VM and execute the Test Suite via the CI/CD pipeline.
- Use the starter APIs to create two Test Suites.
- Using variables, reference a data set (csv file) in the test cases where the data will change.
- Create a Stress Test Suite
- Create a Endurance Test Suite
- Generate the HTML report (non-CI/CD)
IMPORTANT: Since the AppService is using the Basic/Free plan, start small (2 users max) and once you are ready for the final submission, use up to 30 users for a max duration of 60 seconds. The "Data Out" quota for the AppService on this plan is only 165 MiB.
-
Configure Authentication via Service Principal and Client Secret
Following this guide we can set up the service principal allowing terraform to change resources in selected subscription scope.
Executing
az ad sp create-for-rbac
command as described in the guide above the following output gets printed on console.{ "appId": "00000000-0000-0000-0000-000000000000", "displayName": "azure-cli-2017-06-05-10-41-15", "name": "http://azure-cli-2017-06-05-10-41-15", "password": "0000-0000-0000-0000-000000000000", "tenant": "00000000-0000-0000-0000-000000000000" }
Then we need to export the following environment variables which are then read by terraform:
export ARM_CLIENT_ID=<value corresponds to appId printed on console> export ARM_CLIENT_SECRET=<value corresponds to password> export ARM_TENANT_ID=<value corresponds to tenant>
-
Navigate to the environment / test directory, then run terraform init, plan, apply.
cd terraform/environment/test
terraform init
terraform plan -out solution.plan
terraform apply "solution.plan"