Autotest as a Quality Gate
This use case outlines the process of integrating an autotest as a quality gate into a newly created CD pipeline. The CD pipeline includes a selected build version of an application that needs to be promoted. The purpose of incorporating autotests is to ensure that the application meets predefined criteria for stability and functionality, guaranteeing that only reliable versions are promoted. By implementing this feature, users can perform comprehensive testing, thereby enhancing the overall stability of the application.
In the KubeRocketCI platform, users can seamlessly add autotests as quality gates to their CD pipelines, enabling them to validate the application's stability and functionality before promoting it to the next stage. This ensures that only reliable versions of the application are deployed, improving the overall quality and reliability of the software.
Rolesβ
This documentation is tailored for the Developers and Quality Assurance specialists.
Goalsβ
- Create several applications and autotests quickly.
- Create a pipeline for Continuous Deployment.
- Perform testing.
- Update delivery by deploying the new version.
Preconditionsβ
- KubeRocketCI instance is configured with GitHub, Tekton and Argo CD.
- Developer has access to the platform using the Single-Sign-On approach.
- Developer has the Administrator role (to perform merge in GitHub).
Create Applicationsβ
To implement autotests as Quality Gates, follow the steps below:
-
Ensure the namespace is specified in the cluster settings. Click the Settings icon in the top right corner and select Cluster settings:
-
Enter the name of the default namespace, then enter your default namespace in the Allowed namespaces field and click the + ADD button. You can also add other namespaces to the Allowed namespaces:
-
Create several applications using the Create strategy. Navigate to the Components tab and click the + CREATE COMPONENT button:
-
Select Application and click Next:
-
Select Create from template and click Create:
notePlease refer to the Add Application section for details.
-
On the Codebase info tab, define the following values and press the Next button:
- Git server:
github
- Repository name:
<github_account_name>/js-application
- Component name:
js-application
- Description:
js application
- Application code language:
JavaScript
- Language version/Provider:
Vue
- Build tool:
NPM
- Git server:
-
On the Advanced settings tab, define the below values and push the Create button:
- Default branch:
main
- Codebase versioning type:
edp
- Default branch:
-
Repeat the procedure twice to create the go-application and python-application applications. These applications will have the following parameters:
go-application:
- Git server:
github
- Repository name:
<github_account_name>/go-application
- Component name:
go-application
- Description:
go application
- Application code language:
Go
- Language version/Provider:
Gin
- Build tool:
Go
- Default branch:
main
- Codebase versioning type:
edp
python-application:
- Git server:
github
- Repository name:
<github_account_name>/python-application
- Component name:
python-application
- Description:
python application
- Application code language:
Python
- Language version/Provider:
FastAPI
- Build tool:
Python
- Default branch:
main
- Codebase versioning type:
edp
- Git server:
-
In the Components tab, click one of the applications name to enter the application menu:
-
Click the Trigger build pipeline run button:
-
Click the application run name to watch the building logs:
-
On the pipeline details page, you can find information about each step, pipeline status, view logs.
-
Wait till the build is successful:
-
Repeat steps 9-13 for the rest of the applications.
Create Autotestsβ
The steps below instruct how to create autotests in KubeRocketCI:
-
Create a couple of autotests using the Clone strategy. Navigate to the Components tab, click on the +CREATE COMPONENT button. Select Autotest and click Next:
notePlease refer to the Add Autotest section for details.
-
Select Clone project and click Create:
-
On the Codebase info tab, define the following values and press the Proceed button:
- Repository URL:
https://github.com/SergK/autotests.git
- Git server:
github
- Repository name:
<github_account_name>/demo-autotest-gradle
- Component name:
demo-autotest-gradle
- Description:
demo-autotest-gradle
- Autotest code language:
Java
- Language version/framework:
Java11
- Build tool:
Gradle
- Autotest report framework:
Allure
- Repository URL:
-
On the Advanced settings tab define the below values and push the Create button:
- Default branch:
main
- Codebase versioning type:
edp
- Default branch:
-
Repeat the steps 1-4 to create one more autotest with the parameters below:
- Repository URL:
https://github.com/Rolika4/autotests.git
- Git server:
github
- Repository name:
<github_account_name>/demo-autotest-maven
- Component name:
demo-autotest-maven
- Description:
demo-autotest-maven
- Autotest code language:
Java
- Language version/framework:
Java11
- Build tool:
Maven
- Autotest report framework:
Allure
- Default branch:
main
- Codebase versioning type:
edp
- Repository URL:
Create CD Pipelineβ
Now that applications and autotests are created, create pipeline for them by following the steps below:
To utilize and manage various environments through the KubeRocketCI platform, the initial step is to onboard a new GitOps repository.
-
Navigate to the Environments tab and click the corresponding button to create new GitOps repository:
-
Click to the ADD GITOPS REPOSITORY:
-
Select the
github
server, enter GitHub account name and click SAVE: -
Return to the Environments tab and click CREATE ENVIRONMENT button:
-
Enter
demo-pipeline
and click the NEXT button: -
On the Applications tab, add all the three applications, specify the main branch for all for them and check Promote in pipeline:
-
Once all the steps have been completed, you may begin creating stages.
-
On the Stages menu click to the CREATE STAGE button:
-
In the Create stage menu, define the following values and click NEXT:
- Cluster:
In cluster
- Stage name:
dev
- Description:
dev
- Trigger type:
Manual
- Pipeline template:
deploy-with-autotests
- Cluster:
-
In the Add quality gates menu click + button. Specify the following parameters and click Create:
First Quality Gate:
- Quality gate type:
Autotest
- Step name:
Autotest
- Autotest:
demo-autotest-gradle
- Autotest branch:
main
Second Quality Gate:
- Quality gate type:
Autotest
- Step name:
Autotest
- Autotest:
demo-autotest-maven
- Autotest branch:
main
- Quality gate type:
-
Repeat the steps 8-10 to create one more stage with the parameters below:
- Cluster:
In cluster
- Stage name:
sit
- Description:
sit
- Trigger type:
manual
- Pipeline template:
deploy
- Quality gate type:
Manual
- Cluster:
Run Autotestsβ
After the CD pipeline is created, deploy applications and run autotests by following the steps below:
-
Click the dev stage name to expand its details:
-
Navigate Applications and click CONFIGURE DEPLOY. Then select latest versions of all applications and click START DEPLOY.
-
To find information about running deploy pipeline navigate PIPELINES and click on pipeline name:
-
Once promotion procedure is finished, the promoted applications will become available in the Sit stage. You will be able to select image stream versions for the promoted applications: