CN116185740A - Scheme testing method, device, computer equipment and storage medium - Google Patents

Scheme testing method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN116185740A
CN116185740A CN202310190673.7A CN202310190673A CN116185740A CN 116185740 A CN116185740 A CN 116185740A CN 202310190673 A CN202310190673 A CN 202310190673A CN 116185740 A CN116185740 A CN 116185740A
Authority
CN
China
Prior art keywords
target
test
cluster
node
scheme
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310190673.7A
Other languages
Chinese (zh)
Inventor
李仲玄
罗利辉
李跃鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Kingdee Software China Co Ltd
Original Assignee
Kingdee Software China Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Kingdee Software China Co Ltd filed Critical Kingdee Software China Co Ltd
Priority to CN202310190673.7A priority Critical patent/CN116185740A/en
Publication of CN116185740A publication Critical patent/CN116185740A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2289Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing by configuration test
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application relates to a scheme test method, a scheme test device, computer equipment and a storage medium. Comprising the following steps: by acquiring the scheme test request, determining a target scheme identifier in the scheme test request, and determining target configuration information corresponding to the target scheme identifier; aiming at the target cluster identification and the node information included in the target configuration information, when cluster resource information of a target cluster corresponding to the target cluster identification is acquired, the target test node can be further screened out from a plurality of test nodes included in the target cluster according to the cluster resource information and the node information; and when the mirror image detection result is that the detection is passed, the target configuration information can be transferred to the target test node, so that the transferred target configuration information is used for carrying out scheme test in the target test node. By adopting the method, the automatic test of the scheme can be realized.

Description

