A container-based automated continuous testing method and device

Through the automated continuous testing method based on containerization, the container orchestration engine cluster and cluster management control module are used to solve the problem of uneven virtual machine resource allocation and test crash caused by Jenkins failure, and efficient resource utilization and intelligent analysis are achieved, which significantly improves the Test efficiency.

CN113986714BActive Publication Date: 2024-12-10JINAN INSPUR DATA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111097122.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-18
Publication Date
2024-12-10
Estimated Expiration
2041-09-18

AI Technical Summary

Technical Problem

In the prior art, the resource allocation of virtual machines is uneven when they are test machines, resulting in task queuing and resource waste. At the same time, Jenkins failure will lead to continuous automation testing crashes, and the test results analysis time is long.

Method used

Adopt containerization-based automated continuous testing methods, using container orchestration engine cluster and cluster management control modules to dynamically allocate resources, realize high availability and resource allocation on demand, improve testing efficiency through the creation and deletion of container groups, and combine intelligent strategy analysis Test results.

Benefits of technology

It improves the stability and resource utilization of automated continuous testing, simplifies test results analysis, and significantly improves test efficiency and work efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113986714B_ABST
    Figure CN113986714B_ABST
Patent Text Reader

Abstract

The present invention provides an automated continuous testing method and device based on containerization, the method comprising the following steps: deploying a container orchestration engine cluster and creating a container group; pulling the image of a cluster management control module in the container orchestration engine cluster, creating a cluster management control module in the container group of the master node, and configuring the interface of the cluster management control module; calling the interface of the cluster management control module for task configuration, initiating a request to build an automated continuous testing task; after receiving the task request, creating an execution test machine in the container group of the slave node according to the configuration information of the task, registering the created execution test machine to the cluster management control module; and updating the automated test script to the execution test machine; executing the automated test script for testing; after the test is completed, the execution test machine is deregistered, and the container group where the execution test machine is located is deleted at the same time. Deleting after use improves the utilization rate of resources and greatly improves the efficiency of automated continuous testing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of automated continuous testing technology using containerization technology, and in particular to an automated continuous testing method and device based on containerization. Background Art

[0002] k8s stands for kubernetes. Kubernetes is a portable container orchestration management tool created for container services. It supports automated deployment, large-scale scalability, and application container management. When deploying an application in a production environment, you usually need to deploy multiple instances of the application to load balance application requests.

[0003] Before the container technology, people used virtual machines for development. For developers and operation and maintenance personnel, virtual machines have the disadvantages of slow startup, large space occupation, and difficulty in migration. Containerization technology came into being. It does not need to virtualize the entire operating system, but only needs to virtualize a small-scale environment. It also starts very quickly and consumes almost no additional system resources except for running the applications in it. Jenkins is an open source software project. It is a continuous integration tool developed based on Java. It is used to monitor continuous and repetitive work. It aims to provide an open and easy-to-use software platform to make continuous integration of software possible.

[0004] With the development of system business, the number of automated test scripts at all levels continues to increase, and the requirements for test execution machines are getting higher and higher. At present, the method is to manage personal work computers through Jenkins or create virtual machines to act as test machines. Using personal work computers as test machines will have a certain impact on the results of automated continuous execution due to the differences of personal work computers. When using virtual machines as test machines, resource allocation is uneven, and some virtual machines are queued for execution tasks, while some virtual machines are idle. In addition, when Jenkins fails, the entire automated continuous testing task will also crash. When the automated task is completed, it takes a long time to analyze the test results. Summary of the invention

[0005] When using virtual machines as test machines, resource allocation is uneven. Some virtual machines are queued for task execution, while others are idle. In addition, when Jenkins fails, the entire automated continuous testing task crashes. After the automated task is completed, the analysis of the test results takes a long time. The present invention provides an automated continuous testing method and device based on containerization.

[0006] The technical solution of the present invention is:

[0007] On the one hand, the technical solution of the present invention provides an automated continuous testing method based on containerization, based on a container orchestration engine cluster, the cluster includes a master node and several slave nodes, and the method includes the following steps:

[0008] Deploy a container orchestration engine cluster and create a container group;

[0009] Pull the image of the cluster management control module in the container orchestration engine cluster, create the cluster management control module in the container group of the master node, and configure the interface of the cluster management control module;

[0010] Call the interface of the cluster management control module to configure tasks and initiate a task request to build an automated continuous testing task;

[0011] After receiving the task request, create an execution test machine in the container group of the slave node according to the configuration information of the task, register the created execution test machine to the cluster management control module; and update the automated test script to the execution test machine;

[0012] Execute automated test scripts for testing;

[0013] After the test is completed, the test execution machine will be logged out and the container group where the test execution machine is located will be deleted.

[0014] It can use the high availability characteristics of the cluster management control module of the container orchestration engine cluster to improve the stability of automated continuous testing. Resources are allocated on demand and deleted when used up to improve resource utilization, greatly improving the efficiency of automated continuous testing.

[0015] Furthermore, the steps of deploying a container orchestration engine cluster and creating a container group include:

[0016] Select a node in the cluster to create a container group;

[0017] Create images according to the automated test type and store them in the image repository;

[0018] Deploy cluster monitoring threads and task monitoring threads.

[0019] The created image is stored in the image warehouse, so that it can be directly pulled from the image warehouse for creation when it is convenient to use, saving time and improving efficiency.

[0020] Further, the steps of pulling the image of the cluster management control module in the container orchestration engine cluster, creating the cluster management control module in the container group of the master node, and configuring the interface of the cluster management control module include:

[0021] Pull the image of the cluster management control module from the cluster's image repository according to the automated test type;

[0022] Create a cluster management control module in the container group of the master node;

[0023] Set up the API interface for accessing the cluster management control module and the monitoring interface for monitoring whether the execution test machine is normal.

[0024] The access interface needs to be opened to ensure that the cluster management control module can be accessed normally. The monitoring interface of the JNLP agent protocol needs to be opened to monitor whether the created execution test machine has been started.

[0025] Further, calling the interface of the cluster management control module to configure the task, the steps of initiating the task request for building an automated continuous testing task include:

[0026] Calling the API interface of the cluster management control module to configure task information; wherein the configured task information includes label information;

[0027] Initiate a task request to build automated continuous testing;

[0028] After receiving the task request, the steps of creating an execution test machine in the container group of the slave node according to the configuration information of the task, registering the created execution test machine with the cluster management control module, and updating the automated test script to the execution test machine include:

[0029] After receiving the task request, create an execution test machine in the container group of the slave node according to the label information of the task;

[0030] Register the created execution test machine to the cluster management control module;

[0031] Update the automated test scripts to the test execution machine.

[0032] The cluster will dynamically allocate test execution machines to idle nodes based on the usage of each resource, thereby improving resource utilization.

[0033] Furthermore, after the test is completed, the test execution machine is deregistered and the container group where the test execution machine is located is deleted, including:

[0034] Trigger the task monitoring thread to monitor the execution of tasks in real time;

[0035] When the task execution is completed, the execution test machine on which the task execution is completed is logged out, and the container group where the execution test machine is located is deleted.

[0036] According to the build task, the test execution machine is automatically configured and created. After the task is completed, the test execution machine is automatically deregistered and released. This process ensures the consistency of the test execution machine nodes and solves the impact caused by the differences between the test execution machines.

[0037] Furthermore, the method further comprises:

[0038] Store the test results persistently;

[0039] Read the failed log information in the test results to analyze the test results;

[0040] When a timeout error occurs, extract the test case information, call the cluster management control module interface to configure the task, and initiate a task request to build an automated continuous test;

[0041] After receiving the task request, create an execution test machine in the container group of the slave node according to the configuration information of the task, register the created execution test machine to the cluster management control module; re-execute the test case;

[0042] When there is a data verification error, the error log information will be uploaded;

[0043] When there is a code logic error, the error log information will be uploaded.

[0044] Adding intelligent strategies for test analysis improves the efficiency of test result analysis and greatly improves the efficiency of automated continuous testing.

[0045] Furthermore, the method further comprises:

[0046] The cluster management control module monitors in real time whether the execution test machine is started through the monitoring interface;

[0047] When the test machine is not started at the set time, the cluster management control module triggers the mailbox to send an email to the administrator.

[0048] In order to improve resource utilization, after creating the test execution machine, the test execution machine needs to be registered with the cluster management control module to facilitate the cluster management control module to issue tasks and monitor the startup status of the test execution machine, send emails to notify management personnel, and conduct timed troubleshooting of test execution machine startup failures.

[0049] Furthermore, the method further comprises:

[0050] Trigger the cluster monitoring thread to monitor the status of the cluster management control module and the test execution machine in the cluster in real time;

[0051] When an abnormality is detected in the cluster management control module, the image of the cluster management control module is pulled from the container orchestration engine cluster, and another cluster management control module is created in the container group where the abnormal cluster management control module is located;

[0052] Synchronize the functions and information of the abnormal cluster management and control module to the newly created cluster management and control module;

[0053] When an abnormality of the test execution machine is detected, the test execution machine is recreated in the container group of the slave node according to the configuration information of the test execution machine task, and the created test execution machine is registered with the cluster management control module.

[0054] By taking advantage of the high availability of the cluster and dynamic resource scaling configuration, we can ensure that there is no interference from external factors, improve the stability of automated continuous testing and resource utilization, and the intelligent analysis of test results greatly simplifies the testing workload and greatly improves work efficiency.

[0055] On the other hand, the technical solution of the present invention also provides an automated continuous testing device based on containerization, based on a container orchestration engine cluster, the cluster includes a master node and a number of slave nodes, the device includes a cluster deployment module, a first generation module, a second generation module, a task execution module, and a recovery module;

[0056] Cluster deployment module, used to deploy container orchestration engine clusters and create container groups;

[0057] The first generation module is used to pull the image of the cluster management control module in the container orchestration engine cluster, create the cluster management control module in the container group of the master node, and configure the interface of the cluster management control module; the cluster management control module is used to call the interface to configure the task and initiate the task request for building an automated continuous testing task;

[0058] The second generation module is used to create an execution test machine in the container group of the slave node according to the configuration information of the task after receiving the task request, register the created execution test machine with the cluster management control module; and update the automated test script to the execution test machine;

[0059] Task execution module, used to execute automated test scripts for testing;

[0060] The recycling module is used to trigger the task monitoring thread to monitor the execution of the task in real time; when the task is completed, the execution test machine that has completed the task will be deregistered, and the container group where the execution test machine is located will be deleted.

[0061] It can use the high availability characteristics of the cluster management control module of the container orchestration engine cluster to improve the stability of automated continuous testing. Resources are allocated on demand and deleted when used up to improve resource utilization, greatly improving the efficiency of automated continuous testing.

[0062] Furthermore, the cluster deployment module includes a container group creation unit, an image creation unit, and a monitoring thread deployment unit;

[0063] The container group creation unit is used to select nodes in the cluster to create a container group;

[0064] The image creation unit is used to create images according to the automated test type and store them in the image repository;

[0065] The monitoring thread deployment unit is used to deploy cluster monitoring threads and task monitoring threads.

[0066] The created image is stored in the image warehouse, so that it can be directly pulled from the image warehouse for creation when it is convenient to use, saving time and improving efficiency.

[0067] Further, the first generation module includes an image acquisition unit, a module creation unit, and an interface setting unit;

[0068] An image acquisition unit, used to pull the image of the cluster management control module from the cluster's image repository according to the automated test type;

[0069] A module creation unit, used to create a cluster management control module in the container group of the master node;

[0070] The interface setting unit is used to set the API interface for access of the cluster management control module and the monitoring interface for monitoring whether the execution test machine is normal.

[0071] Furthermore, the cluster management control module is used to call the API interface to configure task information; wherein the configured task information includes label information; initiate a task request to build an automated continuous testing task;

[0072] The second generation module includes an execution test machine creation unit, a registration unit, and an update unit;

[0073] An execution test machine creation unit, used for creating an execution test machine in a container group of a slave node according to the label information of the task after receiving the task request;

[0074] A registration unit, used to register the created execution test machine to the cluster management control module;

[0075] The update unit is used to update the automated test scripts to the test execution machine.

[0076] Furthermore, the device also includes a persistent storage module and a test result analysis module;

[0077] Persistent storage module, used to store test results persistently;

[0078] The test result analysis module is used to read the failed log information in the test results to analyze the test results; when it is a timeout waiting error, extract the test case information, call the interface of the cluster management control module to configure the task, initiate a request to build an automated continuous testing task, and trigger the second generation module to generate an execution test machine to execute the test case; when it is a data verification error, upload the error log information; when it is a code logic error, upload the error log information.

[0079] Furthermore, the cluster management control module is used to monitor in real time through a monitoring interface whether the execution test machine is started; when the execution test machine is not started at the set time, the cluster management control module triggers a mailbox to send an email to the management personnel.

[0080] Furthermore, the device also includes a monitoring processing module for triggering a cluster monitoring thread to monitor the status of a cluster management control module and an execution test machine in the cluster in real time;

[0081] Specifically, when an abnormality is detected in the cluster management and control module, the first generation module is triggered to pull the image of the cluster management and control module in the container orchestration engine cluster, and create another cluster management and control module in the container group where the abnormal cluster management and control module is located; the function and information of the abnormal cluster management and control module are synchronized to the newly created cluster management and control module; when an abnormality is detected in the execution test machine, the second generation module is triggered to recreate the execution test machine in the container group of the slave node according to the configuration information of the execution test machine task, and register the created execution test machine with the cluster management and control module.

[0082] It can be seen from the above technical solutions that the present invention has the following advantages: utilizing the high availability of the cluster management control module, dynamic resource scaling configuration guarantee, ensuring no interference from external factors, improving the stability of automated continuous testing and resource utilization, and intelligent analysis of test results greatly simplifies the testing workload and greatly improves work efficiency.

[0083] In addition, the invention has a reliable design principle, a simple structure and a very broad application prospect.

[0084] It can be seen that compared with the prior art, the present invention has outstanding substantive features and significant progress, and the beneficial effects of its implementation are also obvious. BRIEF DESCRIPTION OF THE DRAWINGS

[0085] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0086] Figure 1 is a schematic flow chart of a method according to an embodiment of the present invention.

[0087] Figure 2 is a schematic flow chart of a method according to another embodiment of the present invention.

[0088] Figure 3 is a schematic block diagram of an apparatus according to an embodiment of the present invention. DETAILED DESCRIPTION

[0089] In order to enable those skilled in the art to better understand the technical solutions in the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0090] like Figure 1 As shown, an embodiment of the present invention provides an automated continuous testing method based on containerization, based on a container orchestration engine cluster, the cluster includes a master node and several slave nodes, and the method includes the following steps:

[0091] S1: Deploy a container orchestration engine cluster and create a container group;

[0092] In this step, select the appropriate node to create a container group pod; you also need to configure the image repository;

[0093] S2: Pull the image of the cluster management control module in the container orchestration engine cluster, create the cluster management control module in the container group of the master node, and configure the interface of the cluster management control module;

[0094] In this step, we create the cluster management control module Jenkins Master by pulling the image, and set up JenkinsMaster to provide external user access and internal load balancing function.

[0095] S3: Call the interface of the cluster management control module to configure the task and initiate a task request to build an automated continuous testing task;

[0096] In this step, the task is configured through the interface, and then the legal task request, that is, which execution test machine each task needs to execute has been configured during the task configuration to achieve load balancing;

[0097] S4: after receiving the task request, create an execution test machine in the container group of the slave node according to the configuration information of the task, register the created execution test machine with the cluster management control module; and update the automated test script to the execution test machine;

[0098] In this step, after receiving the request, we first need to determine the resource utilization of each node, and then create an execution test machine using an idle node;

[0099] S5: Execute the automated test script for testing; based on the code updated in step S4, execute the automated test script;

[0100] S6: After the test is completed, the test execution machine will be deregistered and the container group where the test execution machine is located will be deleted. This solves the problem of large resource overhead and inconsistent configuration of the test execution machine, and improves the stability of automated continuous testing and the efficiency of test result analysis.

[0101] It can use the high availability characteristics of the cluster management control module of the container orchestration engine cluster to improve the stability of automated continuous testing. Resources are allocated on demand and deleted when used up to improve resource utilization, greatly improving the efficiency of automated continuous testing.

[0102] In some embodiments, in step S1, the steps of deploying a container orchestration engine cluster and creating a container group include:

[0103] S11: Select a node in the cluster to create a container group pod;

[0104] S12: Create an image according to the automated test type and store it in the image warehouse; in this step, the automated test types include unit automated testing, integrated automated testing, and UI automated testing; different images are created for storage according to different types;

[0105] S13: deploy cluster monitoring thread and task monitoring thread; in fact, this step can also be deployed after the cluster management control module is created;

[0106] The created image is stored in the image warehouse, so that it can be directly pulled from the image warehouse for creation when it is convenient to use, saving time and improving efficiency.

[0107] In some embodiments, in step S2, the steps of pulling the image of the cluster management control module in the container orchestration engine cluster, creating the cluster management control module in the container group of the master node, and configuring the interface of the cluster management control module include:

[0108] S21: Pull the image of the cluster management control module in the image warehouse of the cluster according to the automated test type; pull the image of the jenkins master in the image warehouse of K8S according to the automated test type (unit automated test, integrated automated test, UI automated test);

[0109] S22: Create a cluster management control module jenkins master in the container group of the master node;

[0110] S23: Set the API interface for access of the cluster management control module and the monitoring interface for monitoring whether the slave machine executing the test is normal. Open the Jenkins Web access API interface to ensure that Jenkins can access it normally. Open the TCP port of the JNLP agent protocol as a monitoring interface to let the Jenkins master know whether the slave has been started.

[0111] In some embodiments, in step S3, calling the interface of the cluster management control module to configure the task, the step of initiating the construction of the automated continuous testing task request includes:

[0112] S31: calling an API interface for configuring a cluster management control module to configure task information; wherein the configured task information includes tag information;

[0113] S32: Initiate a task request for building an automated continuous testing task;

[0114] The corresponding step S4 specifically includes:

[0115] S41: After receiving the task request, create an execution test machine in the container group of the slave node according to the label information of the task; in this step, after receiving the task, first determine the resource status of each slave node in the cluster, and according to the resource status of the slave node, allocate idle slave nodes to create the execution test machine.

[0116] S42: Register the created execution test machine to the cluster management control module; establish the connection between the Jenkins master and the slave. This process ensures the consistency of the cooperation of the slave execution test machine;

[0117] S43: Update the automated test script to the test execution machine and wait for the automated test to be executed.

[0118] The cluster will dynamically allocate test execution machines to idle nodes based on the usage of each resource, thereby improving resource utilization.

[0119] In some embodiments, in step S6, after the test is completed, the step of deregistering the test execution machine and deleting the container group where the test execution machine is located includes:

[0120] S61: triggering the task monitoring thread to monitor the execution status of the task in real time;

[0121] S62: When the task execution is completed, the test execution machine that has completed the task execution is deregistered, and the container group where the test execution machine is located is deleted.

[0122] According to the build task, the test execution machine is automatically configured and created. After the task is completed, the test execution machine is automatically deregistered and released. This process ensures the consistency of the test execution machine nodes and solves the impact caused by the differences between the test execution machines.

[0123] like Figure 2 As shown, in some embodiments, after step S5, the following steps are further included:

[0124] S561: Persistently store the test results to provide support for subsequent analysis and tracking of test results;

[0125] S562: Read the failed log information in the test result to analyze the test result;

[0126] In step S562, the test results are analyzed according to the analysis strategy rules, and the failure LOG information of the failed and error test cases in the test results is read. Currently, three types of errors are defined according to business characteristics. Customized strategy rules can be added according to business specifics later; specifically, the following are included:

[0127] When a timeout error occurs, extract the test class, test method, test data and other information of the test case, call the interface of the cluster management control module to configure the task, and initiate a request to build an automated continuous test task; that is, recreate the execution test machine for the failed test case for retesting. When creating the execution test machine, it is also necessary to determine the resource utilization of the cluster nodes and create it on an idle node;

[0128] When there is a data verification error, the error log information will be uploaded;

[0129] When there is a code logic error, the error log information will be uploaded to facilitate the responsible person to record the corresponding developer.

[0130] Adding intelligent strategies for test analysis improves the efficiency of test result analysis and greatly improves the efficiency of automated continuous testing.

[0131] It should be noted that the embodiment of the present invention also includes: the cluster management control module monitors in real time whether the execution test machine is started through the monitoring interface; when the execution test machine is not started at the set time, the cluster management control module triggers the mailbox to send an email to the management personnel.

[0132] In order to improve resource utilization, after creating the test execution machine, the test execution machine needs to be registered with the cluster management control module to facilitate the cluster management control module to issue tasks and monitor the startup status of the test execution machine, send emails to notify management personnel, and conduct timed troubleshooting of test execution machine startup failures.

[0133] The embodiment of the present invention also includes: triggering a cluster monitoring thread to monitor the status of a cluster management control module and an execution test machine in the cluster in real time;

[0134] When an abnormality is detected in the cluster management control module, the image of the cluster management control module is pulled from the container orchestration engine cluster, and another cluster management control module is created in the container group where the abnormal cluster management control module is located;

[0135] Synchronize the functions and information of the abnormal cluster management and control module to the newly created cluster management and control module;

[0136] When an abnormality of the test execution machine is detected, the test execution machine is recreated in the container group of the slave node according to the configuration information of the test execution machine task, and the created test execution machine is registered with the cluster management control module.

[0137] By taking advantage of the high availability of the cluster and dynamic resource scaling configuration, we can ensure that there is no interference from external factors, improve the stability of automated continuous testing and resource utilization, and the intelligent analysis of test results greatly simplifies the testing workload and greatly improves work efficiency.

[0138] like Figure 3 As shown, an embodiment of the present invention further provides an automated continuous testing device based on containerization, based on a container orchestration engine cluster, the cluster includes a master node and a plurality of slave nodes, the device includes a cluster deployment module, a first generation module, a second generation module, a task execution module, and a recovery module;

[0139] Cluster deployment module, used to deploy container orchestration engine clusters and create container groups;

[0140] The first generation module is used to pull the image of the cluster management control module in the container orchestration engine cluster, create the cluster management control module in the container group of the master node, and configure the interface of the cluster management control module; the cluster management control module is used to call the interface to configure the task and initiate the task request for building an automated continuous testing task;

[0141] The second generation module is used to create an execution test machine in the container group of the slave node according to the configuration information of the task after receiving the task request, register the created execution test machine with the cluster management control module; and update the automated test script to the execution test machine;

[0142] Task execution module, used to execute automated test scripts for testing;

[0143] The recycling module is used to trigger the task monitoring thread to monitor the execution of the task in real time; when the task is completed, the execution test machine that has completed the task will be deregistered, and the container group where the execution test machine is located will be deleted.

[0144] It can use the high availability characteristics of the cluster management control module of the container orchestration engine cluster to improve the stability of automated continuous testing. Resources are allocated on demand and deleted when used up to improve resource utilization, greatly improving the efficiency of automated continuous testing.

[0145] In some embodiments, the cluster deployment module includes a container group creation unit, an image creation unit, and a monitoring thread deployment unit;

[0146] The container group creation unit is used to select nodes in the cluster to create a container group;

[0147] The image creation unit is used to create images according to the automated test type and store them in the image repository;

[0148] The monitoring thread deployment unit is used to deploy cluster monitoring threads and task monitoring threads.

[0149] The created image is stored in the image warehouse, so that it can be directly pulled from the image warehouse for creation when it is convenient to use, saving time and improving efficiency.

[0150] In some embodiments, the first generation module includes an image acquisition unit, a module creation unit, and an interface setting unit;

[0151] An image acquisition unit, used to pull the image of the cluster management control module from the cluster's image repository according to the automated test type;

[0152] A module creation unit, used to create a cluster management control module in the container group of the master node;

[0153] The interface setting unit is used to set the API interface for access of the cluster management control module and the monitoring interface for monitoring whether the execution test machine is normal.

[0154] The book title is needed, the cluster management control module is used to call the API interface to configure task information; the configured task information includes label information; initiate the task request for building automated continuous testing;

[0155] The second generation module includes an execution test machine creation unit, a registration unit, and an update unit;

[0156] An execution test machine creation unit, used for creating an execution test machine in a container group of a slave node according to the label information of the task after receiving the task request;

[0157] A registration unit, used to register the created execution test machine to the cluster management control module;

[0158] The update unit is used to update the automated test scripts to the test execution machine.

[0159] In some embodiments, the apparatus further includes a persistent storage module and a test result analysis module;

[0160] Persistent storage module, used to store test results persistently;

[0161] The test result analysis module is used to read the failed log information in the test results to analyze the test results; when it is a timeout waiting error, extract the test case information, call the interface of the cluster management control module to configure the task, initiate a request to build an automated continuous testing task, and trigger the second generation module to generate an execution test machine to execute the test case; when it is a data verification error, upload the error log information; when it is a code logic error, upload the error log information.

[0162] In addition, in some embodiments of the present invention, the cluster management control module is used to monitor in real time whether the execution test machine is started through a monitoring interface; when the execution test machine is not started at the set time, the cluster management control module triggers a mailbox to send an email to the administrator.

[0163] The device also includes a monitoring processing module for triggering a cluster monitoring thread to monitor the status of a cluster management control module and an execution test machine in the cluster in real time;

[0164] Specifically, when an abnormality is detected in the cluster management and control module, the first generation module is triggered to pull the image of the cluster management and control module in the container orchestration engine cluster, and create another cluster management and control module in the container group where the abnormal cluster management and control module is located; the function and information of the abnormal cluster management and control module are synchronized to the newly created cluster management and control module; when an abnormality is detected in the execution test machine, the second generation module is triggered to recreate the execution test machine in the container group of the slave node according to the configuration information of the execution test machine task, and register the created execution test machine with the cluster management and control module.

[0165] Although the present invention has been described in detail by referring to the accompanying drawings and in combination with the preferred embodiments, the present invention is not limited thereto. Without departing from the spirit and essence of the present invention, a person of ordinary skill in the art may make various equivalent modifications or substitutions to the embodiments of the present invention, and these modifications or substitutions shall be within the scope of the present invention. Any person of ordinary skill in the art may easily think of changes or substitutions within the technical scope disclosed by the present invention, and these shall be within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be subject to the scope of protection of the claims.

Claims

1. An automated continuous testing method based on containerization, It is characterized in that Based on a container orchestration engine cluster, the cluster includes a master node and several slave nodes, and the method includes the following steps: Deploy a container orchestration engine cluster and create a container group; Pull the image of the cluster management control module in the container orchestration engine cluster, create the cluster management control module in the container group of the master node, and configure the interface of the cluster management control module; Call the interface of the cluster management control module to configure tasks and initiate a task request to build an automated continuous testing task; After receiving the task request, create an execution test machine in the container group of the slave node according to the configuration information of the task, and register the created execution test machine with the cluster management control module; And update the automated test script to the test execution machine; Execute automated test scripts for testing; After the test is completed, the test execution machine will be logged out and the container group where the test execution machine is located will be deleted; The steps of pulling the image of the cluster management control module in the container orchestration engine cluster, creating the cluster management control module in the container group of the master node, and configuring the interface of the cluster management control module include: Pull the image of the cluster management control module from the cluster's image repository according to the automated test type; Create a cluster management control module in the container group of the master node; Set up the API interface for accessing the cluster management control module and the monitoring interface for monitoring whether the execution test machine is normal; Call the interface of the cluster management control module to configure the task. The steps of initiating the task request of building an automated continuous testing task include: Calling the API interface of the cluster management control module to configure task information; wherein the configured task information includes label information; Initiate a task request to build automated continuous testing; After receiving the task request, the steps of creating an execution test machine in the container group of the slave node according to the configuration information of the task, registering the created execution test machine with the cluster management control module, and updating the automated test script to the execution test machine include: After receiving the task request, create an execution test machine in the container group of the slave node according to the label information of the task; Register the created execution test machine to the cluster management control module; Update automated test scripts to the test execution machine.

2. The automated continuous testing method based on containerization according to claim 1, It is characterized in that The steps to deploy a container orchestration engine cluster and create a container group include: Select a node in the cluster to create a container group; Create images according to the automated test type and store them in the image repository; Deploy cluster monitoring threads and task monitoring threads; Update automated test scripts to the test execution machine.

