Automatic test scheduling method, device, equipment and medium
Through the coordinated scheduling of the self-service platform and the cluster master node, combined with mirror container technology, the problem of low efficiency in large-scale automated testing is solved, efficient testing cycle and resource utilization are achieved, and it is suitable for large-scale concurrent scenarios.
Patent Information
- Application Number
- CN202511101475.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-07
- Publication Date
- 2025-10-03
AI Technical Summary
In large-scale concurrent scenarios, existing automated test scheduling methods are inefficient and can easily lead to distributed version control system jams, network port exhaustion, and insufficient server memory. Furthermore, they rely on manual configuration of the environment and cannot efficiently complete large-scale scheduling.
Initiate automated testing commands through the self-service platform, use the cluster's master node to uniformly schedule and dynamically allocate test cases, and at least one working node to execute test cases concurrently. Combined with image container technology, a standardized testing environment is created to optimize test case distribution and resource utilization.
It improves the effective utilization of resources, significantly shortens the testing cycle, realizes efficient automated test scheduling, is suitable for large-scale concurrent scenarios, and reduces network dependence and resource waste.
Smart Images

Figure CN120743783A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to an automated test scheduling method, device, equipment and medium. Background Art
[0002] When automated testing tasks need to be executed, continuous integration / continuous deployment scheduling tools are used to automatically or manually initiate pull requests to the distributed version control system (DVS). This pulls the new automated test code from the DVS to a local server or cloud server. This process ensures that the test cases and related scripts are up-to-date and consistent with the current state of the application. Using the automated testing framework or tool on the server, automated scheduling tasks are initiated according to a predefined test plan, running a series of test cases, collecting test data, and generating detailed reports. This approach is only suitable for small-scale scenarios. Scheduling a large number of test projects simultaneously can cause the DVS to freeze and potentially prevent pull requests. Furthermore, this approach relies on the network environment. When scheduling large-scale projects, network port exhaustion often results in test project failures. Furthermore, the server environment requires manual pre-configuration and prompt cleanup of data after execution. Consequently, the server often runs out of memory over time. Summary of the Invention
[0003] The present invention provides a page resource updating method, apparatus, device and medium to solve the problem of low scheduling efficiency in large-scale concurrent scenarios.
[0004] According to one aspect of the present invention, there is provided an automated test scheduling method, which is applied to a cluster, the cluster comprising a master node and at least two working nodes, including:
[0005] Receiving, through the master node, an automated test command sent from the service platform, and parsing the automated test command to obtain a test project identifier and a test case set of the test project;
[0006] Distributing the test project identifier and the test case concentration test cases to at least two target working nodes through the master node;
[0007] The target working node performs a test according to the test project identifier and the test case to obtain a test result.
[0008] According to another aspect of the present invention, there is provided an automated test scheduling device configured in a cluster, the cluster comprising a master node and at least two working nodes, including:
[0009] A command parsing module, configured to receive, through the master node, automated test commands sent from the service platform, and parse the automated test commands to obtain a test project identifier and a test case set of the test project;
[0010] A use case distribution module, configured to distribute the test project identifier and the test cases in the test case collection to at least two target working nodes through the master node;
[0011] The test execution module is used to perform a test according to the test project identifier and the test case through the target working node to obtain a test result.
[0012] According to another aspect of the present invention, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the automated test scheduling method described in any embodiment of the present invention.
[0013] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the automated test scheduling method according to any embodiment of the present invention when executed.
[0014] The embodiment of the present invention initiates automated test commands through a self-service platform, uses the master node of the cluster to uniformly schedule and dynamically allocate test cases, and at least one working node concurrently executes test cases, thereby improving the effective utilization of resources, accelerating the scheduling speed, and realizing efficient scheduling of automated tests. It is particularly suitable for large-scale scheduling scenarios and can complete high-concurrency and fast scheduling.
[0015] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0017] Figure 1 This is a flow chart of an automated test scheduling method provided by an embodiment of the present invention;
[0018] Figure 2 is a flow chart of another automated test scheduling method provided by an embodiment of the present invention;
[0019] Figure 3 This is a schematic structural diagram of an automated test scheduling device provided by an embodiment of the present invention;
[0020] Figure 4 It is a structural diagram of an electronic device for implementing the automated test scheduling method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0021] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0022] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0023] In addition, it should be noted that in the technical solution of the present invention, the collection, storage, use, processing, transmission, provision and disclosure of relevant data such as test cases are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0024] Figure 1 This is a flow chart of an automated test scheduling method provided by an embodiment of the present invention. This embodiment is applicable to automated test scheduling, especially to large-scale automated test scheduling. It is applied to a cluster, which includes a master node and at least two working nodes. The method can be executed by an automated test scheduling device, which can be implemented in the form of hardware and / or software. The device can be configured in an electronic device with corresponding data processing capabilities, such as a server. Figure 1 As shown, the method includes:
[0025] S110 , receiving the automated test command sent from the service platform through the master node, and parsing the automated test command to obtain a test project identifier and a test case set of the test project.
[0026] Among them, the self-service platform is an automated scheduling component that can coordinate and schedule various automated testing tasks and resources, monitor the execution status of test tasks, and ensure the efficient operation of the testing process. The self-service platform integrates the scheduling methods of all frameworks, and users can implement one-click scheduling according to actual needs. A cluster is composed of multiple servers or computers connected by a network to form a logically unified and potentially physically dispersed system. The cluster includes a master node and at least two worker nodes. The master node is used for global management and control. The master node can assign tasks to worker nodes based on resource requirements and policies. Worker nodes are used to perform specific tasks. Automated testing commands are instructions used to execute automated testing tasks. The test project identifier is used to identify the test project. A test case set is a collection of test cases used to test software, systems, or functions.
[0027] Specifically, a user initiates an automated test command to the self-service platform. Upon receiving the command, the cluster parses it to obtain the test project ID and test case set for the test project, allowing subsequent test execution based on the test project ID and test case set. Users can initiate automated test commands through the self-service platform, accelerating the scheduling of test tasks.
[0028] S120: Distribute the test project identifier and the test case concentration test cases to at least two target working nodes through the master node.
[0029] The target working node refers to the working node that executes the test case.
[0030] Specifically, by centralizing the test project identification and test cases and distributing the test cases to multiple target working nodes in the cluster, high concurrency and fast scheduling can be achieved, reducing dependence on external factors (such as network, number of server threads, etc.).
[0031] S130: Perform testing according to the test project identifier and the test case through the target working node to obtain a test result.
[0032] Specifically, by executing test tasks through multiple target working nodes in the cluster, the duration of the test cycle is reduced in large-scale scheduling scenarios, which greatly improves the test efficiency and is conducive to the efficient operation of the test process.
[0033] Optionally, the target working node performs testing according to the test project identifier and the test case to obtain the test result, including: obtaining the target image from the local cache based on the test project identifier through the target working node; creating an image container based on the target image; and executing the test case based on the image container to obtain the test result.
[0034] Among them, the image of the test project refers to a copy that is completely consistent with the original test environment created by virtualization technology in the field of software testing; it contains all the elements required to run the test, such as the operating system, dependent libraries, configuration files, test code and data, etc., to ensure the consistency, repeatability and efficiency of the test environment. The target image is a standardized copy of the test environment corresponding to the test project. The image container is a running instance of the image. After starting the container through the image, an independent test environment can be obtained. The embodiment of the present invention obtains the image of the test project and creates a container based on the image to execute test cases. It encapsulates the standardized test environment through virtualization technology to solve the problems of large environmental differences, low deployment efficiency, high cost and other problems in traditional testing, thereby improving test efficiency. When executing performance tests in parallel, multiple images can be started at the same time, significantly shortening the test cycle.
[0035] Optionally, after obtaining the test results, the image container may be removed from the cluster. Specifically, after the test is complete, the image container may be destroyed to quickly release resources and reduce storage pressure.
[0036] Optionally, after obtaining the test results, the process includes transmitting the test results back to the self-service platform, so that the self-service platform can summarize and display the test results to the user. Specifically, after each scheduling is completed, the test results are automatically transmitted back to the self-service platform, so that the self-service platform can summarize and display the test results to the user. Users can view the test results on the self-service platform, improving the user experience.
[0037] The embodiment of the present invention initiates automated test commands through a self-service platform, uses the master node of the cluster to uniformly schedule and dynamically allocate test cases, and at least one working node executes test cases concurrently, thereby improving the effective utilization of resources, accelerating the scheduling speed, significantly shortening the test cycle, and realizing efficient scheduling of automated tests. It is particularly suitable for large-scale scheduling scenarios and can complete high-concurrency and fast scheduling. By obtaining the image of the test project and creating a container based on the image to execute test cases, and encapsulating the standardized test environment through virtualization technology, the problems of large environmental differences, low deployment efficiency, and high cost in traditional testing are solved, the test efficiency is improved, and when executing performance tests in parallel, multiple images can be started at the same time, significantly shortening the test cycle.
[0038] Figure 2This is a flow chart of another automated test scheduling method provided by an embodiment of the present invention. Based on the above embodiment, this embodiment optimizes "distributing the test project identifier and the test case concentration test case to at least two target working nodes through the master node" and provides an optional implementation scheme. Figure 2 As shown, the method includes:
[0039] S210: Receive the automated test command sent from the service platform through the master node, parse the automated test command, and obtain the test project identifier and test case set of the test project.
[0040] S220 . The master node selects an idle working node according to the node status of the working node.
[0041] The node status of a worker node refers to its operational status, including active and idle states. The node status reflects whether the node can normally participate in cluster tasks, such as task processing and data exchange. The master node can determine the node status of a worker node based on the heartbeat sent by the worker node. Based on the worker node status, the master node determines whether the worker node is available and selects an idle worker node from all worker nodes. An idle worker node is one that is not executing tasks or has unused resources. By dynamically selecting idle worker nodes, resources such as memory and storage are fully utilized, reducing resource waste. Subsequently, tasks can be directly assigned to idle worker nodes, avoiding task queuing and accelerating task processing, providing users with an efficient and smooth service experience.
[0042] Specifically, the master node obtains the node status of the working node. If the node status is idle, the working node is determined to be an idle working node. If the node status is working, the working node is determined to be a non-idle working node.
[0043] S230. Determine whether the number of test cases in the test case set is less than or equal to the number of idle working nodes. If so, execute S240; if not, execute S260.
[0044] Specifically, if the number of use cases in the test case set is less than or equal to the number of idle working nodes, then continue to execute S240; if the number of use cases in the test case set is greater than the number of idle working nodes, then continue to execute S260.
[0045] The test case data of a test case set refers to the number of test cases in the test case set. The node count refers to the number of idle working nodes. Specifically, the number of test cases in the test case set is compared with the number of idle working nodes, and the next processing method is determined based on the comparison result.
[0046] S240: Select a target working node from the idle working nodes.
[0047] For example, if the number of test cases in a test suite and the number of idle nodes are both 5, then all 5 idle nodes will be determined as target work nodes. If the number of test cases in a test suite is 4 and the number of idle nodes is 5, then 4 idle work nodes will be randomly selected from these 5 idle work nodes as target work nodes. In this case, the number of target work nodes is the same as the number of test cases in the test suite.
[0048] S250: Distribute the test case to the target working node.
[0049] Specifically, the number of test cases in the test case set is the same as the number of target worker nodes. Each test case is randomly distributed to a target worker node, and each target worker node is assigned one test case. This ensures that each target worker node processes one test case, achieving load balancing.
[0050] S260. Split the test case set according to the number of nodes and the number of use cases to obtain sub-test case sets.
[0051] Among them, the sub-test case set is a subset of the test case set. The number of sub-test case sets is the same as the number of nodes. The sub-test case set includes at least one test case. Specifically, at this time, the number of test case sets in the test case set is greater than the number of idle working nodes, and there is at least one idle node that needs to process more than one test case. For example, the quotient obtained by dividing the number of test cases by the number of nodes can be used as the base number, and the remainder can be used as the additional number. If the number of case cases is a and the number of nodes is b, then the base number is c and the additional number is d. The number of sub-test case sets is b, and d sub-test case sets are arbitrarily selected from them. C+d test cases are allocated to the d sub-test case sets, and c sub-test case sets are allocated to the remaining sub-test case sets. Therefore, by splitting the test case set, it is beneficial to dynamically and evenly distribute the test cases to each target working node in the future, ensuring that node resources are used more efficiently, reducing resource waste, and improving testing efficiency.
[0052] S270: Set the idle working node as the target working node.
[0053] Specifically, all idle working nodes are used as target working nodes.
[0054] S280: Distribute the sub-test case set to the target working node.
[0055] Specifically, the number of sub-test case sets is equal to the number of target work nodes. Each sub-test case set is randomly distributed to a target work node, and each target work node is assigned one sub-test case set. This allows each target work node to process one sub-test case set, achieving load balancing.
[0056] S290. Perform testing according to the test project identifier and the test case through the target working node to obtain a test result.
[0057] The test result is the execution result of the test case.
[0058] Optionally, before receiving the automated test commands sent from the service platform through the master node and parsing the automated test commands to obtain the test project identifier and test case set of the test project, it also includes: building a mirror of the test project and caching the mirror to the working nodes in the cluster respectively.
[0059] Specifically, for each test project, a test project image is built. This pre-built image saves preparation time. When the test cases of the test project need to be tested, the target worker node can directly pull the test project image for subsequent operations without downloading it from the remote repository, reducing network transmission latency. Caching the images separately on worker nodes in the cluster eliminates the need to pull images from the remote repository each time, effectively avoiding congestion caused by network problems and ensuring testing efficiency.
[0060] Optionally, building an image of the test project includes: setting a scheduled task based on a distributed task scheduling platform; using an image production machine to regularly pull the source code of the test project from a distributed version control system based on the scheduled task, building a current image of the test project based on the source code, and using the current image as the target image of the test project.
[0061] Among them, the distributed task scheduling platform is used to implement functions such as scheduled tasks, task queues, and task routing. An image production machine refers to a device or software that creates, manages, and maintains images. The core function of an image production machine is to create images. A distributed version control system is a code management and collaboration tool that allows multiple developers to work on a project simultaneously in different locations, and each developer has a complete copy of the project, including the entire history. A distributed version control system can track various versions of a project. Testers can regularly pull the source code of the test project from the distributed version control system, build the current image of the test project based on the source code, and use the current image as the target image for the test project. By regularly updating the image of each test project, the failure of test cases due to outdated images can be avoided, which is conducive to improving the reliability, security, and efficiency of the testing phase.
[0062] The embodiment of the present invention ensures that memory, storage and other resources are fully utilized by dynamically selecting idle working nodes, reduces resource waste, and assigns test tasks to idle working nodes, avoids task queuing, speeds up task processing, and provides users with an efficient and smooth service experience. For each test project, a mirror image of the test project is constructed. Preparation time can be saved by pre-building the mirror image. When the test case of the test project needs to be tested, the target working node can directly pull the mirror image of the test project for subsequent operations without downloading it from a remote warehouse, thereby reducing network transmission delays. The mirror images are cached separately in the working nodes in the cluster, and there is no need to pull the mirror image from the remote warehouse each time. This can effectively avoid congestion problems caused by network problems and effectively ensure the efficiency of mirror pulling. By regularly updating the mirror image of each test project, the failure of test cases due to outdated mirror images can be avoided, which is conducive to improving the reliability, security and efficiency of the testing phase.
[0063] Figure 3 This is a structural diagram of an automated test scheduling device provided by an embodiment of the present invention. This embodiment is applicable to automated test scheduling, especially large-scale automated test scheduling, and is configured in a cluster. The cluster includes a master node and at least two working nodes. The device can be implemented in the form of hardware and / or software. The device can be configured in an electronic device with corresponding data processing capabilities, such as a server. Figure 3 As shown, the device includes:
[0064] The command parsing module 310 is used to receive the automated test command sent from the service platform through the master node, and parse the automated test command to obtain the test project identifier and test case set of the test project;
[0065] A use case distribution module 320 is configured to distribute the test project identifier and the test case set to at least two target working nodes via the master node;
[0066] The test execution module 330 is used to perform a test according to the test project identifier and the test case through the target working node to obtain a test result.
[0067] The embodiment of the present invention initiates automated test commands through a self-service platform, uses the master node of the cluster to uniformly schedule and dynamically allocate test cases, and at least one working node executes test cases concurrently, thereby improving the effective utilization of resources, accelerating the scheduling speed, significantly shortening the test cycle, and realizing efficient scheduling of automated tests. It is particularly suitable for large-scale scheduling scenarios and can complete high-concurrency and fast scheduling. By obtaining the image of the test project and creating a container based on the image to execute test cases, and encapsulating the standardized test environment through virtualization technology, the problems of large environmental differences, low deployment efficiency, and high cost in traditional testing are solved, the test efficiency is improved, and when executing performance tests in parallel, multiple images can be started at the same time, significantly shortening the test cycle.
[0068] Optionally, the test execution module 330 includes:
[0069] An image acquisition unit, configured to acquire a target image from a local cache based on a test project identifier through a target working node;
[0070] A container creation unit, used to create an image container based on the target image;
[0071] The use case execution unit is used to execute test cases based on the image container and obtain test results.
[0072] Optionally, the use case distribution module 320 includes:
[0073] An idle node selection unit, configured to select an idle working node according to the node status of the working node through the master node;
[0074] a target working node selection unit, configured to select a target working node from the idle working nodes if the number of use cases in the test case set is less than or equal to the number of idle working nodes;
[0075] The test case distribution unit is used to distribute the test cases to the target working nodes.
[0076] Optionally, the use case distribution module 320 includes:
[0077] An idle node selection unit, configured to select an idle working node according to the node status of the working node through the master node;
[0078] A sub-test case set acquisition unit is used to split the test case set according to the number of nodes and the number of cases to obtain sub-test case sets if the number of cases in the test case set is greater than the number of idle working nodes;
[0079] a target working node determining unit, configured to set an idle working node as a target working node;
[0080] The sub-test case set distribution unit is used to distribute the sub-test case set to the target working node.
[0081] Optionally, the device also includes: an image building module, which is used to receive the automated test commands sent from the service platform through the main node, parse the automated test commands, obtain the test project identifier and test case set of the test project, build the image of the test project, and cache the image to the working nodes in the cluster respectively.
[0082] Optionally, the image building module is specifically used to: set up scheduled tasks based on the distributed task scheduling platform; use the image production machine to regularly pull the source code of the test project from the distributed version control system based on the scheduled tasks, build the current image of the test project based on the source code, and use the current image as the target image of the test project.
[0083] Optionally, the device further includes: an image removal module, configured to remove the image container from the cluster after obtaining the test result.
[0084] The automated test scheduling device provided in the embodiment of the present invention can execute the automated test scheduling method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0085] Figure 4 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0086] like Figure 4As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., which is communicatively connected to the at least one processor 11. The memory stores a computer program that can be executed by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. Various programs and data required for the operation of the electronic device 10 can also be stored in the RAM 13. The processor 11, ROM 12, and RAM 13 are connected to each other via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0087] Multiple components in the electronic device 10 are connected to the I / O interface 15, including an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0088] The processor 11 can be various general-purpose and / or specialized processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the automated test scheduling method.
[0089] In some embodiments, the automated test scheduling method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the automated test scheduling method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the automated test scheduling method in any other appropriate manner (e.g., by means of firmware).
[0090] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0091] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0092] In the context of the present invention, computer-readable storage media can be tangible media that can contain or store a computer program for use with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Computer-readable storage media can include but are not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, computer-readable storage media can be machine-readable signal media. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0093] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0094] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0095] A computing system may include clients and servers. The clients and servers are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services.
[0096] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. This is not limited herein.
[0097] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.
Claims
1. An automated test scheduling method, characterized in that: Applied to a cluster, the cluster including a master node and at least two working nodes, the method includes: Receiving, through the master node, an automated test command sent from the service platform, and parsing the automated test command to obtain a test project identifier and a test case set of the test project; Distributing the test project identifier and the test case concentration test cases to at least two target working nodes through the master node; The target working node performs a test according to the test project identifier and the test case to obtain a test result.
2. The method according to claim 1, characterized in that The performing of the test according to the test project identifier and the test case by the target working node to obtain the test result includes: Obtaining a target image from a local cache based on the test project identifier through the target working node; Creating an image container based on the target image; The test case is executed based on the image container to obtain a test result.
3. The method according to claim 1, characterized in that The step of distributing the test project identifier and the test case concentration test cases to at least two target working nodes through the master node includes: The master node selects an idle working node based on the node status of the working node; If the number of test case sets is less than or equal to the number of idle working nodes, selecting a target working node from the idle working nodes; Distribute the test case to the target working node.
4. The method according to claim 1, wherein The step of distributing the test project identifier and the test case concentration test cases to at least two target working nodes through the master node includes: The master node selects an idle working node based on the node status of the working node; If the number of test cases in the test case set is greater than the number of idle working nodes, the test case set is split according to the number of nodes and the number of cases to obtain sub-test case sets; Using the idle working node as the target working node; Distribute the sub-test case set to the target working node.
5. The method according to claim 1, wherein Before receiving, by the master node, an automated test command sent from the service platform and parsing the automated test command to obtain a test project identifier and a test case set of the test project, the method further includes: Build a mirror image of the test project and cache the mirror image to the working nodes in the cluster respectively.
6. The method according to claim 5, characterized in that The mirror image of the test project is constructed, including: Set up scheduled tasks based on the distributed task scheduling platform; An image making machine is used to regularly pull the source code of the test project from a distributed version control system based on the scheduled task, a current image of the test project is constructed according to the source code, and the current image is used as the target image of the test project.
7. The method according to claim 2, characterized in that After obtaining the test results, the following steps are included: Remove the image container from the cluster.
8. An automated test scheduling device, characterized in that: Configured in a cluster, the cluster includes a master node and at least two working nodes, the device includes: A command parsing module, configured to receive, through the master node, automated test commands sent from the service platform, and parse the automated test commands to obtain a test project identifier and a test case set of the test project; A use case distribution module, configured to distribute the test project identifier and the test cases in the test case collection to at least two target working nodes through the master node; The test execution module is used to perform a test according to the test project identifier and the test case through the target working node to obtain a test result.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively coupled to the at least one processor; The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can implement the automated test scheduling method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the automated test scheduling method according to any one of claims 1 to 7 when executed.