Autotest as a Quality Gate
This use case outlines the process of integrating an autotest as a quality gate into a newly created Deployment. The Deployment 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 KubeRocketCI, users can seamlessly add autotests as quality gates to their Deployment, 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.
- Create a 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:
-
Log in to the KubeRocketCI portal:

-
On the main menu, click the Manage Namespaces button:

-
Ensure the
Namespacevalue points to the namespace with the KubeRocketCI installation:
noteDon't forget to press Enter to add the namespace to the allowed namespaces list.
-
Create a new Project with the
Applicationtype using theCreatestrategy. Select the Projects section and click + Create project:
-
Select the Custom configuration option, choose the
ApplicationCodebase type as we intend to deliver our application as a container and deploy it within the Kubernetes cluster. Select the Create strategy to scaffold our application from the template provided by the KubeRocketCI and click Continue:
-
On the Git & project info tab, define the following values and click Continue:
- Git server:
github - Owner:
github_account_name - Repository name:
js-application - Default branch:
main - Project name:
js-application - Description:
JavaScript application - Private:
enabled

- Git server:
-
On the Build config tab, define the values and click Continue:
- Application code language:
JavaScript - Language version/Provider:
Vue - Build tool:
NPM - Deployment options:
helm-chart - Codebase versioning type:
semver - Start version from:
0.1.0 - Suffix:
SNAPSHOT

- Application code language:
-
On the Review tab, verify the project configuration and click Create project:

-
On the congratulations menu, click View all projects:

-
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 - Owner:
github_account_name - Repository name:
go-application - Project name:
go-application - Description:
Go application - Application code language:
Go - Language version/Provider:
Gin - Build tool:
Go - Default branch:
main - Codebase versioning type:
semver - Start version from:
0.1.0 - Suffix:
SNAPSHOT
python-application:
- Git server:
github - Owner:
github_account_name - Repository name:
python-application - Project name:
python-application - Description:
Python application - Application code language:
Python - Language version/Provider:
FastAPI - Build tool:
Python - Default branch:
main - Codebase versioning type:
semver - Start version from:
0.1.0 - Suffix:
SNAPSHOT
- Git server:
-
In the Projects tab, click one of the applications name to enter the application menu:

-
Select the Branches tab and click the Build button:

-
Click the PipelineRun name to watch the building logs:

-
On the pipeline details page, you can find information about each step, pipeline status, and view logs:

-
Wait till the build is successful.
-
Repeat steps 11-15 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 Projects tab, click on the + Create project button. Select Autotest, Clone and click Next:
notePlease refer to the Add Autotest section for details.
-
On the Git & project info tab, define the following values and click Continue:
- Repository URL:
https://github.com/Oleksandr123234/autotests.git - Git server:
github - Owner:
github_account_name - Repository name:
demo-autotest-gradle - Default branch:
main - Project name:
demo-autotest-gradle - Description:
Gradle demo autotests

- Repository URL:
-
On the Build config tab, define the values and click Continue:
- Autotest code language:
Java - Language version/framework:
Java25 - Build tool:
Gradle - Autotest report framework:
Allure - Codebase versioning type:
semver - Start version from:
0.1.0 - Suffix:
SNAPSHOT

- Autotest code language:
-
On the Review tab, verify the autotest configuration and click Create project:

-
Repeat the steps 1-4 to create one more autotest with the parameters below:
- Repository URL:
https://github.com/Oleksandr123234/autotests.git - Git server:
github - Repository name:
demo-autotest-maven - Project name:
demo-autotest-maven - Description:
Maven demo autotest - Autotest code language:
Java - Language version/framework:
Java25 - Build tool:
Maven - Autotest report framework:
Allure - Default branch:
main - Codebase versioning type:
semver - Start version from:
0.1.0 - Suffix:
SNAPSHOT
- 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 Deployments section and click the corresponding button to create new GitOps repository:

-
Click to the + Add GitOps repository:

-
Select the
githubserver, enter GitHub account name and click Save:
-
Return to the Deployments tab and click + Create deployment button:

-
On the Applications tab, add all the three applications, specify the main branch for all for them and click the Continue button:

-
Enter
demo-deployname, specify description, enable the "Promote applications" option and click Continue:
-
Review the Deployment configuration and click Continue:

-
Once all the steps have been completed, you may begin creating Environments:

-
On the Deployment details page, click the + Create environment button:

-
On the Basic configuration step, define the following values and click Continue:
- Cluster:
in-cluster - Stage name:
dev - Description:
Development Environment

- Cluster:
-
On the Pipeline configuration step, define the following values and click Continue:
- Trigger type:
Manual - Deploy pipeline template:
deploy-with-autotests - Clean pipeline template:
clean

- Trigger type:
-
In the Quality gates menu click + button. Specify the following parameters and click Continue:
First Quality Gate:
- Quality gate type:
Autotest - Step name:
autotest-step-1 - Autotest:
demo-autotest-gradle - Autotest branch:
main
Second Quality Gate:
- Quality gate type:
Autotest - Step name:
autotest-step-2 - Autotest:
demo-autotest-gradle - Autotest branch:
main
Third Quality Gate:
- Quality gate type:
Autotest - Step name:
autotest-step-3 - Autotest:
demo-autotest-maven - Autotest branch:
main
Fourth Quality Gate:
- Quality gate type:
Autotest - Step name:
autotest-step-4 - Autotest:
demo-autotest-maven - Autotest branch:
main
noteThe same automated test can be executed multiple times within a single deployment pipeline using different step names. To achieve this, specify a unique step name as a parameter when triggering the Tekton automated test pipeline. Verify that the key names in demo-autotest-gradle/run.json and demo-autotest-maven/run.json comply with the required template and update them if necessary.
demo-autotest-gradle/run.json{"comment": "step-name: <deployment Flow>-<environment>-<autotest step name>","demo-deploy-dev-autotest-step-1": "gradle -q hello","demo-deploy-dev-autotest-step-2": "gradle -q hello","demo-deploy-dev-autotest-step-3": "mvn antrun:run@hello -q","demo-deploy-dev-autotest-step-4": "mvn antrun:run@hello -q"} - Quality gate type:
-
Review the changes and click Create environment:

-
Repeat the steps 8-10 to create one more stage with the parameters below:
- Cluster:
in-cluster - Stage name:
sit - Description:
System integration testing - Trigger type:
manual - Deploy pipeline template:
deploy - Clean pipeline template:
clean - Quality gate type:
Manual
- Cluster:
Run Autotestsβ
After the Deployment is created, deploy applications and run autotests by following the steps below:
-
Open the sit Environment name by clicking on its name:

-
Select the Applications tab and click Configure deploy. Hover your cursor over the application versions to see the image that blocks you from running a deployment:

-
Get back to the Deployment details page. Click the dev stage name to expand its details:

-
Select the Applications tab and click Configure deploy. Then select latest versions of all the applications and click Start deploy:

-
To find information about the running deploy pipeline, navigate to the Pipelines tab and click on the pipeline name:

-
View the pipeline details. Pay attention that the deploy-with-autotest pipeline features the wait-for-autotests task:

-
Wait until the deploy pipeline completes. The application statuses should be Healthy and Synced:

-
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:
