Method for realizing automatic interface test by integrating software CICD process with MeterSphere

By integrating Jenkins server and MeterSphere platform, automated interface testing in CI/CD processes is realized, which solves the problems of low communication efficiency and low testing efficiency between R&D and testing, and improves software quality and online efficiency.

CN119782182APending Publication Date: 2025-04-08YUKUAI CHUANGLING INTELLIGENT TECH (NANJING) CO LTD

Patent Information

Application Number
CN202411978973.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

In the CI/CD process, communication between R&D personnel and testers is inefficient, testing efficiency is low, and information transmission is inaccurate and incomplete, which affects the software quality and online efficiency.

Method used

By integrating Jenkins server and MeterSphere platform, we realize interface automation testing, automate interface test cases, and send test results through DingTalk notifications to reduce the delay in manual intervention and information transmission.

Benefits of technology

It improves the communication efficiency between R&D and testing, improves the testing efficiency, ensures the accuracy and completeness of information transmission, and improves the quality of software and online efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119782182A_ABST
    Figure CN119782182A_ABST
Patent Text Reader

Abstract

The invention provides a method for achieving automatic interface testing by integrating a software CICD process with MeterSphere. The method comprises the following steps that S1, environment preparation is conducted, and a MeterSphere platform is built; s2, a Jenkins server and a MeterSphere platform are integrated, and the Jenkins server and the MeterSphere platform are S3, generating a pipeline script; s4, automatic testing is carried out; s5, sending a test result notification; through seamless integration of Jenkins and MeterSphere, research and development personnel do not need to manually transmit deployment information to test personnel, and the test personnel can obtain latest deployment and test feedback in time, so that delay of manual intervention and information transmission is reduced, and the overall communication efficiency is improved; the interface test is automatically executed, manual operation is reduced, and the test execution speed is increased; by integrating a test report and tool chain automation, the accuracy, transparency and traceability of a test result are ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method for integrating MeterSphere with a software CICD process to realize interface automation testing. Background Art

[0002] In the traditional software development process, R&D personnel, testers and other roles work independently, and integration and testing are not carried out until the project is nearing the end. Due to the lack of close collaboration and information flow between different links, problems are often accumulated and exposed at a later stage, making debugging and repair more difficult, and ultimately affecting the quality of the version and the efficiency of online release. In order to solve the above problems, many teams have introduced CICD processes; CI refers to continuous integration, which is a software development practice that requires developers to continuously integrate code into a shared code base. After each integration, the build and test process will be automatically executed to ensure that each code change works properly; CD refers to continuous delivery or continuous deployment, which is the full name of Continuous Delivery or Continuous Deployment. It is based on continuous integration to further ensure that the software is in a state of being deliverable at any time. Continuous delivery does not mean that each deployment is automatically pushed to the production environment, but emphasizes that the software version can be deployed at any time, and the deployment process undergoes a series of automated tests and quality assurance; Continuous deployment is a further extension of continuous delivery, which means that each code change will be automatically deployed to the production environment after passing the CI / CD pipeline; However, in the actual software development and testing process, even with the introduction of the CI / CD process, there are still many problems that need to be solved. In order to improve software quality and reduce failure rates, many development teams have introduced the open source tool MeterSphere to perform interface testing; it is a one-stop open source continuous testing platform that integrates test tracking, interface testing, UI testing, performance testing, team collaboration and DevOps integration and other functions; it is fully compatible with mainstream open source standards such as JMeter, Postman, Swagger, Selenium, etc., supports multiple languages ​​​​and frameworks, such as Java, Python, Node.js, etc., and can seamlessly integrate development tool chains such as GitLab, GitHub, Jenkins, etc.; in addition, it also provides a variety of test types, such as unit testing, interface testing, performance testing, etc., to meet the needs of different types of projects.

[0003] Although open source tools such as MeterSphere are used to automate interface testing, there are still some defects in the current software development process, which are mainly reflected in the following aspects: Low communication and collaboration efficiency: In the CI / CD process, communication between R&D personnel and testers still relies on manual notifications. R&D personnel notify testers to enter the testing phase, and then testers notify R&D personnel to enter the problem repair phase. Testers cannot quickly learn that the deployment has been completed, and R&D personnel cannot quickly learn about the quality problems of the deployed version, resulting in multiple communication time costs and reduced overall development efficiency. Low testing efficiency: In the entire CICD process, multiple rounds of testing are generally required, and the test execution time may be long. In the traditional software development process, R&D personnel communicate, testers select use cases and then execute them. There is too much human and manual intervention, and there are problems such as slow testing speed and delayed test feedback, which leads to low testing efficiency; 3. Inaccurate and incomplete information transmission: In the traditional software development process, the relationship between the software services, test cases, and test problems deployed is described manually through communication between R&D personnel and testers. There is a problem of inaccurate or incomplete description, which may lead to inaccurate execution of test case scenarios, incomplete problem repair, and other problems, which may affect software quality. Summary of the invention