Scheme testing method, device, computer equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and apparatus for testing a solution, a computer device, and a storage medium.
Background
By deploying the workflow-form schemes in a plurality of hardware devices, the smooth execution of corresponding business in an enterprise can be ensured, but when the corresponding scheme is updated or maintained, the scheme can be put into application after the test is required.
Currently, a binary program tool is typically used to test a pattern. However, because the environments where the plurality of hardware devices are deployed are not identical, the binary tool is not necessarily fully applicable in different hardware devices, which makes it difficult to successfully complete the solution test. Therefore, how to deploy the scheme efficiently and further realize the automatic test of the scheme is a problem to be solved by the application.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a solution testing method, apparatus, computer device, storage medium, and computer program product that implement an automated solution test.
In a first aspect, the present application provides a solution testing method. The method comprises the following steps:
acquiring a scheme test request and determining a target scheme identifier in the scheme test request;
determining target configuration information corresponding to the target scheme identification; the target configuration information comprises a target cluster identifier and node information;
Acquiring cluster resource information of a target cluster corresponding to the target cluster identifier, and screening target test nodes from a plurality of test nodes included in the target cluster according to the cluster resource information and the node information;
performing mirror image detection on the target test node to obtain a mirror image detection result;
when the mirror image detection result is that the detection is passed, the target configuration information is transmitted to the target test node; the transferred target configuration information is used for carrying out scheme test in the target test node.
In one embodiment, determining the target scenario identification in the scenario test request comprises: the method comprises the steps of determining a plurality of scheme identifications in the scheme test request and determining configuration information corresponding to each scheme identification; carrying out logic detection on the configuration format of each configuration information to obtain a logic detection result, and screening candidate scheme identifiers from a plurality of scheme identifiers according to a plurality of logic detection results; and determining the amount of execution resources required for executing the candidate scheme corresponding to each candidate scheme identifier, and screening a target scheme identifier from the plurality of candidate scheme identifiers according to the plurality of execution resource amounts.
In one embodiment, the configuration information includes a cluster identity; the step of screening the target scheme identifier from the candidate scheme identifiers according to the execution resource amounts comprises the following steps: determining a current cluster corresponding to a cluster identifier corresponding to a current candidate scheme identifier aiming at each candidate scheme identifier in a plurality of candidate scheme identifiers, and acquiring the current idle resource quantity of the current cluster; comparing the current idle resource amount with the current execution resource amount corresponding to the current candidate scheme identifier to obtain a comparison result; and screening out target scheme identifiers from the candidate scheme identifiers according to the comparison results.
In one embodiment, the target cluster includes a cluster controller and a cluster component; the obtaining cluster resource information of the target cluster corresponding to the target cluster identifier includes: acquiring cluster resource information of the target cluster through the cluster controller; and the cluster controller is used for carrying out resource monitoring on the target cluster when the target configuration information is read from the cluster component to obtain cluster resource information representing available resources of the target cluster.
In one embodiment, the cluster resource information includes a node resource amount corresponding to each test node; and screening a target test node from a plurality of test nodes included in the target cluster according to the cluster resource information and the node information, including: when the node information represents that the test node is pre-configured, taking the pre-configured test node as a target test node; when the node information represents a test node which is not configured in advance, determining the test resource amount required by testing the target scheme corresponding to the target scheme identifier; and screening target test nodes from the plurality of test nodes according to the node resource quantity and the test resource quantity.
In one embodiment, the image detection result is used for characterizing whether image information corresponding to the target configuration information exists in the target test node; after the mirror image detection is performed on the target test node to obtain a mirror image detection result, the method further comprises the following steps: and when the image detection result is that the detection fails, acquiring image information, and transmitting the image information to the target test node.
In one embodiment, the target configuration information includes a plurality of sub-tasks arranged in sequence; the target test node comprises a plurality of node containers; the target cluster comprises a cluster controller; after said communicating said target configuration information to said target test node, said method further comprises: creating a plurality of subtasks through the cluster controller according to the arrangement sequence of the subtasks; sequentially determining a current node container corresponding to the current subtask for each created subtask through the cluster controller; and distributing and executing the current subtask to the current node container through the cluster controller.
In a second aspect, the present application also provides a solution testing apparatus. The device comprises:
the configuration information determining module is used for acquiring a scheme test request and determining a target scheme identifier in the scheme test request; determining target configuration information corresponding to the target scheme identification; the target configuration information comprises a target cluster identifier and node information;
the test node screening module is used for acquiring cluster resource information of a target cluster corresponding to the target cluster identifier, and screening target test nodes from a plurality of test nodes included in the target cluster according to the cluster resource information and the node information;
The test node test module is used for carrying out mirror image detection on the target test node to obtain a mirror image detection result; when the mirror image detection result is that the detection is passed, the target configuration information is transmitted to the target test node; the transferred target configuration information is used for carrying out scheme test in the target test node.
In a third aspect, the present application also provides a computer device. The computer device comprises a memory storing a computer program and a processor which when executing the computer program performs the steps of:
acquiring a scheme test request and determining a target scheme identifier in the scheme test request;
determining target configuration information corresponding to the target scheme identification; the target configuration information comprises a target cluster identifier and node information;
acquiring cluster resource information of a target cluster corresponding to the target cluster identifier, and screening target test nodes from a plurality of test nodes included in the target cluster according to the cluster resource information and the node information;
performing mirror image detection on the target test node to obtain a mirror image detection result;
When the mirror image detection result is that the detection is passed, the target configuration information is transmitted to the target test node; the transferred target configuration information is used for carrying out scheme test in the target test node.
In a fourth aspect, the present application also provides a computer-readable storage medium. The computer readable storage medium has stored thereon a computer program which when executed by a processor performs the steps of:
acquiring a scheme test request and determining a target scheme identifier in the scheme test request;
determining target configuration information corresponding to the target scheme identification; the target configuration information comprises a target cluster identifier and node information;
acquiring cluster resource information of a target cluster corresponding to the target cluster identifier, and screening target test nodes from a plurality of test nodes included in the target cluster according to the cluster resource information and the node information;
performing mirror image detection on the target test node to obtain a mirror image detection result;
when the mirror image detection result is that the detection is passed, the target configuration information is transmitted to the target test node; the transferred target configuration information is used for carrying out scheme test in the target test node.
In a fifth aspect, the present application also provides a computer program product. The computer program product comprises a computer program which, when executed by a processor, implements the steps of:
acquiring a scheme test request and determining a target scheme identifier in the scheme test request;
determining target configuration information corresponding to the target scheme identification; the target configuration information comprises a target cluster identifier and node information;
acquiring cluster resource information of a target cluster corresponding to the target cluster identifier, and screening target test nodes from a plurality of test nodes included in the target cluster according to the cluster resource information and the node information;
performing mirror image detection on the target test node to obtain a mirror image detection result;
when the mirror image detection result is that the detection is passed, the target configuration information is transmitted to the target test node; the transferred target configuration information is used for carrying out scheme test in the target test node.
According to the scheme test method, the scheme test device, the computer equipment, the storage medium and the computer program product, the target configuration information corresponding to the target scheme identifier can be determined by acquiring the scheme test request and determining the target scheme identifier in the scheme test request; aiming at the target cluster identification and the node information included in the target configuration information, when cluster resource information of a target cluster corresponding to the target cluster identification is acquired, the target test node can be further screened out from a plurality of test nodes included in the target cluster according to the cluster resource information and the node information; and when the mirror image detection result is that the detection is passed, the target configuration information can be transferred to the target test node, so that the transferred target configuration information is used for scheme test in the target test node. Because the method and the device can directly complete the test deployment of the target scheme according to the target configuration information after the target configuration information corresponding to the target scheme identification is determined, compared with the traditional mode which only depends on binary program tools, the method and the device do not need to consider the difference of the deployed environments of hardware equipment, and can quickly realize the automatic test of the target scheme only by ensuring that the target test nodes in the target cluster are started.
Drawings
FIG. 1 is an application environment diagram of a method of pattern testing in one embodiment;
FIG. 2 is a flow chart of a method of testing a pattern in one embodiment;
FIG. 3 is a schematic diagram of a test structure for performing solution testing based on a cluster of containers in one embodiment;
FIG. 4 is a flow diagram of determining a target scenario identification in one embodiment;
FIG. 5 is a schematic diagram of resource monitoring of a target cluster in one embodiment;
FIG. 6 is a block diagram of a design test device in one embodiment;
fig. 7 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
The scheme testing method provided by the application can be applied to an application environment shown in figure 1. The terminal 102 communicates with the server 104 through a network, and the data storage system may store data that needs to be processed by the server 104. The data storage system may be integrated on the server 104 or may be located on a cloud or other network server. When acquiring a solution test request sent by the terminal 102, the server 104 is configured to determine a target solution identifier in the solution test request, and determine target configuration information corresponding to the target solution identifier; acquiring cluster resource information of a target cluster corresponding to the target cluster identifier, and screening target test nodes from a plurality of test nodes included in the target cluster according to the cluster resource information and the node information; the server 104 is further configured to perform image detection on the target test node to obtain an image detection result, and when the image detection result is that the detection is passed, transmit target configuration information to the target test node, so that the target test node performs solution test through the target configuration information. The terminal 102 may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices; the server 104 may be implemented as a stand-alone server or as a server cluster of multiple servers.
In one embodiment, as shown in fig. 2, a solution testing method is provided, which is performed by the server in fig. 1, which may be a test management system. The method comprises the following steps:
step 202, a solution test request is obtained, and a target solution identifier in the solution test request is determined.
Wherein, the target scheme identification refers to information uniquely identifying one target scheme; the target scheme identification may be multiple.
Specifically, for the case that multiple hardware devices are deployed in different container clusters, when a target solution needs to be tested, that is, testing needs to be completed by deploying container nodes of the hardware devices. The container cluster can be a Kubernetes cluster, which is an open-source container scheduling platform crossing a host cluster, and can automate the deployment, expansion and operation of application containers and provide a container-centric infrastructure. As shown in fig. 3, fig. 3 is a schematic diagram of a test structure for performing solution testing based on a container cluster, where the test structure includes a front-end module, a test management system, an integrated library, and a plurality of container clusters.
The front-end module can run on the terminal and realize the operation visualization through the provided display interface; the display interface comprises a scheme identification list, and when the front end module responds to the selection operation of the scheme identification list by a user, the front end module determines the selected target scheme identification. The front-end module generates a scheme test request according to the target scheme identifier, and sends the scheme test request to the test management system so that the test management system can analyze the target scheme identifier from the scheme test request.
Step 204, determining target configuration information corresponding to the target scheme identifier.
The target configuration information comprises a target cluster identifier and node information; the node information is used for representing whether the target scheme identifier is preconfigured with a test node for scheme test.
Specifically, the integrated library is integrated with configuration information corresponding to various schemes such as test cases, pressure test cases, interface detection tasks and the like; the configuration information can be a configuration file containing a plurality of test scripts and other information; configuration information for various schemes may be stored in the integrated library in the form of Yaml files. When the test management system analyzes the target scheme identification from the scheme test request, target configuration information corresponding to the target scheme identification can be directly searched from the integrated library.
In one embodiment, when the front-end module determines the target scheme identifier selected by the user, target configuration information corresponding to the target scheme identifier is searched out from the integrated library, and the target configuration information is imported into the test management system.
In one embodiment, to ensure flexible configuration and testing of the solution, a CRD (Custrom Resource Definition, custom resource) may be defined that characterizes a resource that allows the user to add custom in the Kubernetes cluster. Thus, the target configuration information may be a specific instance of a custom resource created in accordance with the CRD attribute declaration.
In one embodiment, the front-end module may further provide interface operation functions such as setting configuration information, deploying resource objects of the Kubernets cluster, installing plug-ins, and the like; the configuration information is set to characterize modification operations such as creation, update or deletion of the configuration information. Meanwhile, the front-end module also supports HTTP, HTTPS, HTTP2.0, TCP, UDP and other communication protocols, GRPC, HESSIAN and other framework communication protocols. Therefore, the front-end module can be in communication connection with the test management system through a target communication protocol supported by the test management system, so that information interaction is realized.
Step 206, obtaining cluster resource information of the target cluster corresponding to the target cluster identifier, and screening target test nodes from a plurality of test nodes included in the target cluster according to the cluster resource information and the node information.
The cluster resource information comprises CPU resource quantity, memory resource quantity, disk capacity and the like of each hardware device deployed in the target cluster.
Specifically, the test management system further comprises a cluster management module, wherein the cluster management module is used for managing connection of all container clusters, monitoring cluster states, controlling authority of the clusters and the like, and managing a process of transmitting target configuration information to the target clusters. Therefore, the cluster management module in the test management system can monitor the cluster resource information of the target cluster in real time.
Further, the test management system determines field content corresponding to the node information, wherein the field content comprises any one of a test node identifier and a null value, and then candidate test nodes are screened out from a plurality of test nodes according to the field content. When the field content is the test node identification, taking the test node corresponding to the test node identification as a candidate test node, and taking the candidate test node as a target test node; when the field content is null, a plurality of test nodes included in the target cluster are all used as candidate test nodes, at the moment, the test management system determines the test resource amount required by the test target scheme, compares the cluster resource information with the test resource amount, and screens out the target test nodes from the candidate test nodes according to the obtained comparison result.
In one embodiment, a blacklist may be provided in the test management system, where the blacklist includes an IP address, a network segment range, etc. corresponding to the test node, which is used to limit the test access of the solution.
And step 208, performing mirror image detection on the target test node to obtain a mirror image detection result.
The test management system also comprises a mirror image management module; the image detection result is used for representing whether image information corresponding to the target configuration information exists in the target test node.
Specifically, when the target test node in the target cluster performs the scheme test, it needs to ensure that mirror image information corresponding to the target configuration information exists in the target test node, so that the operation of the target test node can be ensured. Therefore, the image management module in the test management system can detect whether image information corresponding to the target configuration information exists in the target test node, if so, the target test node is characterized to have undergone corresponding scheme test, the corresponding image information can be stored in an image warehouse of the hardware equipment, and the image detection result at the moment is that the detection passes. If the target test node does not exist, the target test node feeds back mirror image-free information, namely the detection fails.
In one embodiment, after performing image detection on the target test node to obtain an image detection result, the method further includes: and when the image detection result is that the detection fails, acquiring image information, and transmitting the image information to a target test node.
Specifically, when the image detection result is that the detection fails, the test management system detects whether the image information exists in the image management module, and if so, the image information in the image management module is obtained and transmitted to the target test node. The mirror image information in the mirror image management module is obtained by packaging and storing the mirror image information in advance.
In one embodiment, when the mirror image information does not exist in the mirror image management module, the mirror image detection result is that the detection is failed, and the test management system generates error reporting information.
In one embodiment, the target configuration information includes a mirror address, and when the mirror information corresponding to the target configuration information does not exist in the target test node, the target test node may pull the mirror information from the integrated library in which the mirror information is pre-stored through the mirror address.
In one embodiment, when the target test node is in the cluster offline condition, the pulling of the mirror information may still be completed.
In the embodiment, the smooth operation of the target test node can be ensured by carrying out mirror image detection on the target test node; meanwhile, the mirror image information existing in the mirror image management module can be directly transmitted to the corresponding target test node, or the mirror image information is pulled through the mirror image address, so that the time for the target test node to acquire the mirror image information is shortened, and the flexibility of pulling the mirror image information is improved.
In addition, after the test management system packages the target configuration information and the mirror image information, the packaged information can be transferred to other container clusters, so that the replicability and applicability of testing the target scheme are improved, and the problem of hardware equipment deployment environment difference is not required to be considered.
And step 210, when the mirror image detection result is that the detection is passed, the target configuration information is transmitted to the target test node.
The transferred target configuration information is used for carrying out scheme test in the target test node.
Specifically, the target cluster includes an entry module and a cluster controller; the inlet module is used as a unified flow inlet of the container cluster and is used for receiving all the target configuration information and forwarding the target configuration information to a cluster controller in the target cluster, so that the target configuration information is transmitted to a target test node through the cluster controller, and then a target scheme corresponding to the target configuration information is subjected to scheme test through the target test node.
In one embodiment, the target cluster identifiers are multiple, that is, the corresponding target clusters are also multiple, that is, the target test nodes in the target clusters are multiple, and the target configuration information further includes the flow weight corresponding to each target cluster. The test management system transmits the target configuration information to each target test node, and when each target test node performs scheme test on the target scheme respectively, test data related to the target configuration information is obtained; and obtaining the data volume of the test data corresponding to the flow weight of the target cluster where the target test node is located.
In the scheme test method, the target configuration information corresponding to the target scheme identifier can be determined by acquiring the scheme test request and determining the target scheme identifier in the scheme test request; aiming at the target cluster identification and the node information included in the target configuration information, when cluster resource information of a target cluster corresponding to the target cluster identification is acquired, the target test node can be further screened out from a plurality of test nodes included in the target cluster according to the cluster resource information and the node information; and when the mirror image detection result is that the detection is passed, the target configuration information can be transferred to the target test node, so that the transferred target configuration information is used for scheme test in the target test node. Because the method and the device can directly complete the test deployment of the target scheme according to the target configuration information after the target configuration information corresponding to the target scheme identification is determined, compared with the traditional mode which only depends on binary program tools, the method and the device do not need to consider the difference of the deployed environments of hardware equipment, and can quickly realize the automatic test of the target scheme only by ensuring that the target test nodes in the target cluster are started.
In one embodiment, as shown in fig. 4, fig. 4 is a flowchart illustrating a process of determining a target scenario identifier, where determining a target scenario identifier in a scenario test request includes the following steps:
step 402, determining a plurality of scheme identifications in the scheme test request, and determining configuration information corresponding to each scheme identification.
Specifically, referring to the multiple scheme identifiers obtained when the user performs the selection operation on the scheme identifier list in step 202, the test management system searches the configuration information corresponding to each scheme identifier from the integrated library. The test management system also comprises a configuration information management module, wherein the configuration information management module is used for checking whether the configuration information has logic errors, checking whether cluster resources meet requirements or not and the like.
Step 404, performing logic detection on the configuration format of each configuration information to obtain a logic detection result, and screening candidate scheme identifiers from the plurality of scheme identifiers according to the plurality of logic detection results.
Specifically, for each configuration information in the plurality of configuration information, the test management system performs logic detection on the configuration format of each configuration information currently, that is, when the configuration information is a configuration file, it checks whether the format of the configuration file has a problem, checks whether the configuration file operation logic has a conflict, and the like. When the logic detection result represents that the detection passes, the test management system screens the corresponding scheme identifier as a candidate scheme identifier.
Step 406, determining an execution resource amount required for executing each candidate scheme identifier corresponding to the candidate scheme, and screening the target scheme identifier from the plurality of candidate scheme identifiers according to the plurality of execution resource amounts.
Wherein the amount of execution resources may characterize an amount of computer resources, e.g., GPU resources or memory resources, that need to be consumed by container nodes in the container cluster in executing the candidate. The configuration information includes cluster identifications, that is, each candidate scheme identification corresponds to a respective cluster identification.
In one embodiment, the screening the target solution identifier from the plurality of candidate solution identifiers according to the plurality of execution resource amounts includes: determining a current cluster corresponding to a cluster identifier corresponding to the current candidate scheme identifier aiming at each candidate scheme identifier in the plurality of candidate scheme identifiers, and acquiring the current idle resource quantity of the current cluster; comparing the current idle resource quantity with the current execution resource quantity corresponding to the current candidate scheme identification to obtain a comparison result; and screening out target scheme identifiers from the candidate scheme identifiers according to the comparison results.
Specifically, the test management system monitors a current cluster corresponding to the cluster identifier according to the cluster identifier corresponding to the current candidate scheme identifier, and reads the current idle resource amount corresponding to the current cluster. Wherein the current candidate identifier is any one of a plurality of candidate identifiers; the amount of free resources characterizes the amount of free, unused computer resources in the current cluster. The test management system can compare the current idle resource quantity with the current execution resource quantity corresponding to the current candidate scheme identification to obtain a comparison result, and when the comparison result represents that the current idle resource quantity is greater than or equal to the current execution resource quantity, the current candidate scheme identification is used as a target scheme identification.
In one embodiment, when the test management system determines the target solution identifier, the cluster management module in the test management system may label the target solution identifier, so that the actual test process of the test strategy of the solution is more matched.
In this embodiment, by checking whether each configuration information has a logic error in advance, checking whether cluster resources meet requirements, and the like, configuration information that does not meet the conditions can be filtered in advance, so as to avoid a solution test performed on a solution that does not meet the conditions. Meanwhile, the target scheme identification can be further accurately screened out by determining the idle resource quantity corresponding to each of different clusters and the execution resource quantity corresponding to the candidate scheme identification.
In one embodiment, before obtaining the cluster resource information of the target cluster corresponding to the target cluster identifier, the method further includes: and acquiring cluster resource information of the target cluster through the cluster controller.
The target cluster comprises a cluster controller and a cluster component; and the cluster controller is used for monitoring the resources of the target cluster when the target configuration information is read from the cluster component, so as to obtain cluster resource information representing the usable resources of the target cluster.
The cluster controller can be used for monitoring resource information of a test Node in the target cluster, wherein the test Node is a container Node; the cluster component is used to document or store various information associated with the clusters, and the like. As shown in fig. 5, fig. 5 is a schematic diagram of resource monitoring on a target cluster.
Specifically, when the front-end module performs modification operations such as creation and the like on the configuration information, the modified configuration information is uploaded to the cluster component in the form of a creation request. When the cluster component receives the uploaded configuration information, the cluster controller is triggered to start to operate, so that the cluster controller reads target configuration information corresponding to the target scheme identifier from the cluster component. Meanwhile, the running cluster controller monitors the resources of the target cluster to obtain cluster resource information representing available resources of the target cluster; the cluster controller can then feed the cluster resource information back to the test management system to manage the target cluster through the cluster management module in the test management system.
In one embodiment, the cluster controller may be an Operator in a Kubernetes cluster, may use the functionality of an extensible Kubernetes API, etc.; the operators can be created in the container clusters in advance through a Kubect1 tool; the Operator may be determined by a set of controllers listening to Kubernetes cluster resources, which are non-stop loops that may be used to adjust the system state.
In this embodiment, when the cluster component receives the uploaded configuration information, the cluster controller is triggered in real time, and cluster resource information of available resources in the target cluster is monitored in real time, so that after the cluster resource information is transferred to the test management system, it is ensured that the test management system can determine the optimal target scheme identifier subsequently.
In one embodiment, the screening the target test node from the plurality of test nodes included in the target cluster according to the cluster resource information and the node information includes: when the node information represents that the test node is pre-configured, taking the pre-configured test node as a target test node; when the node information represents that the test node is not configured in advance, determining the test resource amount required by the target scheme corresponding to the test target scheme identification; and screening target test nodes from the plurality of test nodes according to the plurality of node resource amounts and the test resource amounts.
The cluster resource information comprises node resource amounts corresponding to each test node; the node resource quantity represents the idle and usable computer resource quantity of each test node; the test resource amount characterizes an amount of computer resources that the target cluster needs to consume when testing the target solution.
Specifically, the test management system detects node information, and when the detected node information represents that the test node is preconfigured, the preconfigured test node is directly used as a target test node. When the detected node information represents a test node which is not configured in advance, the test management system determines the test resource amount required by the target scheme corresponding to the test target scheme identification; the test resource amount may be stored in the target configuration information in advance. And comparing the difference between the current node resource amount and the test resource amount aiming at each node resource amount in the plurality of node resource amounts, and taking the test node corresponding to the current node resource amount as a target test node if the current node resource amount is greater than or equal to the test resource amount.
In one embodiment, if there are a plurality of test nodes that can be used as target test nodes, that is, there are a plurality of node resource amounts that are greater than or equal to the test resource amount, the test management system may screen the target node resource amount from the plurality of node resource amounts according to a preset screening manner, and further use the test node corresponding to the target node resource amount as the target test node. The screening method may be to screen the node resource amount with the largest resource amount from the plurality of node resource amounts, or may be to randomly select the plurality of node resource amounts, or the like.
In this embodiment, the target schemes corresponding to each target scheme identifier are respectively compared with the resource amount of each node and the test resource amount of the target scheme to determine the executable target test node, so that the concurrency number of the target schemes executed in the target cluster can be controlled through the node resource amount and the test resource amount, thereby ensuring that the load of each target cluster is stabilized at a balanced optimal point.
In one embodiment, after the target test node completes the test on the target scheme, the test resource amount consumed by performing task execution on the target configuration information is released, and the node resource amount corresponding to the target test node is updated according to the released test resource amount. Therefore, when the unprocessed scheme test request is processed in time based on the released resources, the utilization rate of the node resource amount can be improved, and the processing efficiency of the scheme test request is further improved.
In one embodiment, after delivering the target configuration information to the target test node, further comprising: creating a plurality of subtasks according to the arrangement sequence of the subtasks through the cluster controller; sequentially determining a current node container corresponding to the current subtask aiming at each created subtask through a cluster controller; the current subtask is assigned and executed to the current node container by the cluster controller.
The target configuration information includes a plurality of subtasks, which may be called Job tasks, and include running test scripts related to the target solution, as shown in fig. 5; the target test node includes a plurality of node containers, also referred to as containers Pod.
Specifically, when the target cluster acquires the target configuration information transmitted by the test management system, a cluster controller in the target cluster sequentially creates a plurality of subtasks according to the arrangement sequence of the subtasks. For each of the created plurality of subtasks, the cluster controller sequentially determines a current node container corresponding to the current subtask according to the creation sequence. When the current node container is started, the cluster controller transmits the current subtask to the current node container in the form of an execution command so that the current node container runs the running test script in the current subtask, and further scheme test on the target scheme is completed.
In this embodiment, since a plurality of node containers are deployed in the target test node, by allocating and executing corresponding subtasks to corresponding node containers, the situation that different node containers execute a plurality of scheme test requests simultaneously can be realized, so that the efficiency of testing different target schemes can be improved.
It should be understood that, although the steps in the flowcharts related to the above embodiments are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiment of the application also provides a scheme testing device for realizing the scheme testing method. The implementation of the solution provided by the device is similar to the implementation described in the above method, so the specific limitation of one or more embodiments of the solution testing device provided below may refer to the limitation of the solution testing method described above, and will not be repeated here.
In one embodiment, as shown in fig. 6, a scenario testing apparatus 600 is provided, comprising: a request receiving module 602, an information determining module 604, and a request transmitting module 606, wherein:
the configuration information determining module 602 is configured to obtain a solution test request, and determine a target solution identifier in the solution test request; determining target configuration information corresponding to the target scheme identification; the target configuration information includes a target cluster identity and node information.
The test node screening module 604 is configured to obtain cluster resource information of a target cluster corresponding to the target cluster identifier, and screen a target test node from a plurality of test nodes included in the target cluster according to the cluster resource information and the node information.
The test node test module 606 is configured to perform image detection on the target test node to obtain an image detection result; when the mirror image detection result is that the detection passes, the target configuration information is transmitted to a target test node; the transferred target configuration information is used for carrying out scheme testing in the target testing node.
In one embodiment, the configuration information determining module 602 further includes a solution identifier determining module 6021, configured to determine a plurality of solution identifiers in the solution test request, and determine configuration information corresponding to each of the solution identifiers; carrying out logic detection on the configuration format of each configuration information to obtain a logic detection result, and screening candidate scheme identifiers from a plurality of scheme identifiers according to a plurality of logic detection results; and determining the amount of execution resources required for executing the candidate scheme corresponding to each candidate scheme identifier, and screening the target scheme identifier from the plurality of candidate scheme identifiers according to the plurality of execution resource amounts.
In one embodiment, the solution identifier determining module 6021 is further configured to determine, for each candidate solution identifier in the plurality of candidate solution identifiers, a current cluster corresponding to the cluster identifier corresponding to the current candidate solution identifier, and obtain a current idle resource amount of the current cluster; comparing the current idle resource quantity with the current execution resource quantity corresponding to the current candidate scheme identification to obtain a comparison result; and screening out target scheme identifiers from the candidate scheme identifiers according to the comparison results.
In one embodiment, the solution testing apparatus 600 further includes a cluster resource monitoring module 608, configured to obtain cluster resource information of the target cluster through a cluster controller, where the cluster controller is configured to monitor the target cluster for resources when the target configuration information is read from the cluster component, so as to obtain cluster resource information that characterizes available resources of the target cluster.
In one embodiment, the test node screening module 604 is further configured to, when the node information characterizes that the test node is preconfigured, take the preconfigured test node as the target test node; when the node information represents that the test node is not configured in advance, determining the test resource amount required by the target scheme corresponding to the test target scheme identification; and screening target test nodes from the plurality of test nodes according to the plurality of node resource amounts and the test resource amounts.
In one embodiment, the test node testing module 606 further includes an image detection module 6061, configured to obtain image information when the image detection result is that the detection fails, and transmit the image information to the target test node.
In one embodiment, the test node testing module 606 further includes a subtask execution module 6062, configured to create a plurality of subtasks according to an arrangement sequence of the plurality of subtasks by the cluster controller; sequentially determining a current node container corresponding to the current subtask aiming at each created subtask through a cluster controller; the current subtask is assigned and executed to the current node container by the cluster controller.
The modules in the solution testing apparatus may be implemented in whole or in part by software, hardware, or a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a server, and the internal structure of which may be as shown in fig. 7. The computer device includes a processor, a memory, an Input/Output interface (I/O) and a communication interface. The processor, the memory and the input/output interface are connected through a system bus, and the communication interface is connected to the system bus through the input/output interface. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is used to store the scenario test data. The input/output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a solution testing method.
It will be appreciated by those skilled in the art that the structure shown in fig. 7 is merely a block diagram of some of the structures associated with the present application and is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, there is also provided a computer device including a memory and a processor, the memory storing a computer program, the processor implementing the steps of the method embodiments described above when executing the computer program.
In one embodiment, a computer-readable storage medium is provided, storing a computer program that, when executed by a processor, performs the steps of the method embodiments described above.
In one embodiment, a computer program product or computer program is provided that includes computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in the above-described method embodiments.
Those skilled in the art will appreciate that implementing all or part of the above-described embodiment methods may be accomplished by way of a computer program that instructs associated hardware to perform the method, and that the computer program may be stored on a non-volatile computer readable storage medium, which when executed, may comprise the embodiment flows of the above-described methods. Any reference to memory, database, or other medium used in the various embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magnetic random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (Phase Change Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like. The databases referred to in the various embodiments provided herein may include at least one of relational databases and non-relational databases. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processors referred to in the embodiments provided herein may be general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic units, quantum computing-based data processing logic units, etc., without being limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples represent only a few embodiments of the present application, which are described in more detail and are not thereby to be construed as limiting the scope of the present application. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application shall be subject to the appended claims.

Claims (10)

1. A solution testing method, the method comprising:
acquiring a scheme test request and determining a target scheme identifier in the scheme test request;
determining target configuration information corresponding to the target scheme identification; the target configuration information comprises a target cluster identifier and node information;
acquiring cluster resource information of a target cluster corresponding to the target cluster identifier, and screening target test nodes from a plurality of test nodes included in the target cluster according to the cluster resource information and the node information;
Performing mirror image detection on the target test node to obtain a mirror image detection result;
when the mirror image detection result is that the detection is passed, the target configuration information is transmitted to the target test node; the transferred target configuration information is used for carrying out scheme test in the target test node.
2. The method of claim 1, wherein the determining the target scenario identification in the scenario test request comprises:
determining a plurality of scheme identifications in the scheme test request and determining configuration information corresponding to each scheme identification;
carrying out logic detection on the configuration format of each configuration information to obtain a logic detection result, and screening candidate scheme identifiers from a plurality of scheme identifiers according to a plurality of logic detection results;
and determining the amount of execution resources required for executing the candidate scheme corresponding to each candidate scheme identifier, and screening a target scheme identifier from the plurality of candidate scheme identifiers according to the plurality of execution resource amounts.
3. The method of claim 2, wherein the configuration information includes a cluster identity; the step of screening the target scheme identifier from the candidate scheme identifiers according to the execution resource amounts comprises the following steps:
Determining a current cluster corresponding to a cluster identifier corresponding to a current candidate scheme identifier aiming at each candidate scheme identifier in a plurality of candidate scheme identifiers, and acquiring the current idle resource quantity of the current cluster;
comparing the current idle resource amount with the current execution resource amount corresponding to the current candidate scheme identifier to obtain a comparison result;
and screening out target scheme identifiers from the candidate scheme identifiers according to the comparison results.
4. The method of claim 1, wherein the target cluster comprises a cluster controller and a cluster component; the obtaining cluster resource information of the target cluster corresponding to the target cluster identifier includes:
acquiring cluster resource information of the target cluster through the cluster controller;
and the cluster controller is used for carrying out resource monitoring on the target cluster when the target configuration information is read from the cluster component to obtain cluster resource information representing available resources of the target cluster.
5. The method of claim 1, wherein the cluster resource information includes a respective amount of node resources for each test node; and screening a target test node from a plurality of test nodes included in the target cluster according to the cluster resource information and the node information, including:
When the node information represents that the test node is pre-configured, taking the pre-configured test node as a target test node;
when the node information represents a test node which is not configured in advance, determining the test resource amount required by testing the target scheme corresponding to the target scheme identifier;
and screening target test nodes from the plurality of test nodes according to the node resource quantity and the test resource quantity.
6. The method of claim 1, wherein the image detection result is used to characterize whether image information corresponding to the target configuration information exists in the target test node; after the mirror image detection is performed on the target test node to obtain a mirror image detection result, the method further comprises the following steps:
and when the image detection result is that the detection fails, acquiring image information, and transmitting the image information to the target test node.
7. The method of claim 1, wherein the target configuration information comprises a plurality of sub-tasks arranged in sequence; the target test node comprises a plurality of node containers; the target cluster comprises a cluster controller; after said communicating said target configuration information to said target test node, said method further comprises:
Creating a plurality of subtasks through the cluster controller according to the arrangement sequence of the subtasks;
sequentially determining a current node container corresponding to the current subtask for each created subtask through the cluster controller;
and distributing and executing the current subtask to the current node container through the cluster controller.
8. A solution testing apparatus, the apparatus comprising:
the configuration information determining module is used for acquiring a scheme test request and determining a target scheme identifier in the scheme test request; determining target configuration information corresponding to the target scheme identification; the target configuration information comprises a target cluster identifier and node information;
the test node screening module is used for acquiring cluster resource information of a target cluster corresponding to the target cluster identifier, and screening target test nodes from a plurality of test nodes included in the target cluster according to the cluster resource information and the node information;
the test node test module is used for carrying out mirror image detection on the target test node to obtain a mirror image detection result; when the mirror image detection result is that the detection is passed, the target configuration information is transmitted to the target test node; the transferred target configuration information is used for carrying out scheme test in the target test node.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 7 when the computer program is executed.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 7.
CN202310190673.7A 2023-02-22 2023-02-22 Scheme testing method, device, computer equipment and storage medium Pending CN116185740A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310190673.7A CN116185740A (en) 2023-02-22 2023-02-22 Scheme testing method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310190673.7A CN116185740A (en) 2023-02-22 2023-02-22 Scheme testing method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116185740A true CN116185740A (en) 2023-05-30

Family

ID=86452087

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310190673.7A Pending CN116185740A (en) 2023-02-22 2023-02-22 Scheme testing method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116185740A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117806978A (en) * 2024-03-01 2024-04-02 腾讯科技(深圳)有限公司 Cluster abnormity testing method and device, electronic equipment and storage medium
CN117806978B (en) * 2024-03-01 2024-05-14 腾讯科技(深圳)有限公司 Cluster abnormity testing method and device, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117806978A (en) * 2024-03-01 2024-04-02 腾讯科技(深圳)有限公司 Cluster abnormity testing method and device, electronic equipment and storage medium
CN117806978B (en) * 2024-03-01 2024-05-14 腾讯科技(深圳)有限公司 Cluster abnormity testing method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN108845884B (en) Physical resource allocation method, device, computer equipment and storage medium
CN111277460B (en) ZooKeeper containerization control method and device, storage medium and electronic equipment
US8893133B2 (en) Dynamic test scheduling by ordering tasks for performance based on similarities between the tasks
US8117641B2 (en) Control device and control method for information system
CN109120678A (en) The method and apparatus of service tray for distributed memory system
CN111818159B (en) Management method, device, equipment and storage medium of data processing node
US20120159471A1 (en) Multi-machine deployment and configuration of multi-tiered applications
US20170123777A1 (en) Deploying applications on application platforms
CN109614167B (en) Method and system for managing plug-ins
CN113569987A (en) Model training method and device
US10498817B1 (en) Performance tuning in distributed computing systems
US9959157B1 (en) Computing instance migration
CN113382077B (en) Micro-service scheduling method, micro-service scheduling device, computer equipment and storage medium
CN113204353B (en) Big data platform assembly deployment method and device
CN111190823A (en) UI automation test method, electronic device and computer readable storage medium
US20230126168A1 (en) Scalable visualization of a containerized application in a multiple-cluster and multiple deployment application environment
WO2019222941A1 (en) Method for evaluating application deployment, apparatus, computer program product, and readable medium
CN111831567B (en) Application test environment configuration method, device, system and medium
US11544091B2 (en) Determining and implementing recovery actions for containers to recover the containers from failures
CN112256384B (en) Service set processing method and device based on container technology and computer equipment
CN116185740A (en) Scheme testing method, device, computer equipment and storage medium
CN115840642A (en) Edge resource processing method, device, system, equipment and medium
CN112564979B (en) Execution method and device of construction task, computer equipment and storage medium
CN109257256A (en) Apparatus monitoring method, device, computer equipment and storage medium
US20200028739A1 (en) Method and apparatus for closed-loop and dynamic capacity management in a web-scale data center

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination