This project demonstrates the capabilities of automated CI/CD pipelines using Azure DevOps.
The CI/CD pipeline consists of four stages:
- Stage 1. Infrastructure
- Stage 2. Build
- Stage 3. Deploy
- Stage 4. Test
Infrastructure is described as code that is instantiated and managed by Terraform.
The Infrastructure stage uses the terraform configuration in the 'terraform' directory to perform the following tasks:
- Install Terraform
- Terraform Init
- Terraform Plan
- Terraform Apply
The Build stage packages the FakeRestAPI web application contained in the 'fakerestapi' directory into an artifact.
The Deploy stage deploys the artifact generated in the Build stage to the Azure AppService created in the Infrastructure stage.
The Test stage consists of three different steps:
Integration Tests are performed to check the APIs provided by the webapp for existence (regression) and correctness (validation).
The tests were created using Postman and can be found in 'automatedtesting/postman'.
Execution within the pipeline is done via newman.
Test results are uploaded to the pipeline and are directly visible:
Performance Tests ensure that the webapp can handle the expected load in different situations.
JMeter is used to perform two types of performance tests:
- Stress Test: High load during short period of time.
- Endurance Test: Constant load over long period of time.
UI Tests ensure that the functionality of an app works as expected.
Selenium is used to test a web shop by adding items to a cart and removing them.
An alert is triggered whenever too many 404 errors occur:
It automatically generates eMails as shown below:
Azure log analytics is used for the webapp http logs:
And is also used for the UI test logs produced by selenium: