Business inspection-based private cloud project delivery automation testing method and device
By creating automated test pods in a private cloud environment, executing automated tests, and generating inspection reports, the shortcomings of health inspection of business functions in private cloud products are addressed, and efficient environmental status assessment and resource management are achieved.
Patent Information
- Application Number
- CN202310069687.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-07
- Publication Date
- 2026-03-20
- Estimated Expiration
- 2043-02-07
AI Technical Summary
Existing technologies are unable to effectively perform health checks on the overall business functions of private cloud products, and thus cannot meet the actual needs of customers.
The system creates automated test pods by collecting current environment information, executes automated test services, obtains user-configured test accounts and functional inspection type information, performs parameterized construction and test case execution, calculates inspection scores, generates inspection reports, and automatically destroys the test pods.
It reduces the testing workload for project delivery and environmental maintenance, improves environmental maintenance efficiency, reduces physical resource consumption, and provides an intuitive assessment of environmental status.
Smart Images

Figure CN116225915B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of automated testing technology, and in particular to an automated testing method and apparatus for private cloud project delivery based on business inspection. Background Technology
[0002] Chinese patent document CN111026602A discloses a health inspection scheduling management method, device, and electronic device for a cloud platform. The method includes: obtaining user-defined inspection strategies and inspection thresholds; creating inspection tasks based on the inspection strategies, the number of nodes in the cloud platform, and the node types; generating remote call requests and asynchronously sending them to each node; responding to the remote call requests by selecting and executing the inspection script corresponding to the inspection task, and collecting inspection data from the corresponding nodes; obtaining the inspection data; determining whether the inspection objects of each node are healthy based on the inspection data and inspection thresholds; and generating an inspection result table based on the determination results.
[0003] Chinese patent document CN112448846A discloses a health inspection method, apparatus, device, and readable storage medium for a Kubernetes cluster. It can scan the resources of the Kubernetes cluster, summarize the scanned resource information to obtain resource scan results; then, it checks the configuration items of each resource in the resource scan results, identifies abnormal configuration items as inspection results; then, it persistently saves the inspection results to obtain persistent data; finally, it displays the persistent data through a UI interface.
[0004] Chinese patent document CN202210106162.8 provides a private cloud inspection scheme. This scheme first prepares the inspection environment on the private cloud after obtaining the inspection task trigger information. Then, it retrieves and loads inspection items from the inspection tool's system according to the parameters carried in the inspection task trigger information. Based on the loaded inspection items, it initializes the inspection task, executes the inspection task, and saves the inspection results of the inspection task to the database after formatting. After the inspection task is completed, it returns the formatted inspection results.
[0005] All three patent documents mentioned above relate to health inspection technology in the field of cloud computing. They all aim to detect the health status of cluster servers and software processes by configuring and executing inspection functions, and determine whether the inspection status is healthy based on certain thresholds, ultimately outputting inspection result reports and alarm policies. However, the above inspection solutions do not perform health inspections on the overall business functions of private cloud products, which are of most concern to actual customers, and therefore cannot meet their actual needs. Summary of the Invention
[0006] The embodiment of the present application provides a private cloud project delivery automatic test method and device based on service inspection, to solve the problem that the inspection scheme in the prior art does not perform health inspection on the overall service function of the private cloud product which is most concerned by the actual customer, and cannot meet the actual needs of the customer.
[0007] The private cloud project delivery automatic test method based on service inspection according to the embodiment of the present application comprises:
[0008] Current environment information required for performing the automatic test is collected, and an automatic test pod is created based on the current environment information, wherein the automatic test pod comprises dependency information required for performing the automatic test;
[0009] When a one-key inspection function key in a health inspection interface is triggered by a user, the automatic test pod is pulled up, and automatic test construction information configured by the user is acquired, so that the automatic test service is automatically performed; the automatic test construction information comprises test account information and function inspection type information;
[0010] The automatic test service is used to automatically perform: performing the automatic test based on the automatic test pod and the automatic test construction information, and displaying the inspection result on the health inspection interface; and automatically destroying the automatic test pod.
[0011] According to some embodiments of the present application, the dependency information required for performing the automatic test is acquired from the service pod in the form of config-map, and the dependency information required for performing the automatic test comprises the domain name host of the current environment, database connection information, and access information of a storage server.
[0012] According to some embodiments of the present application, the automatic test construction information configured by the user is acquired, comprising:
[0013] Customized test account information input by the user in a test account information bar displayed on the health inspection interface is detected; when the user does not input the customized test account information in the test account information bar, preset default account information is displayed on the test account information bar;
[0014] A function inspection type selected by the user in a function inspection type bar displayed on the health inspection interface is detected, wherein the function inspection type bar provides a plurality of function inspection type options for the user to select, and the plurality of function inspection type options comprise: full-amount function inspection, core service function inspection, and customized service function inspection.
[0015] According to some embodiments of the present application, the automatic test based on the automatic test pod and the automatic test construction information comprises:
[0016] Based on the automation test pod and the automation test build information, a parameterized build of at least one patrol case is performed;
[0017] Each patrol case of the parameterized build is executed to obtain at least one patrol case execution result;
[0018] According to the importance level of each patrol case of the parameterized build and the at least one patrol case execution result, a patrol score is calculated;
[0019] According to the patrol score, the health status of the business function of the current private cloud environment is evaluated, and a patrol report is generated.
[0020] According to some embodiments of the present application, the calculation of the patrol score according to the importance level of each patrol case of the parameterized build and the at least one patrol case execution result comprises:
[0021] According to the importance level of each patrol case of the parameterized build, a weight value of each patrol case of the parameterized build is determined;
[0022] The importance level includes: basic business flow p0 of core function, positive business flow p1 of core function, positive business flow of important function, and abnormal business flow p2 of core function and important function; the weight value corresponding to the p0 is greater than the weight value corresponding to the p1, and the weight value corresponding to the p1 is greater than the weight value corresponding to the p2;
[0023] Based on the weight value of each patrol case of the parameterized build and the at least one patrol case execution result, the patrol score is calculated according to the following formula:
[0024] score=100-n p0 ×w p0 -n p1 ×w p1 -n p2 ×w p2 ,
[0025] Wherein, n p0 , n p1 , n p2 respectively represent the number of patrol case execution failures of patrol cases with importance levels p0, p1 and p2, w p0 , w p1 , w p2 respectively represent the weight values corresponding to the patrol cases with importance levels p0, p1 and p2.
[0026] According to some embodiments of the present application, w p0 =10, w p1 =5, and w p2= 1.
[0027] According to some embodiments of the present application, the inspection report comprises: the total number of inspection cases, the success rate of inspection case execution, test suite information, and inspection case information, wherein the inspection case information comprises all execution steps of the inspection case.
[0028] For the inspection case that fails the test, stack information is thrown and the failed step is marked.
[0029] According to some embodiments of the present application, the execution of the automated test based on the automated test pod and the automated test construction information further comprises:
[0030] After the execution of a single inspection case is completed, all test resources used by the inspection case are deleted;
[0031] After the execution of all the inspection cases is completed, residual test resources are re-inspected and resource cleaning is completed;
[0032] For the test resources that cannot be cleaned after the inspection, a record is made and all the test resources that fail to be cleaned are displayed in the inspection report.
[0033] The device for automated testing of a private cloud project based on business inspection according to the embodiments of the present application comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the computer program is executed by the processor, the steps of the method described above are implemented.
[0034] According to the embodiments of the present application, the automated testing method based on business inspection provided by the present application uses the automated testing function as a part of the product function for delivery, and triggers the automated testing through the business inspection function to reduce the burden of environment verification of the project delivery personnel after the completion of environment deployment. Meanwhile, this function can also be delivered to the customer for basic function smoking use during daily maintenance of the environment, greatly reducing the test workload of the customer and improving the efficiency of environment maintenance. In addition, the environment for automated testing runs in a separate pod in the cluster, and after the test is completed, the pod is automatically destroyed, effectively avoiding the tedious automated environment building work and minimizing the consumption of physical resources of the environment.
[0035] The above description is only a summary of the technical solutions of the present application. In order to more clearly understand the technical means of the present application, the content of the specification can be implemented, and in order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific embodiments of the present application are described below. BRIEF DESCRIPTION OF DRAWINGS
[0036] Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the embodiments. The accompanying drawings are included to provide a description of preferred embodiments, and are not intended to limit the present application. In the drawings:
[0037] Figure 1 is a private cloud project delivery automatic test method flow chart based on business patrol in the embodiment of the present application;
[0038] Figure 2 is a front and back end and automatic service interaction logic schematic diagram of the patrol automatic test in the embodiment of the present application;
[0039] Figure 3 is a function schematic diagram of the front and back end and automatic service of the patrol automatic test in the embodiment of the present application. DETAILED DESCRIPTION
[0040] Exemplary embodiments of the present application will be described herein below with reference to the accompanying drawings. Although exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided so that this application will be thoroughly and completely understood, and so that the scope of the present application will be completely conveyed to those skilled in the art. In addition, well-known methods, structures and techniques have not been shown in detail in some instances so as not to obscure the understanding of this specification.
[0041] The embodiment of the present application proposes a private cloud project delivery automatic test method based on business patrol, which is executed based on the patrol function of the private cloud project and is used for business function test verification in the private cloud environment.
[0042] The private cloud project delivery automatic test method based on business patrol of the embodiment of the present application comprises:
[0043] Current environment information required for executing the automatic test is collected, and an automatic test pod is created based on the current environment information, wherein the automatic test pod comprises dependent information required for executing the automatic test, such as domain name host of the current environment, database connection information, access information of the storage server, etc.
[0044] When a one-key patrol function key in the health patrol interface is triggered by a user, the automatic test pod is pulled up and automatic test construction information configured by the user is acquired to automatically execute the automatic test service; the automatic test construction information comprises test account information and function patrol type information;
[0045] The automatic test service is used to automatically perform: first, performing automatic test based on the automatic test pod and the automatic test build information, then, displaying the inspection result on the health inspection interface, and finally, destroying the automatic test pod to release resources.
[0046] By using the embodiment of the present application, the automatic test method based on business inspection provided by the present application uses the automatic test function as a part of product function for delivery, and triggers the automatic test through the business inspection function to reduce the burden of environment verification of project delivery personnel after the completion of environment deployment, and the function can also be delivered to the customer for basic function smoking use in daily environment maintenance, which greatly reduces the test workload of the customer and improves the efficiency of environment maintenance. In addition, the environment of the automatic test runs in a separate pod in the cluster, and the pod is automatically destroyed after the test is completed, which effectively avoids the tedious automatic environment building work and also maximally reduces the consumption of physical resources of the environment.
[0047] On the basis of the above-mentioned embodiments, further variant embodiments are proposed, and it should be noted that, in order to make the description brief, only the differences from the above-mentioned embodiments are described in the variant embodiments.
[0048] According to some embodiments of the present application, the dependency information required for performing the automatic test is obtained from the business pod in the form of config-map.
[0049] According to some embodiments of the present application, the automatic test build information configured by the user comprises:
[0050] Detecting the custom test account information input by the user in the test account information column displayed in the health inspection interface; when the user does not input the custom test account information in the test account information column, the test account information column displays the preset default account information.
[0051] Detecting the function inspection type selected by the user in the function inspection type column displayed in the health inspection interface, and the function inspection type column provides a plurality of function inspection type options for the user to select, and the plurality of function inspection type options comprise: full-amount function inspection, core business function inspection, and custom business function inspection. Since the user can configure according to the demand, the demand of different users can be met.
[0052] According to some embodiments of the present application, the automatic test based on the automatic test pod and the automatic test build information comprises:
[0053] Based on the automatic test pod and the automatic test build information, parameterized construction of at least one inspection case is performed.
[0054] execute the parameterized built inspection cases to obtain at least one inspection case execution result;
[0055] calculate an inspection score according to the importance levels of the parameterized built inspection cases and the at least one inspection case execution result. The inspection score can intuitively and quantitatively inform a user of the status of the current environment business function;
[0056] evaluate the health status of the current private cloud environment business function according to the inspection score, and generate an inspection report.
[0057] According to some embodiments of the present application, the calculating an inspection score according to the importance levels of the parameterized built inspection cases and the at least one inspection case execution result comprises:
[0058] determining weight values of the parameterized built inspection cases according to the importance levels of the parameterized built inspection cases;
[0059] The importance levels include: a basic business flow p0 of a core function, a positive business flow p1 of the core function, a positive business flow of an important function, and an abnormal business flow p2 of the core function and the important function. The weight value corresponding to the p0 is greater than the weight value corresponding to the p1, and the weight value corresponding to the p1 is greater than the weight value corresponding to the p2.
[0060] Based on the weight values of the parameterized built inspection cases and the at least one inspection case execution result, the inspection score is calculated according to the following formula:
[0061] score = 100 - n p0 × w p0 - n p1 × w p1 - n p2 × w p2 ,
[0062] wherein n p0 , n p1 , n p2 respectively represent the number of failed inspection cases with importance levels of p0, p1 and p2, w p0 , w p1 , w p2 respectively represent the weight values corresponding to the inspection cases with importance levels of p0, p1 and p2.
[0063] Further, w p0 = 10, w p1 = 5, and w p2 = 1 can be set.
[0064] According to some embodiments of the present application, the inspection report comprises: total number of inspection cases, success rate of inspection case execution, test suite information, and inspection case information, wherein the inspection case information comprises all execution steps of the inspection case.
[0065] For the inspection case that fails in the test, stack information is thrown and the failed step is marked. Thus, the inspection executor can be conveniently located.
[0066] According to some embodiments of the present application, the execution of the automated test based on the automated test pod and the automated test build information further comprises:
[0067] After the execution of a single inspection case is completed, all test resources used by the inspection case are deleted.
[0068] Further, after the execution of all the inspection cases is completed, residual test resources are re-inspected and resource cleaning is completed.
[0069] Further, for the test resources that cannot be cleaned after the inspection, records are summarized and all cleaning-failed test resources are displayed in the inspection report.
[0070] The business-inspection-based private cloud project delivery automated test method according to the embodiments of the present application will be described in detail below with reference to the accompanying drawings and a specific embodiment. It should be understood that the following description is only exemplary and should not be construed as a specific limitation of the present application.
[0071] As shown in FIG. 1, the business-inspection-based private cloud project delivery automated test method according to the embodiments of the present application comprises: Figure 1
[0072] Step S110: Collecting current environment information required for execution of the automated test, creating an automated test pod, and executing one-key inspection according to a user-selected inspection level;
[0073] When the user triggers one-key inspection, an automated test pod is pulled up, which contains all environment dependencies required for execution of the automated test;
[0074] The automated test pod obtains domain name (host), database connection information, storage server access information, and other dependency information required for execution of the automated test from a business pod through a config-map manner;
[0075] When the user executes one-key inspection, the user can select to input a custom test account or select to use a default test account to execute the automated test one-key inspection. The test account information is passed to the backend service as a parameter of the one-key inspection interface and is finally used for parameterized construction of the automated test;
[0076] The user can select full-amount function inspection, core business function inspection, and custom business function inspection when performing one-key inspection to meet the needs of automatic test verification in different scenarios.
[0077] After pulling up the automatic test pod and obtaining the automatic test construction information, parameterized construction is performed.
[0078] Step S120: The executed use cases are divided into P0 / P1 / P2 according to the importance, different importance levels of use cases have different weights, and the inspection score is calculated according to the use case execution result and the importance level of the use case after completing the automatic test.
[0079] The automatic test use cases are divided into three levels according to the importance level.
[0080] p0: Main process of core function, basic business flow, ensure the integrity of the function, the failure of this type of use case will cause other functions to be unable to normally use, this type of use case is assigned a weight value wp0=10.
[0081] p1: Positive business flow of core function, covering all important business flows of system function, this type of use case is assigned a weight value wp1=5.
[0082] p2: Positive business flow of important function, and abnormal business flow of core function and important function, this type of use case is assigned a weight value wp2=1.
[0083] Finally, the inspection score is calculated according to the following public formula:
[0084] score=100-n p0 ×w p0 -n p1 ×w p1 -n p2 ×w p2 ,
[0085] Where np0, np1, and np2 represent the number of failed p0 / p1 / p2 use cases, respectively.
[0086] When the inspection score is negative, the inspection page displays the inspection score as 0. If the inspection score is equal to 100 points, it is considered that the current private cloud environment function is normal, otherwise it is considered that the environment exists abnormally.
[0087] Step S130: After completing the automatic test, generate an inspection report and upload it to the storage server, and check the test resources created under the test account, and delete the residual test data.
[0088] After the completion of the automated test, an automated inspection report is generated, which includes the total number of executed automated cases, the success rate of case execution, test suite information, test case information, etc., and in the test case information, all execution steps of the case are included, and all request and response information is recorded, including: http request, database sql statement request, ssh executed command, etc. For the failed case, stack information is thrown, and it is informed that which business step is executed failed, so as to help the inspection executor to locate the problem.
[0089] When the automated inspection test is executed, all resource information created by the executed case is recorded, and after the execution of a single case is completed, the resources created by the current case are cleared, and after all cases are executed, the residual test resources are again inspected and the resource cleaning is completed, and the resources that cannot be cleared after the inspection are recorded and summarized, and the result is returned to inform the inspection execution user;
[0090] Step S140: summarize the test results and inform the backend service of the test results through the callback interface, and finally display the test results on the front-end inspection page, and delete the automatic test pod to release the resources.
[0091] The summarized test results include the execution result report of the automated test case and the cleaning failure test resource summary report, and the execution result is displayed on the inspection page.
[0092] After the completion of the inspection report uploading and test data cleaning, the execution task of the automatic test pod is completed. The test pod is automatically destroyed, and the occupied resources are released.
[0093] The application executes the automatic test function based on the inspection function of the private cloud project, and is used for the business function test verification of the private cloud environment. The automatic test function in the application runs in the private cloud cluster environment, and when the pod of the automatic test service is pulled up, the environment information required for the execution of the automatic test is obtained through the config-map, such as the domain name and database information of the current environment, so that the automatic test task can be triggered without any construction parameter input by the user, the operation is simple, and the current private cloud environment basic function whether it is normal and available is intuitively and quantitatively shown to the customer;
[0094] Secondly, after the completion of the automatic test, the execution result of the case and the important level of the case are weighted and scored according to the important level of the case, and finally the inspection score is given, which can intuitively and quantitatively inform the user of the state of the current environment business function;
[0095] In addition, to avoid residual resource data caused by the running of the automated test service to the environment of the customer, the automated case records all resource data created during the execution of the case when the case is designed, inspects the resource data under the test account after the execution of all cases is completed, cleans up the residual data, and notifies the user to manually process the data that is not deleted after multiple cleanups, so as to reduce the changes of the customer environment caused by the automated test.
[0096] The above steps can be understood together with Figure 2 and Figure 3 to more clearly understand the method protected by the present application.
[0097] It should be noted that the above only describes the preferred embodiments of the present application and is not used to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
[0098] Correspondingly, the embodiment of the present application also provides a private cloud project delivery automated test device based on business inspection, which comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the steps of the method described above are realized.
[0099] Referring to Figure 2 and Figure 3 , the private cloud project delivery automated test device based on business inspection comprises a front end 10 and a back end 20. The front end 10 is used to complete the interaction with the user, including the functions of detecting the operation of the user triggering the one-key inspection, obtaining the automatic test construction information configured by the user, and displaying the inspection results. The back end 20 is used to pull up the automatic test pod and obtain the automatic test construction information from the front end to automatically execute the automatic test service 30 when the user triggers the one-key inspection function key in the health inspection interface.
[0100] It should be noted that the contents not described in detail in the specification of the present application belong to the known technology of the person skilled in the art.
Claims
1. An automated testing method for private cloud project delivery based on business inspection, characterized in that, include: Collect the current environment information required to execute automated tests, and create an automated test pod based on the current environment information. The automated test pod includes the dependency information required to execute automated tests. When a user triggers the one-click inspection function key in the health inspection interface, the automated test pod is launched and the automated test build information configured by the user is obtained to automatically execute the automated test service; the automated test build information includes test account information and function inspection type information; The automated testing service is used to automatically execute automated tests based on the automated test pod and the automated test build information, and display the inspection results on the health inspection interface. Automatically destroy the automated test pod; The execution of automated tests based on the automated test pod and the automated test build information includes: Based on the automated test pod and the automated test build information, at least one inspection case is constructed using parameterization. Execute each of the parameterized inspection cases to obtain the execution result of at least one inspection case; Based on the importance level of each inspection case that has been parameterized and constructed, and the execution result of at least one inspection case, the inspection score is calculated. The health status of the current private cloud environment's business functions is assessed based on the inspection score, and an inspection report is generated. The step of calculating the inspection score based on the importance level of each inspection case constructed with parameterization and the execution result of at least one inspection case includes: Based on the importance level of each inspection case that has been parameterized, determine the weight value of each inspection case that has been parameterized. The importance levels include: the importance level p0 of the basic business flow of the core function, the importance level p1 of the positive business flow of the core function, the positive business flow of the important function, and the importance level p2 of the abnormal business flow of the core function and the important function; the weight value corresponding to p0 is greater than the weight value corresponding to p1, and the weight value corresponding to p1 is greater than the weight value corresponding to p2; Based on the weight values of each inspection case that has been parameterized and constructed, and the execution results of at least one inspection case, the inspection score is calculated according to the following formula: , in, , , These represent the number of inspection test cases that failed to execute, with importance levels p0, p1, and p2 respectively. , , These represent the weight values corresponding to inspection cases with importance levels of p0, p1, and p2, respectively. The execution of automated tests based on the automated test pod and the automated test build information also includes: After a single inspection test case is executed, delete all test resources used by that inspection test case. After all the aforementioned inspection test cases have been executed, re-inspect the remaining test resources and complete resource cleanup; Test resources that cannot be cleared after inspection are recorded and summarized, and all test resources that failed to be cleared are displayed in the inspection report.
2. The method as described in claim 1, characterized in that, The dependency information required for executing automated tests is obtained from the business pod through config-map. The dependency information required for executing automated tests includes: the domain name host of the current environment, database connection information, and access information of the storage server.
3. The method as described in claim 1, characterized in that, The process of obtaining user-configured automated test build information includes: The system detects the custom test account information entered by the user in the test account information field displayed on the health check interface; when the user does not enter custom test account information in the test account information field, the test account information field displays the preset default account information. The system detects the function inspection type selected by the user in the function inspection type bar displayed on the health inspection interface. The function inspection type bar provides multiple function inspection type options for the user to choose from, including: full function inspection, core business function inspection, and custom business function inspection.
4. The method as described in claim 1, characterized in that, The =10, the =5, the =1.
5. The method as described in claim 1, characterized in that, The inspection report includes: the total number of inspection cases, the success rate of inspection case execution, test suite information, and inspection case information, wherein the inspection case information includes all execution steps of the inspection case; For inspection cases that fail, a stack trace will be thrown and the failed steps will be marked.
6. An automated testing device for private cloud project delivery based on business inspection, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Health inspection scheduling management method and device for cloud platform and electronic equipment
CN111026602A
Health inspection method for k8s cluster, device thereof and equipment
CN112448846A
Private cloud inspection method and device and computer readable medium
CN114510396A
UI automatic test system
CN109101428A
Method for testing OpenStack function
CN111444104A