[0004] The purpose of the present invention is to solve the shortcomings of the prior art and propose a method for integrating MeterSphere with the software CICD process to realize interface automation testing.

[0005] To achieve the above object, the present invention adopts the following technical solutions: A method for integrating MeterSphere with a software CICD process to implement interface automation testing includes the following steps: S1: Prepare the environment and build the MeterSphere platform; Prepare the environment in advance to ensure that the software and hardware configurations meet the requirements for building the MeterSphere platform; According to the official documentation of the MeterSphere platform, build and configure the MeterSphere platform, configure the Lightweight Directory Access Protocol LDAP service in the background of the MeterSphere platform to ensure that it can be connected with the company's existing LDAP service, and verify whether the LDAP integration is successful in the MeterSphere platform to ensure that users can log in smoothly; Testers log in to the MeterSphere platform using the company's LDAP account, and create projects, interface definitions, interface use cases, scenario use cases, etc. on the MeterSphere platform based on the company's projects and business conditions; Furthermore, after logging into the MeterSphere platform, obtain the corresponding generated API key in the user settings of the MeterSphere platform.

[0006] S2: Integrate Jenkins server with MeterSphere platform; The following sub-steps are included: S21: Install the plugin in the Jenkins server; The configuration personnel downloads the MeterSphereJenkins plug-in compatible with the MeterSphere platform version in the GitHub repository; The MeterSphere Jenkins plug-in is used to integrate the MeterSphere platform and the Jenkins server; On the management page of the Jenkins server, upload the downloaded MeterSphere Jenkins plug-in. The Jenkins server installs the plug-in. After the installation is complete, Jenkins prompts that the MeterSphere Jenkins plug-in has been successfully installed. S22: Configure and use the MeterSphere Jenkins plugin; After successful installation, configure the MeterSphere Jenkins plug-in in the main page of the Jenkins server, including configuring the MeterSphere platform address and API key; Specifically, fill in the MeterSphere platform address into the corresponding configuration field of the Jenkins server to ensure that the Jenkins server can access this address; fill in the API key generated in step S1 into the corresponding configuration field of the Jenkins server; after the configuration is completed, restart the service to ensure that the plug-in takes effect.

[0007] S3: Generate pipeline script; Create a new pipeline task in the Jenkins server, use the pipeline syntax generator provided by the Jenkins server, select the execution interface test associated with MeterSphere, and generate the pipeline script; The pipeline script includes building code, deployment environment, automated testing, etc. Add the generated pipeline script to the Jenkinsfile file of the software CICD pipeline.

[0008] Furthermore, every time the Jenkins server triggers a build task, the pipeline script will automatically call MeterSphere to perform interface automation testing to ensure the correctness and functionality of the interface.

[0009] S4: Perform automated testing; The Jenkins server triggers the CICD pipeline of the project, performs tasks such as building, scanning, uploading, and deploying in the CICD pipeline, detects the deployment status, and after confirming that the deployment is successful, automatically calls the API of the MeterSphere platform to execute the interface test cases written by the tester; Furthermore, after each execution of the CICD pipeline, there is a time difference in the deployment of the k8s service. MeterSphere cannot be called directly for execution after deployment. Python scripts are used to monitor the status of the K8s service. After ensuring that all services are fully started, MeterSphere is called to execute the interface test case. S5: Send test result notification; After the entire CICD pipeline is executed, a test report is generated, which contains information such as the execution status, execution time, logs, and test data of each interface test case; Through the Jenkins log output link, click the report link in the Jenkins log to jump directly to the MeterSphere page to view the detailed test report; After the CICD process is completed, the test results will be sent to the project team's DingTalk group via DingTalk notification, so that team members can quickly understand the test results and take necessary follow-up actions.

[0010] Compared with the prior art, the present invention has the following beneficial effects: The method provided by the present invention seamlessly integrates Jenkins with MeterSphere, so that R&D personnel do not need to manually convey deployment information to testers, and testers can also obtain the latest deployment and test feedback in a timely manner, thereby reducing manual intervention and information transmission delays and improving overall communication efficiency; By integrating MeterSphere, testers can predefine interface test cases and combine them with CI / CD pipelines to automatically perform interface tests after each deployment. Tests can be automatically triggered after deployment is completed, avoiding human delays and interventions and improving overall testing efficiency. Compared with traditional manual selection and execution of test cases, automated testing greatly improves the speed and coverage of testing. After each automated test is completed, MeterSphere generates a detailed test report containing the execution status, execution time, logs, test data and other information of each interface use case. These reports not only provide accurate test results, but can also be viewed directly in the Jenkins log, avoiding the problem of information loss or inaccuracy in manual communication. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] Figure 1 This is a flowchart of the steps of a method for integrating MeterSphere with a software CICD process to implement automated interface testing in the present invention. DETAILED DESCRIPTION

