Full-process automatic testing method and device based on distributed database
By adopting dynamic resource adjustment and dynamic scheduling of pipeline tasks in distributed database testing, the problems of waste of resources and time consumption in traditional manual creation of automated pipeline methods are solved, and faster and more accurate test results and higher testing efficiency are achieved.
Patent Information
- Application Number
- CN202510520010.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-24
- Publication Date
- 2025-05-27
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The traditional manual creation of automated pipelines has problems such as wasting resources, high time consumption and difficulty in real-time customization modifications in distributed database testing, especially when server resources are scarce.
The full-process automated testing method based on distributed database is adopted, and through dynamic resource adjustment and dynamic scheduling of pipeline tasks, the reasonable allocation of server resources and the reasonable matching of the scope of the function influence after the code is incorporated and the test scenario is achieved.
It achieves faster and more accurate test results, reduces labor and time costs, and improves testing efficiency and accuracy.
Smart Images

Figure CN120045466A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of database testing, and in particular relates to a method and device for full-process automated testing based on a distributed database. Background Art
[0002] Different nodes of a distributed database are installed on different servers. Testing a distributed database usually requires the creation of an automated pipeline, which refers to a series of steps and processes for testing a distributed database using automated tools and techniques. Since the general automated pipeline has a single configuration and cannot be customized and modified in real time, testers will manually create multiple types of automated pipelines, and then manually select the automated pipeline corresponding to the test target for pipeline testing based on business requirements.
[0003] The traditional method of manually creating automated pipelines requires a large number of servers, consumes a lot of manpower, and is time-consuming. It is inconvenient when server resources are scarce and when manually customizing test tasks.
[0004] To improve the above problems, we need to adopt an automated pipeline construction method. According to the code merged into the kernel, we need to evaluate the functions involved in this modification, automatically or manually select the test scenarios and database deployment forms of the above functions, and obtain the impact of this merge on the original database functions more quickly and accurately, and it is easier to find new problems caused by this merge. However, the automated pipeline construction method mainly faces two problems. First, the reasonable allocation of server resources when multiple automated pipelines are running concurrently; second, the reasonable matching of the functional impact range after the code is merged and the test scenario. Summary of the invention
[0005] The present invention proposes a full-process automated testing method and device based on a distributed database, which uses dynamic resource adjustment to solve the problem of reasonable allocation of server resources; enhances the relevance between database functional modules and test scenarios to achieve reasonable matching.
[0006] To achieve the above object, the technical solution of the present invention is achieved as follows: A full-process automated testing method based on a distributed database, comprising: S1, create a new visualization interface, and execute steps S2-S5 on the visualization interface; S2. Create new server resources and dynamically schedule them to execute test scenarios; S3. Create and dynamically schedule pipeline tasks; the dynamic scheduling includes adding, deleting, stopping, and priority scheduling of pipeline tasks; S4, automatically matching test scenarios for pipeline tasks and executing them; S5. Collect and analyze test results.
[0007] Furthermore, the creation and dynamic scheduling of server resources in step S2 are implemented through data tables. Dynamic scheduling includes addition, deletion, conversion of a single large server resource into multiple small server resources, conversion of multiple small server resources into a single large server resource, performance monitoring, and overall resource scheduling.
[0008] Furthermore, the dynamic scheduling of pipeline tasks in step S3 is based on performance monitoring in the dynamic scheduling of server resources.
[0009] Furthermore, the priority scheduling in step S3 includes selecting an execution order according to the urgency of the pipeline tasks when multiple pipeline tasks are executed in parallel, and executing them in sequence according to the execution order.
[0010] Furthermore, the automatic matching method in step S4 includes: Make a corresponding list of the test case code files and test scenarios according to the database function modules; The pipeline task selects the test case code file by selecting the merge number, and then selects the test scenario from the corresponding list based on the test case code file.
[0011] On the other hand, the present invention also proposes a full-process automated testing device based on a distributed database, comprising: Visualization interface component: used to create a new visualization interface and execute the following components on the visualization interface; Server resource dynamic scheduling component: creates new server resources and dynamically schedules them to execute test scenarios; Pipeline task dynamic scheduling component: create and dynamically schedule pipeline tasks; the dynamic scheduling includes adding, deleting, stopping, and priority scheduling of pipeline tasks; Test scenario running component: automatically matches test scenarios for pipeline tasks and executes them; Test result collection and analysis component: collects test results and analyzes them.
[0012] Furthermore, the creation and dynamic scheduling of server resources in the server resource dynamic scheduling component are implemented through data tables. Dynamic scheduling includes addition, deletion, conversion of a single large server resource into multiple small server resources, conversion of multiple small server resources into a single large server resource, performance monitoring, and overall resource scheduling.
[0013] Furthermore, the dynamic scheduling of pipeline tasks in the pipeline task dynamic scheduling component is based on the performance monitoring in the server resource dynamic scheduling component.
[0014] Furthermore, the priority scheduling in the server resource dynamic scheduling component includes selecting the execution order according to the urgency of the pipeline tasks when multiple pipeline tasks are executed in parallel, and executing them in sequence according to the execution order.
[0015] Furthermore, the test scenario running component includes: making a corresponding list of the correspondence between the test case code files and the test scenarios according to the database functional modules; the pipeline task dynamic scheduling component selects the test case code file by selecting the merge number, and then selects the test scenario from the corresponding list according to the test case code file.
[0016] Compared with the prior art, the present invention has the following beneficial effects: 1. The present invention uses dynamic resource adjustment to set the maximum number of concurrent executions of pipeline tasks according to the number of server resources, and also sets the number of concurrent executions of a single pipeline task, so as to maximize the utilization of all server resources to process pipeline tasks.
[0017] 2. The present invention realizes reasonable matching of code modification and test scenarios by refining database functional modules, enriching the test scenarios of each functional module, obtaining a point-to-point or point-to-many relationship list between database functional modules and test scenarios, and enhancing the relevance between database functional modules and test scenarios.
[0018] 3. The present invention realizes full-process automated testing of the database through the use of a visual interface and functional components, which facilitates operation and reduces labor costs and time costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 The figure is a schematic diagram of the full-process automated test execution process of an embodiment of the present invention. DETAILED DESCRIPTION
[0020] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.
[0021] In order to make the purpose and features of the present invention more obvious and understandable, further description is given below in conjunction with the accompanying drawings and specific embodiments.
[0022] In this embodiment, the full process of database automated testing is realized through the use of a visual interface and functional components. The main components involved include a visual interface component, a server resource dynamic scheduling component, a pipeline task dynamic scheduling component, a test scenario running component, and a test result collection and analysis component. Through the above components, a visual interface can be established, pipeline tasks can be created, test scenarios can be selected automatically or manually, and the maximum number of concurrent executions of pipeline tasks can be set, as well as the task timeout.
[0023] 1. Visual interface components: The visualization interface component provides a visualization interface, which is the execution window of all components. Other components are the executors of each specific task. Opening the visualization interface component is the prerequisite for all operations. Dynamic scheduling of server resources and dynamic scheduling of pipeline tasks are realized in the visualization interface.
[0024] 2. Server resource dynamic scheduling component: The server resource dynamic scheduling component implements dynamic scheduling of server resources, including adding new server resources, deleting existing server resources, converting a single large server resource into multiple small server resources, converting multiple small server resources into a single large server resource, overall performance monitoring of physical server resources, performance monitoring of virtual server resources, and overall server resource scheduling.
[0025] The essence of adding and deleting server resources is to maintain the resource table. Server resources are divided into physical servers and virtual servers. Both types of servers can be added or deleted in the resource table. For example, create a data table as a resource table to store resource information, including physical server resources and virtual server resources. Each resource corresponds to a table data. Adding server resources or deleting server resources is essentially the corresponding operation of adding and deleting a table data in the resource table.
[0026] Different test scenarios have different requirements for resources. In order to maximize the performance of the server, the original resources need to be adjusted to adapt to different test scenarios. Therefore, dynamic scheduling includes converting a single large server resource into multiple small server resources, and converting multiple small server resources into a single large server resource. Both large server resources and small server resources are virtualized resources. Virtualized resources are converted according to demand. After the conversion is completed, the original resource data row in the resource table will be deleted, and the latest converted resource data will be retained.
[0027] Overall performance monitoring of physical server resources refers to calling the management interface provided by the server manufacturer to directly monitor the hardware.
[0028] Virtual server resource performance monitoring refers to calling the interface provided by the virtual platform software to obtain monitoring of virtualized resources.
[0029] Overall server resource scheduling is used to schedule all physical server resources and virtual server resources, integrate the two together, and provide resource services. Its purpose is to provide the necessary resources for the execution of the matching test scenarios in the pipeline tasks.
[0030] 3. Dynamic scheduling components for pipeline tasks: The dynamic scheduling component of pipeline tasks includes adding new pipeline tasks, stopping pipeline tasks, deleting pipeline tasks, and pipeline task priority scheduling.
[0031] When adding a new pipeline task, you need to select a merge number. The merge number refers to: R&D uses git as a collaborative R&D tool. Every time R&D merges code into the git remote library, a unique number, i.e., the merge number, is generated.
[0032] The pipeline tasks are dynamically scheduled based on the overall performance monitoring of physical server resources and the performance monitoring of virtual server resources in the dynamic scheduling of server resources.
[0033] Pipeline task priority scheduling refers to the parallel execution of multiple pipeline tasks, which are executed in sequence according to the order in which the tasks are initiated. The execution order can be manually selected according to the urgency of the pipeline tasks. The pipeline task scheduling component executes the frontmost task according to the latest sorting.
[0034] 4. Test scenario running components: The test scenario running component includes executing positive test case scenarios and executing negative test case scenarios. The positive test case scenarios and negative test case scenarios include all database functional test scenarios. The test scenarios that can be selected in the component are part or all of the positive and negative scenario collections.
[0035] This involves the addition of test cases, matching and execution of test scenarios.
[0036] To add a test case, place the test case code file in a specified path, and the newly added test case in the path will be automatically read.
[0037] Make a corresponding list of the correspondence between the test case code files and the test scenarios according to the database functional modules; in the early stage, R&D personnel and testers can make a one-to-one correspondence between the code files or code paths and the test scenarios according to the functions to form a corresponding list.
[0038] The pipeline task selects and obtains the test case code file by combining the number, and then selects the test scenario from the corresponding list according to the test case code file; Execute test scenarios through shell commands.
[0039] 5. Test result collection and analysis components: The test result collection and analysis component includes the functions of collecting test case execution result sets, collating and compiling test reports.
[0040] 6: Full process automated test execution process based on the above components: In the solution proposed in this embodiment, these components are used to collaboratively complete the automatic construction of the distributed database full-process automated testing pipeline task. The main processes are as follows: Figure 1 As shown, it includes the following 6 steps: Step 1: Start the visualization interface component; Step 2. Select the new server resource in the visual interface; Step 3. Select the pipeline task to be built in the visual interface, including selecting the merge number, manually or automatically matching the test scenario, and setting the maximum number of concurrent tasks and the maximum execution time; Step 4. Click to execute the task in the visual interface; Step 5. Select performance monitoring in the visualization interface and adjust the maximum number of concurrent tasks based on the current performance evaluation. Step 6: Wait for the visualization interface to return the task results.
[0041] The six steps are explained in detail below.
[0042] Step 1: Start the visualization interface component; The visual interface component is a window for all components. It provides selectable task components and returns the execution results of other components. Enabling the visual interface component is a prerequisite for all operations. On the visual interface component, you can view all submitted merge requests, all added server resources, and all test scenarios.
[0043] Step 2. Select the new server resource in the visual interface; Select Add Server Resources, and subsequent test scenarios will be executed on all added server resources.
[0044] Step 3. Select the pipeline task to be built in the visual interface, including selecting the merge number, manually or automatically matching the test scenario, and setting the maximum number of concurrent tasks and the maximum execution time; Create a new pipeline task, select the merge number, and you can manually select the test scenario or choose automatic matching. After choosing automatic matching, you can continue to select new test scenarios (the term "continue to add test scenarios" means that after the test scenario is automatically selected, you can manually add and select some scenarios and execute them in the test scenario running component). Select the maximum number of concurrent users.
[0045] After selecting a test scenario, you can use the server resource dynamic scheduling component to generate corresponding resources and execute all test scenarios concurrently based on the minimum execution unit (i.e., the minimum functional unit, which is the product of the test case provider submitting the case, and is the description of the software and hardware resources required for the case execution) of the selected test scenario during execution. After the task starts, it can be adjusted in real time based on performance monitoring. Select the maximum execution time, and the single pipeline construction will be forced to close the pipeline task after exceeding the specified time.
[0046] Step 4. Click to execute the task in the visual interface component; Click Execute Task to start creating a task flow based on the existing task description. According to the selected test scenario, obtain the minimum execution unit and add the above contents to the pipeline scheduling queue in sequence. The server resource dynamic scheduling component obtains subtasks from the pipeline scheduling queue in sequence and allocates corresponding server resources to execute the test scenario.
[0047] Step 5. Select performance monitoring in the visualization interface and adjust the maximum number of concurrent tasks based on the current performance evaluation. During the execution of pipeline tasks, select performance monitoring to view the usage of existing server resources, and increase or decrease the maximum number of concurrent tasks based on the performance evaluation results provided by the visual interface.
[0048] Step 6: Wait for the visualization interface to return the task results; During the execution of the scenario construction task, the visualization interface will display the real-time overall progress of the task execution, the progress of the subtasks being executed concurrently, the total number of test scenarios, the number of successfully executed test scenarios, and the number of failed test scenarios according to the execution process. After the execution of the scenario construction task is completed, the visualization interface returns a summary of the task execution results and a test report description of the task.
[0049] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A full-process automated testing method based on a distributed database, characterized in that: include: S1, create a new visualization interface, and execute steps S2-S5 on the visualization interface; S2. Create new server resources and dynamically schedule them to execute test scenarios; S3. Create and dynamically schedule pipeline tasks; the dynamic scheduling includes adding, deleting, stopping, and priority scheduling of pipeline tasks; S4, automatically matching test scenarios for pipeline tasks and executing them; S5. Collect and analyze test results; In step S2, the creation and dynamic scheduling of server resources are realized through a data table. Dynamic scheduling includes adding, deleting, converting a single large server resource into multiple small server resources, converting multiple small server resources into a single large server resource, performance monitoring, and overall resource scheduling. Dynamic scheduling of pipeline tasks in step S3, based on performance monitoring in dynamic scheduling of server resources; The automatic matching method in step S4 includes: Make a corresponding list of the test case code files and test scenarios according to the database function modules; The pipeline task selects the test case code file by selecting the merge number, and then selects the test scenario from the corresponding list based on the test case code file.
2. The distributed database-based full-process automated testing method according to claim 1 is characterized in that: The priority scheduling in step S3 includes selecting the execution order according to the urgency of the pipeline tasks when multiple pipeline tasks are executed in parallel, and executing them in sequence according to the execution order.
3. A full-process automated testing device based on a distributed database, characterized in that: include: Visualization interface component: used to create a new visualization interface and execute the following components on the visualization interface; Server resource dynamic scheduling component: creates new server resources and dynamically schedules them to execute test scenarios; Pipeline task dynamic scheduling component: create and dynamically schedule pipeline tasks; the dynamic scheduling includes adding, deleting, stopping, and priority scheduling of pipeline tasks; Test scenario running component: automatically matches test scenarios for pipeline tasks and executes them; Test result collection and analysis component: collects test results and analyzes them; The creation and dynamic scheduling of server resources in the server resource dynamic scheduling component are realized through data tables. Dynamic scheduling includes adding, deleting, converting a single large server resource into multiple small server resources, converting multiple small server resources into a single large server resource, performance monitoring, and overall resource scheduling. Dynamic scheduling of pipeline tasks in the pipeline task dynamic scheduling component, based on performance monitoring in the server resource dynamic scheduling component; The test scenario running component includes: making a corresponding list of the correspondence between the test case code files and the test scenarios according to the database function modules; The pipeline task dynamic scheduling component selects the test case code file by selecting the merge number, and then selects the test scenario from the corresponding list according to the test case code file.
4. The distributed database-based full-process automated testing device according to claim 3 is characterized in that: Priority scheduling in the server resource dynamic scheduling component includes selecting the execution order based on the urgency of the pipeline tasks when multiple pipeline tasks are executed in parallel, and executing them in sequence according to the execution order.
Citation Information
Patent Citations
Database based automation parallel test platform execution method
CN105512038A
Distributed database cluster test method and device and storage medium
CN110389900A
Intelligent networking vehicle intelligent driving function cloud simulation test system and method based on DevOps
CN114647585A
Distributed storage system testing method and device, equipment and medium
CN117312082A
Visual arrangement system and method for urban rail cloud simulation test resources
CN119583347A