3. The automated continuous testing method based on containerization according to claim 1, It is characterized in that After the test is completed, the test execution machine is deregistered and the container group where the test execution machine is located is deleted. The steps include: Trigger the task monitoring thread to monitor the execution of tasks in real time; When the task execution is completed, the execution test machine on which the task execution is completed is logged out, and the container group where the execution test machine is located is deleted.

4. The automated continuous testing method based on containerization according to claim 1, It is characterized in that The method further includes: Store the test results persistently; Read the failed log information in the test results to analyze the test results; When a timeout error occurs, extract the test case information, call the cluster management control module interface to configure the task, and initiate a task request to build an automated continuous test; After receiving the task request, create an execution test machine in the container group of the slave node according to the configuration information of the task, register the created execution test machine to the cluster management control module; re-execute the test case; When there is a data verification error, the error log information will be uploaded; When there is a code logic error, the error log information will be uploaded.

5. The automated continuous testing method based on containerization according to claim 1, It is characterized in that The method further includes: The cluster management control module monitors in real time whether the execution test machine is started through the monitoring interface; When the test machine is not started at the set time, the cluster management control module triggers the mailbox to send an email to the administrator.

6. The automated continuous testing method based on containerization according to claim 1, It is characterized in that The method further includes: Trigger the cluster monitoring thread to monitor the status of the cluster management control module and the test execution machine in the cluster in real time; When an abnormality is detected in the cluster management control module, the image of the cluster management control module is pulled from the container orchestration engine cluster, and another cluster management control module is created in the container group where the abnormal cluster management control module is located; Synchronize the functions and information of the abnormal cluster management and control module to the newly created cluster management and control module; When an abnormality of the test execution machine is detected, the test execution machine is recreated in the container group of the slave node according to the configuration information of the test execution machine task, and the created test execution machine is registered with the cluster management control module.

7. An automated continuous testing device based on containerization, It is characterized in that Based on a container orchestration engine cluster, the cluster includes a master node and several slave nodes, and the device includes a cluster deployment module, a first generation module, a second generation module, a task execution module, and a recovery module; The cluster deployment module is used to deploy the container orchestration engine cluster and create container groups; The first generation module is used to pull the image of the cluster management control module in the container orchestration engine cluster, create the cluster management control module in the container group of the master node, and configure the interface of the cluster management control module; The cluster management control module is used to call the interface to configure tasks and initiate task requests for building automated continuous testing; The second generation module is used to create an execution test machine in the container group of the slave node according to the configuration information of the task after receiving the task request, and register the created execution test machine with the cluster management control module; And update the automated test script to the test execution machine; Task execution module, used to execute automated test scripts for testing; The recycling module is used to trigger the task monitoring thread to monitor the execution of tasks in real time; When the task is completed, the test machine where the task is completed is logged out, and the container group where the test machine is located is deleted; The first generation module includes an image acquisition unit, a module creation unit, and an interface setting unit; An image acquisition unit, used to pull the image of the cluster management control module from the cluster's image repository according to the automated test type; A module creation unit, used to create a cluster management control module in the container group of the master node; An interface setting unit, used to set an API interface for accessing the cluster management control module and a monitoring interface for monitoring whether the execution test machine is normal; The cluster management control module is used to call the interface to configure tasks, where the configured task information includes label information and initiates a task request to build an automated continuous testing task; The second generation module includes an execution test machine creation unit, a registration unit, and an update unit; An execution test machine creation unit, used for creating an execution test machine in a container group of a slave node according to the label information of the task after receiving the task request; A registration unit, used to register the created execution test machine to the cluster management control module; The update unit is used to update the automated test scripts to the test execution machine.

8. The container-based automated continuous testing device according to claim 7, It is characterized in that The device also includes a persistent storage module and a test result analysis module; Persistent storage module, used to store test results persistently; The test result analysis module is used to read the failed log information in the test results to analyze the test results; when it is a timeout waiting error, extract the test case information, call the interface of the cluster management control module to configure the task, initiate a request to build an automated continuous testing task, and trigger the second generation module to generate an execution test machine to execute the test case; when it is a data verification error, upload the error log information; When there is a code logic error, the error log information will be uploaded.