[0012] In order to provide a further understanding of the purpose, structure, features, and functions of the present invention, the following detailed description is given in conjunction with the embodiments.

[0013] like Figure 1 As shown, a method for integrating MeterSphere with software CICD process to realize interface automation testing includes the following steps: S1: Prepare the environment and build the MeterSphere platform; Prepare the environment in advance to ensure that the software and hardware configurations meet the requirements for building the MeterSphere platform; According to the official documentation of the MeterSphere platform, build and configure the MeterSphere platform, configure the Lightweight Directory Access Protocol LDAP service in the background of the MeterSphere platform to ensure that it can be connected with the company's existing LDAP service, and verify whether the LDAP integration is successful in the MeterSphere platform to ensure that users can log in smoothly; Testers log in to the MeterSphere platform using the company's LDAP account, and create projects, interface definitions, interface use cases, scenario use cases, etc. on the MeterSphere platform based on the company's projects and business conditions; Furthermore, after logging into the MeterSphere platform, obtain the corresponding generated API key in the user settings of the MeterSphere platform.

[0014] S2: Integrate Jenkins server with MeterSphere platform; The following sub-steps are included: S21: Install the plugin in the Jenkins server; The configuration personnel downloads the MeterSphereJenkins plug-in compatible with the MeterSphere platform version in the GitHub repository; The MeterSphere Jenkins plug-in is used to integrate the MeterSphere platform and the Jenkins server; On the management page of the Jenkins server, upload the downloaded MeterSphere Jenkins plug-in. The Jenkins server installs the plug-in. After the installation is complete, Jenkins prompts that the MeterSphere Jenkins plug-in has been successfully installed. S22: Configure and use the MeterSphere Jenkins plugin; After successful installation, configure the MeterSphere Jenkins plug-in in the main page of the Jenkins server, including configuring the MeterSphere platform address and API key; Specifically, fill in the MeterSphere platform address into the corresponding configuration field of the Jenkins server to ensure that the Jenkins server can access this address; fill in the API key generated in step S1 into the corresponding configuration field of the Jenkins server; after the configuration is completed, restart the service to ensure that the plug-in takes effect.

[0015] By configuring the MeterSphere Jenkins plug-in, Jenkins and MeterSphere are integrated so that Jenkins and MeterSphere can share the same test data, and Jenkins can call MeterSphere through the API to execute interface test cases.

[0016] S3: Generate pipeline script; Create a new pipeline task in the Jenkins server, use the pipeline syntax generator provided by the Jenkins server, select the execution interface test associated with MeterSphere, and generate the pipeline script; The pipeline script includes building code, deployment environment, automated testing, etc. Add the generated pipeline script to the Jenkinsfile file of the software CICD pipeline.

[0017] Furthermore, every time the Jenkins server triggers a build task, the pipeline script will automatically call MeterSphere to perform interface automation testing to ensure the correctness and functionality of the interface.

[0018] S4: Perform automated testing; The Jenkins server triggers the CICD pipeline of the project, performs tasks such as building, scanning, uploading, and deploying in the CICD pipeline, detects the deployment status, and after confirming that the deployment is successful, automatically calls the API of the MeterSphere platform to execute the interface test cases written by the tester; Furthermore, after each execution of the CICD pipeline, there is a time difference in the deployment of the k8s service. MeterSphere cannot be called directly for execution after deployment. Python scripts are used to monitor the status of the K8s service. After ensuring that all services are fully started, MeterSphere is called to execute the interface test case. Monitor the service status through Python scripts to ensure that all services are running healthily before triggering interface testing, avoiding invalid test results due to incomplete service startup and improving the reliability and accuracy of the test.

[0019] The Python script can continuously monitor the service status in K8s and automatically determine when to start interface testing. This automated monitoring and decision-making mechanism reduces manual intervention and improves the overall efficiency of the CI / CD pipeline; avoids testing errors caused by human errors and reduces invalid waiting time.

[0020] S5: Send test result notification; After the entire CICD pipeline is executed, a test report is generated, which contains information such as the execution status, execution time, logs, and test data of each interface test case; Through the Jenkins log output link, click the report link in the Jenkins log to jump directly to the MeterSphere page to view the detailed test report; After the CICD process is completed, the test results will be sent to the project team's DingTalk group via DingTalk notification, so that team members can quickly understand the test results and take necessary follow-up actions.

[0021] The generated test report contains the execution status, logs and data of each interface. Developers and testers can track the test process and results at any time, identify the specific reasons for test failure, and improve transparency and traceability. Through instant notification tools such as DingTalk, project teams can understand test results in the shortest time possible, no longer relying on manual updates or reviewing reports, ensuring no delays, quick responses, and reducing the feedback cycle of testing and development. This instant notification mechanism promotes rapid communication and collaboration among teams.

[0022] The present invention has been described by the above-mentioned relevant embodiments, however, the above-mentioned embodiments are only examples for implementing the present invention. It must be pointed out that the disclosed embodiments do not limit the scope of the present invention. On the contrary, changes and modifications made without departing from the spirit and scope of the present invention are all within the scope of patent protection of the present invention.

Claims

1. A method for implementing interface automation testing by integrating MeterSphere with software CICD process, characterized in that: The following steps are involved: S1: Prepare the environment and build the MeterSphere platform; Prepare the environment in advance to ensure that the software and hardware configurations meet the requirements for building the MeterSphere platform, and then build the MeterSphere platform; S2: Integrate Jenkins server with MeterSphere platform; The following sub-steps are included: S21: Install the plugin in the Jenkins server; S22: Configure and use the MeterSphere Jenkins plugin; S3: Generate pipeline script; Create a new pipeline task in the Jenkins server, use the pipeline syntax generator provided by the Jenkins server, select the execution interface test associated with MeterSphere, and generate the pipeline script; Add the generated pipeline script to the Jenkinsfile file of the software CICD pipeline; S4: Perform automated testing; The Jenkins server triggers the CICD pipeline of the project, executes the building, scanning, uploading, and deployment tasks in the CICD pipeline, detects the deployment status, and after confirming that the deployment is successful, automatically calls the API of the MeterSphere platform to execute the interface test cases written by the tester; S5: Send test result notification; After executing the entire CICD pipeline, generate a test report. Through the Jenkins log output link, click the report link in the Jenkins log to jump directly to the MeterSphere page to view the detailed test report. After the CICD process is completed, the test results will be sent to the project team's DingTalk group via DingTalk notification, so that team members can quickly understand the test results and take necessary follow-up actions.

2. The method for implementing interface automation testing by integrating MeterSphere with the software CICD process as claimed in claim 1, characterized in that: In step S1, according to the official documentation of the MeterSphere platform, build and configure the MeterSphere platform, configure the Lightweight Directory Access Protocol LDAP service in the background of the MeterSphere platform to ensure that it can be connected with the company's existing LDAP service, and verify whether the LDAP integration is successful in the MeterSphere platform to ensure that users can log in smoothly; Testers log in to the MeterSphere platform using the company's LDAP account, and create projects, interface definitions, interface use cases, scenario use cases, etc. on the MeterSphere platform based on the company's projects and business conditions; Furthermore, after logging into the MeterSphere platform, obtain the corresponding generated API key in the user settings of the MeterSphere platform.

3. The method for implementing interface automation testing by integrating MeterSphere with the software CICD process as claimed in claim 1, characterized in that: The specific contents of step S2 are as follows: S21: Install the plugin in the Jenkins server; The configuration personnel downloads the MeterSphereJenkins plug-in compatible with the MeterSphere platform version in the GitHub repository; The MeterSphere Jenkins plug-in is used to integrate the MeterSphere platform and the Jenkins server; On the management page of the Jenkins server, upload the downloaded MeterSphere Jenkins plug-in. The Jenkins server installs the plug-in. After the installation is complete, Jenkins prompts that the MeterSphere Jenkins plug-in has been successfully installed. S22: Configure and use the MeterSphere Jenkins plugin; After successful installation, configure the MeterSphere Jenkins plug-in in the main page of the Jenkins server, including configuring the MeterSphere platform address and API key; Specifically, fill in the MeterSphere platform address into the corresponding configuration field of the Jenkins server to ensure that the Jenkins server can access this address; fill in the API key generated in step S1 into the corresponding configuration field of the Jenkins server; after the configuration is completed, restart the service to ensure that the plug-in takes effect.

4. The method for implementing interface automation testing by integrating MeterSphere with the software CICD process as claimed in claim 1, characterized in that: Every time the Jenkins server triggers a build task, the pipeline script will automatically call MeterSphere to perform interface automation testing to ensure the correctness and functionality of the interface.

5. The method for implementing interface automation testing by integrating MeterSphere with the software CICD process as claimed in claim 1, characterized in that: Furthermore, after each execution of the CICD pipeline, there is a time difference in the deployment of the k8s service. MeterSphere cannot be called directly for execution after deployment. Python scripts are used to monitor the status of the K8s service. After ensuring that all services are fully started, MeterSphere is called to execute the interface test cases.

Citation Information

Patent Citations

  • Configuration-based interface automatic test system and method

    CN118295932A

Cited By

  • Method and system for testing artificial intelligence system

    CN121880210A