Service governance function test method and scene template generation method
By combining the microservice component version and service governance function test scenarios to form a test set and testing it in the test cluster, the problem of low efficiency of service governance function testing is solved, and comprehensive and efficient testing of service governance functions is achieved.
Patent Information
- Application Number
- CN202311542443.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-17
- Publication Date
- 2025-05-23
Smart Images

Figure CN120029893A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud networks, and more specifically, to a method for testing service governance functions and a method for generating scenario templates. Background Art
[0002] At present, the quality assurance and stability management of service governance functions are the pain points on the product side. When customers use microservice components, they frequently encounter problems such as unsupported versions and components, and even many serious defects such as incompatibility that cause application downtime. Based on this, it is necessary to test the service governance functions of microservice components in a timely manner. However, due to the large number of versions of microservice components, the process of building a test environment is relatively complicated, resulting in low efficiency in testing the service governance functions of microservice components.
[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0004] The embodiments of the present application provide a method for testing a service governance function and a method for generating a scenario template, so as to at least solve the technical problem of low testing efficiency of the service governance function in the related art.
[0005] According to one aspect of an embodiment of the present application, a testing method for a service governance function is provided, comprising: in response to receiving a component update instruction from a target repository, obtaining at least one version of a microservice component stored in the target repository, and a test scenario for the service governance function, wherein the microservice component is used to perform the service governance function; combining at least one version of the microservice component and the test scenario for the service governance function to obtain a test set for the service governance function; deploying the test set to a test cluster for testing to obtain a first test result for the service governance function.
[0006] According to another aspect of an embodiment of the present application, a method for generating a scenario template is also provided, including: in response to receiving a function update instruction of a service governance function, determining a scenario use case and a test code according to a test scenario of the service governance function; generating at least one scenario template for the test scenario based on the scenario use case and the test code; mirroring at least one scenario template for the test scenario to obtain at least one mirror template corresponding to the test scenario.
[0007] According to another aspect of an embodiment of the present application, a testing method for a service governance function is also provided, including: responding to an input instruction acting on an operation interface, displaying at least one version of a microservice component stored in a target warehouse and a test scenario of the service governance function on the operation interface, wherein the microservice component is used to execute the service governance function; responding to a test instruction acting on the operation interface, displaying a first test result of the service governance function on the operation interface, wherein the test set of the service governance function is obtained by combining at least one version of the microservice component and the test scenario of the service governance function.
[0008] According to another aspect of an embodiment of the present application, a testing method for a service governance function is also provided, including: obtaining at least one version of a microservice component stored in a target repository and a test scenario for the service governance function by calling a first interface, wherein the microservice component is used to execute the service governance function, and the first interface includes a first parameter, and the parameter value of the first parameter is the test scenario of at least one version of the microservice component and the service governance function; combining the test scenario of at least one version of the microservice component and the service governance function to obtain a test set of the service governance function; deploying the test set to a test cluster for testing to obtain a first test result of the service governance function; and outputting the first test result by calling a second interface, wherein the second interface includes a second parameter, and the parameter value of the second parameter is the first test result.
[0009] According to another aspect of an embodiment of the present application, an electronic device is also provided, including: a memory storing an executable program; and a processor for running the program, wherein when the program is running, a test method for the service governance function of any one of the above-mentioned embodiments is executed.
[0010] According to another aspect of an embodiment of the present application, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored executable program, wherein when the executable program is running, a testing method for controlling the device where the storage medium is located to execute the service governance function of any one of the above-mentioned embodiments.
[0011] In an embodiment of the present application, in response to receiving a component update instruction from a target warehouse, at least one version of a microservice component stored in the target warehouse and a test scenario of a service governance function are obtained, wherein the microservice component is used to perform the service governance function; at least one version of the microservice component and the test scenario of the service governance function are combined to obtain a test set of the service governance function; the test set is deployed to a test cluster for testing to obtain a first test result of the service governance function, thereby improving the test efficiency of the service governance function of the microservice component. It is easy to notice that after the component is updated, by combining at least one version of the microservice component and the test scenario of the service governance function, a test set containing the service governance function under different versions and scenarios can be obtained, so that the service governance function can be comprehensively tested through the test set, and by deploying the test set to a test cluster for testing, the test efficiency of the service governance function can be improved, thereby solving the technical problem of low test efficiency of the service governance function in the related art.
[0012] It is easy to notice that the above general description and the following detailed description are only for the purpose of exemplifying and explaining the present application, and do not constitute a limitation of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0014] Figure 1 It is a hardware structure block diagram of a computer terminal (or mobile device) for implementing a test method for a service governance function according to an embodiment of the present application;
[0015] Figure 2 is a structural block diagram of a computing environment according to an embodiment of the present application;
[0016] Figure 3 is a structural block diagram of a service grid according to an embodiment of the present application;
[0017] Figure 4 is a flow chart of a method for testing a service governance function according to Embodiment 1 of the present application;
[0018] Figure 5 is a schematic diagram of verifying grayscale flow in a grayscale environment according to an embodiment of the present application;
[0019] Figure 6 It is a structural diagram of a testing process of a service governance function according to an embodiment of the present application;
[0020] Figure 7is a flowchart of a method for generating a scene template according to Embodiment 2 of the present application;
[0021] Figure 8 is a flow chart of a method for testing a service governance function according to Embodiment 3 of the present application;
[0022] Fig. 9 is a flow chart of a method for testing a service governance function according to Embodiment 4 of the present application;
[0023] Fig.10 is a schematic diagram of a testing device for a service governance function according to Embodiment 5 of the present application;
[0024] Fig.11 is a schematic diagram of a scene template generation device according to Embodiment 6 of the present application;
[0025] Fig.12 is a schematic diagram of a testing device for a service governance function according to Embodiment 7 of the present application;
[0026] Fig.13 is a schematic diagram of a testing device for a service governance function according to Embodiment 8 of the present application;
[0027] Fig.14 It is a structural block diagram of a computer terminal according to an embodiment of the present application. DETAILED DESCRIPTION
[0028] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application 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 data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising 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.
[0030] First, some nouns or terms that appear in the description of the embodiments of the present application are subject to the following explanations:
[0031] Cloud Native can be a methodology and architectural style for designing and building applications, aiming to enable applications to run better in a cloud environment;
[0032] The service governance function (Java Agent) can be a technology that can intercept and modify bytecode before it is loaded, and modify the loaded bytecode during the operation of the virtual machine;
[0033] Microservices architecture is an approach to developing a single application as a suite of small services, each of which has its own process and uses lightweight mechanisms to communicate.
[0034] At present, many products such as Microservices Engine (MSE), Enterprise Distributed Application Service (EDAS), Serverless App Engine (SAE), Application Real-Time Monitoring Service (ARMS), and Application High Availability Service (AHAS) use service governance functions. The quality assurance and stability governance of service governance functions have become pain points on the product side. In the process of supporting customers, it was found that customers frequently encountered problems such as unsupported versions and components, and even multiple incompatibility defects that led to application downtime.
[0035] The current solution can generate a data serialization format (yaml) template based on the official image and test template to quickly implement the test process of the service governance probe code. The advantage of this solution is that during testing, the test environment can be directly constructed based on the corresponding yaml template and the generated containers can be used to automatically execute the test. There is no need to build an environment for different service points, which can save time and improve testing efficiency.
[0036] The defect of the above solution is that it is difficult to cope with the official new framework version. It needs to manually download the version image for maintenance, and it is difficult to automatically support the new version. The above solution is tested through the yaml template, but in the complex environment of service governance, there are multiple versions for the framework support on the market in recent years. Due to the different version combinations of different framework components and the calling combinations of different scenarios, a complete test needs to cover thousands of versions and scenario combinations. In such a background, it is difficult to maintain manually, resulting in low test efficiency.
[0037] In response to the above problems, there is a need for a quality assurance method that can focus on breaking through and improving the support version matrix of the core functions of the service governance function and the supporting complete quality assurance, discover and solve product problems that users will encounter when using enhanced capabilities in advance, improve the function access experience, greatly improve customer retention rate, and ensure that problems that have occurred will not reappear in subsequent releases, thereby greatly improving the stability of the service probe. This application can solve the root cause of many service governance problems from the source. According to statistics, most of the service governance functions have problems with support for different versions, such as compatibility, historical legacy, and lack of support for new versions. Problems need to be solved from the source of microservice components. The testing method for the service governance function provided in this application can automatically verify the service governance function's support matrix for different versions of microservice components involved in the market in recent years before delivering it to users, greatly reducing the testing cost of the service governance function, thereby improving the product experience.
[0038] Example 1
[0039] According to an embodiment of the present application, a testing method for a service governance function is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0040] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 1 is a hardware structure block diagram of a computer terminal (or mobile device) for implementing a test method for a service governance function according to an embodiment of the present application. Figure 1As shown, the computer terminal 10 (or mobile device) may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102, and the processor 102 may include but is not limited to a processing device such as a microprocessor (Microcontroller Unit, referred to as MCU) or a programmable logic device (Field-Programmable Gate Array, referred to as FPGA), a memory 104 for storing data, and a transmission module 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (Universal Serial Bus, USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0041] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0042] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the test method of the service governance function in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, realizing the test method of the service governance function mentioned above. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0043] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0044] The display may be, for example, a touch screen liquid crystal display (LCD), which may enable a user to interact with a user interface of the computer terminal 10 (or mobile device).
[0045] Figure 1 The hardware structure block diagram shown can be used not only as an exemplary block diagram of the above-mentioned computer terminal 10 (or mobile device), but also as an exemplary block diagram of the above-mentioned server. In an optional embodiment, Figure 2 The block diagram shows the use of the above Figure 1 The computer terminal 10 (or mobile device) shown is an embodiment of a computing node in the computing environment 201. Figure 2 is a structural block diagram of a computing environment according to an embodiment of the present application, such as Figure 2 As shown, computing environment 201 includes multiple computing nodes (such as servers) running on a distributed network (shown as 210-1, 210-2, ..., in the figure). The computing nodes all contain local processing and memory resources, and end users 202 can remotely run applications or store data in computing environment 201. Applications can be provided as multiple services 220-1, 220-2, 220-3 and 220-4 in computing environment 201, representing services "A", "D", "E" and "H" respectively.
[0046] The end user 202 can provide and access services through a web browser or other software application on the client, and in some embodiments, the end user 202's provision and / or request can be provided to the entry gateway 230. The entry gateway 230 can include a corresponding agent to handle the provision and / or request for the service (one or more services provided in the computing environment 201).
[0047] Services are provided or deployed based on various virtualization technologies supported by the computing environment 201. In some embodiments, services can be provided based on virtual machine (VM)-based virtualization, container-based virtualization, and / or similar methods. Virtual machine-based virtualization can be to simulate a real computer by initializing a virtual machine, and execute programs and applications without directly contacting any actual hardware resources. While the virtual machine virtualizes the machine, according to container-based virtualization, a container can be started to virtualize the entire operating system (OS) so that multiple workloads can run on a single operating system instance.
[0048] In an embodiment based on container virtualization, several containers of a service can be assembled into a Pod (e.g., a Kubernetes Pod). Figure 2 As shown, service 220-2 can be equipped with one or more Pods 240-1, 240-2, ..., 240-N (collectively referred to as Pods). Pods can include a proxy 245 and one or more containers 242-1, 242-2, ..., 242-M (collectively referred to as containers). One or more containers in a Pod process requests related to one or more corresponding functions of the service, and the proxy 245 generally controls network functions related to the service, such as routing, load balancing, etc. Other services can also be equipped with similar Pods.
[0049] During operation, executing a user request from end user 202 may require invoking one or more services in computing environment 201, and executing one or more functions of a service may require invoking one or more functions of another service. Figure 2 As shown, service "A" 220-1 receives a user request from end user 202 from ingress gateway 230, service "A" 220-1 may call service "D" 220-2, and service "D" 220-2 may request service "E" 220-3 to perform one or more functions.
[0050] The computing environment described above can be a cloud computing environment, where the allocation of resources is managed by the cloud service provider, allowing the development of functions without considering the implementation, adjustment or expansion of servers. The computing environment allows developers to execute code in response to events without building or maintaining complex infrastructure. Services can be divided into a set of functions that can be automatically and independently scaled, rather than expanding a single hardware device to handle potential loads.
[0051] In another optional embodiment, Figure 3 The block diagram shows the use of the above Figure 1 The computer terminal 10 (or mobile device) is shown as an embodiment of the service grid. Figure 3is a structural block diagram of a service grid according to an embodiment of the present application, such as Figure 3 As shown, the service grid 300 is mainly used to facilitate secure and reliable communication between multiple microservices. Microservices refer to decomposing an application into multiple smaller services or instances and distributing them on different clusters / machines.
[0052] like Figure 3 As shown, the microservice may include an application service instance A and an application service instance B, which form a functional application layer of the service grid 300. In one embodiment, the application service instance A runs in a machine / workload container group 314 (Pod) in the form of a container / process 308, and the application service instance B runs in a machine / workload container group 316 (Pod) in the form of a container / process 310.
[0053] In one implementation, application service instance A may be a product query service, and application service instance B may be a product ordering service.
[0054] like Figure 3 As shown, application service instance A and grid agent (sidecar) 303 coexist in machine workload container group 614, and application service instance B and grid agent 305 coexist in machine workload container 314. Grid agent 303 and grid agent 305 form the data plane layer (dataplane) of service grid 300. Among them, grid agent 303 and grid agent 305 run in the form of container / process 304 and container / process 306 respectively, and can receive request 312 for commodity query service, and grid agent 303 and application service instance A can communicate bidirectionally, and grid agent 305 and application service instance B can communicate bidirectionally. In addition, grid agent 303 and grid agent 305 can also communicate bidirectionally.
[0055] In one embodiment, the traffic of application service instance A is routed to a suitable destination through grid proxy 303, and the network traffic of application service instance B is routed to a suitable destination through grid proxy 305. It should be noted that the network traffic mentioned here includes but is not limited to Hyper Text Transfer Protocol (HTTP), Representational State Transfer (REST), high-performance, general open source framework (google Remote Procedure Call, gRPC), open source in-memory data structure storage system (Redis), etc.
[0056] In one embodiment, the function of extending the data plane layer can be realized by writing a custom filter for the proxy (Envoy) in the service grid 300. The service grid proxy configuration can be to enable the service grid to correctly proxy service traffic and realize service intercommunication and service governance. The grid proxy 303 and the grid proxy 305 can be configured to perform at least one of the following functions: service discovery, health checking, routing, load balancing, authentication and authorization, and observability.
[0057] like Figure 3 As shown, the service grid 300 also includes a control plane layer. The control plane layer can be a group of services running in a dedicated namespace, and these services are hosted by a hosting control plane component 301 in a machine / workload container group (machine / Pod) 302. Figure 3 As shown, the managed control plane component 301 performs bidirectional communication with the grid agent 303 and the grid agent 305. The managed control plane component 301 is configured to perform some control management functions. For example, the managed control plane component 301 receives telemetry data transmitted by the grid agent 303 and the grid agent 305, and can further aggregate the telemetry data. For these services, the managed control plane component 301 can also provide a user-oriented application programming interface (Application Programming Interface, API) to more easily manipulate network behavior and provide configuration data to the grid agent 303 and the grid agent 305.
[0058] Under the above operating environment, this application provides Figure 4 The testing approach for the service governance functionality shown. Figure 4 1 is a flow chart of a method for testing the service governance function according to Embodiment 1 of the present application. Figure 4 As shown, the server 10 can be connected to one or more client devices 20 via a local area network connection, a wide area network connection, an Internet connection, or other types of data networks. The client devices 20 here may include but are not limited to: smart phones, tablet computers, laptops, PDAs, personal computers, smart home devices, vehicle-mounted devices, etc. The client device 20 can interact with the user through a graphical user interface. The method includes:
[0059] Step S402, in response to receiving a component update instruction from a target repository, obtaining at least one version of a microservice component stored in the target repository and a test scenario for a service governance function.
[0060] Among them, microservice components are used to perform service governance functions.
[0061] The target warehouse mentioned above can be a central warehouse, where the central warehouse can be a public warehouse for storing and distributing various software libraries required for building projects, such as program libraries, plug-ins, and building tools. Developers can obtain the required dependencies from the central warehouse to facilitate building and managing projects. The central warehouse can be a Maven central warehouse, which provides developers with a convenient and reliable resource library, making building and deploying projects simpler and more efficient.
[0062] The above-mentioned component update instruction may be an instruction generated when a microservice component included in the target warehouse is updated.
[0063] In an optional embodiment, when the open source community releases a new version of a microservice component, the open source version manager of the open source community will push the branch to the central repository so that users can subsequently query the branch status of all new versions in the central repository and integrate the microservice component into the required project.
[0064] In another optional embodiment, a component version subscription device can be connected to the target warehouse, and the component version subscription device is used to subscribe to the version update status of the target project in the target warehouse and regularly update the configuration file of the upgraded version (Dependency Versions), wherein the target project can be a project that the user is interested in.
[0065] The Dependency Versions configuration file is a file that records the different dependent libraries and their version numbers in the project. This file can be a text file or a configuration file of the project build tool.
[0066] Furthermore, when the component version subscription device detects that the microservice component corresponding to the project that the user is interested in in the target warehouse has been updated, a component update instruction can be generated and pushed to the client where the user is located.
[0067] The above-mentioned service management function (Java Agent) can monitor, manage and control the application while the application is running. The above-mentioned service management function can improve the availability and performance of the application, automatically manage and control the application's services, and monitor the application's running status in real time to promptly discover and solve problems.
[0068] The above test scenarios can be expressed in the form of code, where the test scenarios include but are not limited to label routing scenarios, current limiting scenarios, registration center test scenarios, load balancing test scenarios, configuration management test scenarios, log and monitoring test scenarios, fault recovery test scenarios, etc. These are only examples and may also include other test scenarios.
[0069] In an optional embodiment, after the microservice components stored in the target warehouse are updated, in order to ensure the compatibility and adaptability between the microservice components and the service governance function, at least one version of the test scenario of the microservice components and the service governance function can be retrieved from the target warehouse for testing, so that the microservice components in the target warehouse can be adapted to the service governance function, so as to ensure the quality of the use of the microservice components.
[0070] Step S404: Combine the test scenarios of at least one version of the microservice component and the service governance function to obtain a test set of the service governance function.
[0071] The at least one version of the microservice component mentioned above may include the latest version of the microservice component, and may also include a historical version of the microservice component, wherein the at least one version of the microservice component may include one version of the microservice component, or may include multiple versions of the microservice component, and the specific corresponding version of the microservice component used can be set according to the actual testing requirements of the user.
[0072] In an optional embodiment, the test scenarios of at least one version of the microservice component and the service governance function can be combined with different versions, different components and different scenarios to generate a test set for comprehensively testing the service governance functions of the microservice components of different versions, thereby improving the compatibility of the microservice components of different versions with the service governance function, so that the service governance function can provide complete quality assurance for the microservice components.
[0073] In another optional embodiment, at least one version of microservice components and test scenarios can be combined by Cartesian product, and multiple test cases can be obtained for comprehensive testing of various aspects of the service governance function. Multiple test cases can be combined to obtain the above-mentioned test set. It should be noted that other combinations can also be used to combine at least one version of microservice components and test scenarios. For example, at least one version of microservice components and test scenarios can be combined by permutation combination, random combination, etc. to obtain a test set of service governance functions.
[0074] Step S406: deploy the test set to the test cluster for testing to obtain a first test result of the service governance function.
[0075] Among them, the first test result is used to characterize whether the microservice component correctly performs the service governance function.
[0076] The above-mentioned test cluster may be a cluster for deploying microservice components. The test cluster may be a container cluster, but is not limited thereto.
[0077] The above-mentioned first test result can be expressed in the form of a test report, but is not limited thereto. The first test result can also be expressed in the form of text, image, video, audio, etc.
[0078] In an optional embodiment, the test set can be deployed to the test cluster for automatic operation and generate a test report through the test pipeline test method. The test pipeline can be an automated testing method that can divide software testing into multiple stages and assign test tasks of multiple stages to different test tools and environments. The test pipeline can speed up the speed and efficiency of software testing and improve software quality.
[0079] Through the above steps, in response to receiving the component update instruction of the target warehouse, at least one version of the microservice component stored in the target warehouse and the test scenario of the service governance function are obtained, wherein the microservice component is used to perform the service governance function; the test scenario of at least one version of the microservice component and the service governance function are combined to obtain a test set of the service governance function; the test set is deployed to the test cluster for testing to obtain a first test result of the service governance function, wherein the first test result is used to characterize whether the microservice component correctly performs the service governance function, thereby improving the test efficiency of the service governance function of the microservice component. It is easy to notice that the test scenario of at least one version of the microservice component and the service governance function can be combined to obtain a test set containing the service governance function under different versions and scenarios, so as to comprehensively test the service governance function through the test set, and by deploying the test set to the test cluster for testing, the test efficiency of the service governance function is improved, thereby solving the technical problem of low test efficiency of the service governance function in the related technology.
[0080] In the above embodiments of the present application, the test scenarios of at least one version of the microservice component and the service governance function are combined to obtain a test set of the service governance function, including: obtaining at least one scenario template corresponding to the test scenario; combining at least one version of the microservice component and at least one scenario template corresponding to the test scenario to obtain a test set.
[0081] The above-mentioned test scenario may be one or more test scenarios. When the test scenario is one test scenario, one scenario template may be generated. When the test scenario is multiple test scenarios, multiple scenario templates may be generated.
[0082] In an optional embodiment, at least one scenario template corresponding to the test scenario may be generated according to the test code and scenario use cases of the test scenario.
[0083] In another optional embodiment, when R&D personnel of the service governance function develop a new test scenario, they can generate a scenario template for the new test scenario based on the test code and scenario use cases of the new test scenario, and store the scenario template for the new test scenario so that when the test scenario is needed later, they can directly retrieve the scenario template corresponding to the test scenario and use it.
[0084] Furthermore, a scenario template generating device may be provided, and when the R&D personnel of the service governance function develop a new test scenario, a new scenario template is automatically generated according to the test code and scenario use case of the test scenario.
[0085] In the above embodiment of the present application, at least one version of a microservice component and at least one scenario template corresponding to a test scenario are combined to obtain a test set, including: determining at least one mirror template corresponding to the test scenario according to at least one scenario template of the test scenario; performing a Cartesian product combination on at least one version of a microservice component and at least one mirror template to obtain a first test set; and using a namespace to isolate multiple test items in the first test set to obtain a test set.
[0086] The mirror template of the above scenario template can speed up the creation of test scenarios, reduce the workload of configuration, and ensure the stability and security of the scenarios.
[0087] In an optional embodiment, at least one scene template of the test scene can be mirrored to obtain at least one mirror version corresponding to the test scene; or the mirror version corresponding to at least one scene template can be directly retrieved. Optionally, after the scene template of the test scene is mirrored to obtain the mirror template, the mirror template can be stored in the mirror warehouse, and when the test scene needs to be used, the mirror template corresponding to the scene template of the test scene can be directly retrieved from the mirror warehouse, thereby improving the efficiency of obtaining the mirror template.
[0088] The purpose of implementing the Cartesian product combination described above is to fully obtain possible combination results.
[0089] In an optional embodiment, in the process of combining at least one version of a microservice component and at least one image template, there may be multiple different combinations. Multiple possible combination results can be generated through Cartesian product combination, so that the capabilities of the service governance function can be comprehensively tested, thereby improving the accuracy of the test.
[0090] The above-mentioned namespace is a mechanism for organizing code and avoiding naming conflicts. Namespaces can group identifiers such as classes, functions, and variables in the code and access them by using namespace qualifiers. Namespaces can be understood as a container for containing related code elements so that they can be organized and managed in the code, avoiding naming conflicts between different code elements.
[0091] The multiple test items in the first test set may be multiple test combinations. One test item may represent one test combination, and multiple test items may represent multiple test combinations.
[0092] In an optional embodiment, the first version of the microservice component and the first scenario template of the test scenario can be combined to obtain a test combination, that is, the above-mentioned test item. The first version of the microservice component and the second scenario template of the test scenario can be combined to obtain a test combination. Based on this, it can be determined that multiple versions of microservice components and multiple scenario templates of the test scenario can be combined to obtain multiple test combinations, that is, the above-mentioned multiple test items.
[0093] In another optional embodiment, multiple test items in the first test set can be isolated through a namespace so that the multiple test items can be run in the same environment while maintaining isolation between the multiple test items. This can avoid mutual influence between the multiple test items, thereby ensuring the accuracy and reliability of the test.
[0094] In another optional embodiment, the namespace can be used to implement isolation environment, isolation resources, and isolation permissions for multiple test items, wherein the isolation environment is to provide an independent environment through the namespace, so that the test items can operate in an independent environment and will not be affected by other test items, so as to ensure the independence and stability of the test items; the isolation resources are to allocate independent resources through the namespace to ensure that the test items can obtain sufficient resources to run, so as to avoid a test item occupying too many resources and causing other test items to be affected; the isolation permissions are to set permissions through the namespace to limit the operating scope of the test items and avoid mutual interference or illegal operations between multiple test items. Multiple test items can be isolated through the namespace, thereby improving the efficiency and reliability of the test and reducing the risks in the test process.
[0095] In the above embodiment of the present application, a namespace is used to isolate multiple test items in a first test set to obtain a test set, including: using a namespace to isolate multiple test items to obtain a second test set; in response to the presence of a target test item containing a target microservice component in the second test set, replacing the target microservice component in the target test item based on a preset placeholder to obtain a test set, wherein the target microservice component is a microservice component that meets preset conditions in at least one version of the microservice component; in response to the absence of a target test item containing the target microservice component in the second test set, determining that the second test set is the test set.
[0096] In an optional embodiment, the namespace may be canary-2312release-hoxtonsr12-1111, where canary-2312release-hoxtonsr12-1111 refers to the canary release scenario (canary), the release version (Spring Boot 2.3.12release version, Spring Cloud Hoxtonsr12 version), and the components (Ribbon, load balancer, Spring Cloud Gateway, Zuul) in the canary release scenario.
[0097] The target microservice component mentioned above may be a microservice component whose version is not supported by the target test item.
[0098] The above-mentioned preset condition may be that the target microservice component is not supported by the version included in the target test item.
[0099] The above-mentioned preset placeholders may be placeholders obtained by processing the target microservice component in a preset format, wherein the preset placeholders are used to indicate whether various components are required in the current version in the current scenario.
[0100] In an optional embodiment, if there is a target test item containing a target microservice component in the second test set, since the target microservice component does not support the version in the target test item, the target microservice component needs to be replaced, and the target microservice component in the target test item can be replaced by a preset placeholder so that the target test item can be successfully tested; if there is no target test item containing the target microservice component in the second test set, it means that there is no problem of version unsupported component in the second test set, and the second test set can be directly determined as the test set.
[0101] For example, the latest version (Spring Cloud) does not support the target microservice component (hystrix), so the target microservice component needs to be replaced by a preset placeholder. The preset placeholder can be expressed in the form of ${exist_hystrix}, ${exist_Load}, ${exist_Ribbon}, ${exist_zuul Gateway}, and ${exist_scg}. This is only an example, and there is no limitation on the expression of the preset placeholder.
[0102] In another optional embodiment, multiple microservice components in the second test set can be processed to obtain preset placeholders for multiple microservice components, and the preset placeholders for multiple microservice components can be used to replace the multiple microservice components, so that in the subsequent testing process, it can be selected whether to use the microservice component according to the preset placeholders.
[0103] In the above embodiment of the present application, the component update instruction is generated based on the new microservice component sent by the first client to the target warehouse.
[0104] The first client mentioned above may be a client used by R&D personnel in open source collaboration.
[0105] In an optional embodiment, when open source collaborative R&D personnel release a new version in the open source community, the new microservice components corresponding to the new version can be sent to the target warehouse for use by other personnel. Optionally, when the new microservice components are sent to the target warehouse, component update instructions can be generated to remind users to check.
[0106] In another optional embodiment, the version update status of the project of concern in the target warehouse can be subscribed through the component version subscription device. If the new microservice component sent to the target warehouse by the first client is the version of the project that the user is concerned about, the version subscription device can generate a component update instruction to remind the user to check.
[0107] In the above embodiment of the present application, the method also includes: in response to receiving a function update instruction of the service governance function, determining scenario use cases and test codes according to the test scenarios of the service governance function; and generating at least one scenario template for the test scenario based on the scenario use cases and test codes.
[0108] The above-mentioned function update instruction can be generated for the client where the developer of the service governance function is located. It can be determined that there is a new service governance function based on the function update instruction, and a scenario template corresponding to the new service governance function can be generated.
[0109] In an optional embodiment, if the R&D personnel of the service governance function develop a new test scenario for the service governance function, that is, the test scenario mentioned above, the scenario template generation device can automatically generate at least one scenario template for the test scenario based on the received scenario use case and test code of the test scenario, and can extract version placeholders of key dependencies such as ${Spring CloudVersion}, ${Spring Boot Version}, ${Ribbon Version}, etc., and can directly mirror at least one scenario template to obtain at least one mirror template corresponding to the test scenario, or mirror at least one scenario template when subsequently calling the at least one scenario template to obtain at least one mirror version corresponding to the test scenario.
[0110] In another optional embodiment, at least one scene template may be pushed to the image repository for subsequent direct calling; at least one scene template and at least one image version may also be pushed to the image repository.
[0111] In the above embodiments of the present application, at least one scenario template for a test scenario is generated based on scenario use cases and test codes, including: adding grayscale traffic to the test code to obtain a target test code; testing the target test code in a grayscale environment to obtain a second test result, wherein the second test result is used to indicate whether the target test code runs successfully in the grayscale environment; in response to the second test result being that the target test code runs successfully in the grayscale environment, generating at least one scenario template for the test scenario based on the test code and the scenario use cases; in response to the second test result being that the target test code does not run successfully in the grayscale environment, adjusting the test code, and generating at least one scenario template for the test scenario based on the adjusted test code and scenario use cases.
[0112] The above-mentioned grayscale traffic refers to directing a portion of user traffic to new functions or versions in order to test functions and performance in real scenarios.
[0113] The gray environment mentioned above may refer to an environment in which new functions or updated functions are gradually introduced to a part of users for testing in order to control and monitor the impact of new functions or updated functions during the software development and testing process.
[0114] In a grayscale environment, new or updated features will only take effect on a small number of users, while other users still use the old version of the feature. In this way, the development team can observe the actual usage of new or updated features, and promptly discover and fix possible problems to improve the quality of the software and user experience.
[0115] In an optional embodiment, grayscale traffic can be added to the test code to obtain the target test code, and the target test code can be tested in the grayscale environment. If the target test code can be closed in the grayscale environment, it means that the second test result is that the target test code can run successfully in the grayscale environment. By increasing the grayscale traffic, the functions and performance in the grayscale environment can be observed and evaluated to ensure the stability and reliability of the system in the actual production environment. It should be noted that the closed loop in the grayscale environment indicates that the grayscale traffic can be directed back to the main line to ensure the stability and reliability of the new function or version in the actual production environment.
[0116] By increasing grayscale traffic and verifying that the grayscale traffic is closed in a grayscale environment, the availability and stability of new features or versions can be ensured, and possible problems can be discovered and fixed in a timely manner, thereby improving the quality of the system and user experience.
[0117] Figure 5 is a schematic diagram of verifying grayscale flow in a grayscale environment according to an embodiment of the present application, such as Figure 5 As shown, you can construct a gateway framework application (Spring Cloud Gateway, SCG for short), microservice application A, microservice application A grayscale version, microservice application B, microservice application C, and microservice application C grayscale version according to the test scenario. After writing the test code for the scenario, you can add grayscale traffic to the test code to verify whether the grayscale traffic is closed in the grayscale environment.
[0118] In the above embodiment of the present application, the test set is deployed to the test cluster for testing to obtain a first test result of the service governance function, including: obtaining the test logic of the test set; based on the test logic, the test set is deployed to the test cluster for testing to obtain a first test result.
[0119] The above test logic may be the test logic of the service governance function pre-written by R&D personnel.
[0120] The test cluster mentioned above may be a container cluster (Kubernetes cluster), which is only used as an example here, and may also be other types of clusters.
[0121] In an optional embodiment, the test logic can be written according to the test requirements of the developer, so that the test set can be deployed to the test cluster for testing according to the test logic, thereby obtaining the first test result to meet the developer's test requirements for the test set. The specific operation method is to connect the test logic written by the developer in series to the test pipeline, and use the test pipeline to connect the test sets of various scenarios and deploy them to the Kubernates cluster, automatically verify and produce results.
[0122] In the above embodiment of the present application, the test collection is deployed to the test cluster for testing to obtain a first test result of the service governance function, including: in response to receiving the target test scenario and target test cluster sent by the second client, injecting the target test scenario in the test collection into the target test cluster for testing to obtain a third test result.
[0123] The second client mentioned above may be a client used by a tester.
[0124] The above target test scenarios can specify the scenarios that need to be tested for testers, such as link grayscale scenarios, label routing scenarios, startup failure scenarios, etc.
[0125] The target test cluster mentioned above can specify the cluster that needs to be run for the tester.
[0126] In an optional embodiment, the target test scenario in the test set can be injected into the target test cluster for running and testing to obtain the third test result; the tester can also independently write the test code and scenario use cases of the target test scenario, automatically inject the specified target test scenario into the target test cluster, cooperate with the test image set generated by the system, and isolate it through the namespace to achieve fast, efficient, and automated testing and report output. The automated pipeline system can be run, and the test report can be pulled according to the third test result for the tester to view and improve the system.
[0127] Figure 6 is a structural diagram of a test process of a service governance function according to an embodiment of the present application, such as Figure 6 As shown, there are three types of relevant personnel. The first type is R&D personnel for open source collaboration, the second type is R&D personnel for service governance functions, and the third type is testers.
[0128] Open source collaborative developers can Figure 6 When the open source community (SpringCloud, Dubbo, Sentienl) has a new version released by the community developers, the version manager (RealeaseManager) of the open source community will push the new version of the microservice component to the Maven central warehouse. Users can query the branch status of the new version in the list of the corresponding project in the Maven central warehouse, that is, the status of the microservice component. A component version subscription device can be set in the system, which can subscribe to the version update status of the project that the user cares about in the Maven central warehouse, and regularly update the configuration file of the upgraded version (Depencey Versions).
[0129] Service governance developers can Figure 6For service governance function developers, when they develop new capabilities or encounter new task pitfalls, such as label routing and new tasks that fail to start in the case of Open Fiegn+Sentinel annotation+Agent, they can write scenario test code based on the task scenario. For example, they can construct a gateway framework application (Spring Cloud Gateway), microservice application A (Spring Cloud A), microservice application A gray version (Spring Cloud AGray), microservice application B (Spring Cloud B), microservice application C (Spring Cloud C), and microservice application C gray version (Spring CloudC Gray) according to the scenario. After writing the scenario test code, you can add gray traffic to the test code to verify whether the gray traffic is closed in the gray environment.
[0130] Among them, Spring Cloud Gate way is a gateway framework based on microservice applications (Spring Cloud), which is used to build API gateways in microservice architecture; Spring Cloud A can be the name of a microservice application, representing a specific microservice A; Spring Cloud A Gray can be a solution for grayscale release on Spring Cloud A, which is used to control the testing and evaluation of new functions among some users; Spring Cloud B can be the name of another microservice application, representing a specific microservice B; Spring Cloud C can be the name of another microservice application, representing a specific microservice C; Spring Cloud C Gray can be a solution for grayscale release on Spring Cloud C, which is used to control the testing and evaluation of new functions among some users.
[0131] like Figure 6 As shown, after the scenario use case and test code are written, the scenario template generation device will automatically generate a scenario template based on the scenario use case and test code, and mirror the scenario template to obtain a mirror template. The version placeholders of key dependencies such as ${Spring Cloud Version}, ${Spring Boot Version}, and ${Ribbon Version} in the mirror template can be extracted, and automatically constructed into a deployment template (Helm template), where the Helm template is a tool for generating cluster configuration files that can help users simplify the deployment and management process of applications.
[0132] Furthermore, the image template and the upgraded version maintained by the component version subscription device can be combined by Cartesian product to automatically generate a real test scenario image version, that is, the above-mentioned test set. The test set can be automatically deployed to various scenarios of the test cluster through the test pipeline for operation, so as to test the full version.
[0133] Testers can Figure 6 For the service governance function test, if the service governance function test passes, the system can inject the specified version of the service governance function into the specified cluster, and specify the test scenario, such as the full-link grayscale scenario, label routing scenario, and service client (Open Feign) startup failure scenario. You can run the automated pipeline system and pull the test report.
[0134] The component version subscription device mentioned above in this application subscribes to the version changes of the relevant open source component central repository, and automatically updates the combined image template to generate a valid scenario test image when a new version is available. It can achieve automatic test coverage for the new version and ensure that the latest version of the components on the market is always supported before the new service governance function version is released.
[0135] The above-mentioned scenario template generation device in the present application automatically generates scenario templates and mirror templates for test scenarios, and automatically generates full-version test scenarios in conjunction with the upgraded version configuration maintained by the component version subscription device, i.e., the above-mentioned test set, which automatically covers the valid versions, components and scenarios on the market in recent years, without the need to manually maintain scenarios and test codes for each version.
[0136] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0137] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0138] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD), including a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.
[0139] Example 2
[0140] According to an embodiment of the present application, a method for generating a scene template is also provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from this.
[0141] Figure 7 is a flow chart of a method for generating a scene template according to Embodiment 2 of the present application, such as Figure 7 As shown, the method comprises the following steps:
[0142] Step S702, in response to receiving a function update instruction of the service governance function, determining a scenario use case and a test code according to a test scenario of the service governance function;
[0143] Step S704, generating at least one scenario template of the test scenario based on the scenario use case and the test code;
[0144] Step S706: mirror at least one scene template of the test scene to obtain at least one mirror template corresponding to the test scene.
[0145] The above function update instruction may be generated for the client where the developer of the service governance function is located.
[0146] In an optional embodiment, if the R&D personnel of the service governance function develop a new test scenario for the service governance function, that is, the test scenario mentioned above, the scenario template generation device can automatically generate a scenario template for the test scenario based on the received scenario use case and test code of the test scenario.
[0147] Through the above steps, in response to receiving a function update instruction of the service governance function, a scenario case and a test code are determined according to the test scenario of the service governance function; at least one scenario template of the test scenario is generated based on the scenario case and the test code; at least one scenario template of the test scenario is mirrored to obtain at least one mirror template corresponding to the test scenario, thereby improving the test efficiency of the service governance function of the microservice component. It is easy to notice that when receiving a function update instruction of the service governance function, a scenario template can be directly generated according to the scenario case and the test code of the test scenario, so that when a new version is released, it can be directly combined with the new version, and a test set containing service governance functions under different versions and scenarios can be obtained, so that the service governance function can be comprehensively tested through the test set, thereby solving the technical problem of low test efficiency of the service governance function in the related technology.
[0148] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1.
[0149] Example 3
[0150] According to an embodiment of the present application, a testing method for a service governance function is also provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from this.
[0151] Figure 8 is a flow chart of a method for testing a service governance function according to Embodiment 3 of the present application. Figure 8 As shown, the method comprises the following steps:
[0152] Step S802, in response to an input instruction acting on the operation interface, displaying at least one version of a microservice component stored in the target warehouse and a test scenario of a service governance function on the operation interface.
[0153] Among them, microservice components are used to perform service governance functions.
[0154] The above-mentioned operation interface can be used to display at least one version of the microservice component and the test scenario of the service governance function, wherein the user can generate the above-mentioned input instructions by operating the operation interface.
[0155] Step S804, in response to the test instruction acting on the operation interface, displaying the first test result of the service governance function on the operation interface.
[0156] Among them, the first test result is obtained by deploying the test set to the test cluster for testing, and the test set of the service governance function is obtained by combining at least one version of the microservice component and the test scenario of the service governance function.
[0157] The above-mentioned test instruction may be an instruction generated by a user operating an operation interface to test a test set.
[0158] Through the above steps, in response to the input instruction acting on the operation interface, at least one version of the microservice component stored in the target warehouse and the test scenario of the service governance function are displayed on the operation interface, wherein the microservice component is used to execute the service governance function; in response to the test instruction acting on the operation interface, the first test result of the service governance function is displayed on the operation interface, wherein the first test result is obtained by deploying the test set to the test cluster for testing, and the test set of the service governance function is obtained by combining at least one version of the microservice component and the test scenario of the service governance function, thereby improving the test efficiency of the service governance function of the microservice component. It is easy to notice that the test scenario of at least one version of the microservice component and the service governance function can be combined to obtain a test set containing the service governance function under different versions and scenarios, so as to comprehensively test the service governance function through the test set, and by deploying the test set to the test cluster for testing, the test efficiency of the service governance function is improved, thereby solving the technical problem of low test efficiency of the service governance function in the related technology.
[0159] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1.
[0160] Example 4
[0161] According to an embodiment of the present application, a testing method for a service governance function is also provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from this.
[0162] Fig. 9 is a flow chart of a method for testing a service governance function according to Embodiment 4 of the present application. Fig. 9 As shown, the method comprises the following steps:
[0163] Step S902: Obtain at least one version of a microservice component stored in a target repository and a test scenario for a service governance function by calling a first interface.
[0164] The microservice component is used to execute the service governance function, the first interface includes a first parameter, and the parameter value of the first parameter is a test scenario of at least one version of the microservice component and the service governance function.
[0165] The first interface in the above steps can be an interface for data interaction between the cloud server and the client. The client can pass at least one version of the test scenario of the microservice component and the service governance function into the interface function as the first parameter of the interface function to achieve the purpose of uploading the access request to the cloud server.
[0166] Step S904: Combine the test scenarios of at least one version of the microservice component and the service governance function to obtain a test set of the service governance function.
[0167] Step S906: deploy the test set to the test cluster for testing, and obtain a first test result of the service governance function.
[0168] Among them, the first test result is used to characterize whether the microservice component correctly performs the service governance function.
[0169] Step S908: output the first test result by calling the second interface.
[0170] The second interface includes a second parameter, and a parameter value of the second parameter is the first test result.
[0171] The above-mentioned second interface can be an interface for data interaction between the cloud server and the client. The cloud server can pass the first test result to the interface function as the second parameter of the interface function to achieve the purpose of sending the first test result to the client.
[0172] Through the above steps, at least one version of the microservice component stored in the target warehouse and the test scenario of the service governance function are obtained by calling the first interface, wherein the microservice component is used to perform the service governance function, the first interface includes a first parameter, and the parameter value of the first parameter is the test scenario of the microservice component and the service governance function of at least one version; the test scenario of the microservice component and the service governance function of at least one version is combined to obtain a test set of the service governance function; the test set is deployed to the test cluster for testing to obtain a first test result of the service governance function, wherein the first test result is used to characterize whether the microservice component correctly performs the service governance function; the first test result is output by calling the second interface, wherein the second interface includes a second parameter, and the parameter value of the second parameter is the first test result, thereby improving the test efficiency of the service governance function of the microservice component. It is easy to notice that the test scenarios of at least one version of the microservice component and the service governance function can be combined to obtain a test set containing the service governance function under different versions and scenarios, so as to comprehensively test the service governance function through the test set, and by deploying the test set to the test cluster for testing, the test efficiency of the service governance function is improved, thereby solving the technical problem of low test efficiency of the service governance function in the related technology.
[0173] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1.
[0174] Example 5
[0175] According to an embodiment of the present application, a testing device for a service governance function for implementing the above-mentioned testing method for a service governance function is also provided. Fig.10 is a schematic diagram of a testing device for a service governance function according to Embodiment 5 of the present application, such as Fig.10 As shown, the device 1000 includes: an acquisition module 1002 , a combination module 1004 , and a testing module 1006 .
[0176] Among them, the acquisition module is used to respond to the component update instruction received from the target warehouse, obtain at least one version of the microservice component stored in the target warehouse, and the test scenario of the service governance function, wherein the microservice component is used to perform the service governance function; the combination module is used to combine at least one version of the microservice component and the test scenario of the service governance function to obtain a test set of the service governance function; the testing module is used to deploy the test set to the test cluster for testing, and obtain the first test result of the service governance function.
[0177] It should be noted that the acquisition module 1002, the combination module 1004, and the test module 1006 correspond to steps S402 to S406 in Example 1, and the three modules and the corresponding steps implement the same examples and application scenarios, but are not limited to the contents disclosed in the above-mentioned Example 1. It should be noted that the above-mentioned modules or units can be hardware components or software components stored in a memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n), and the above-mentioned modules can also be run in the computer terminal 10 provided in Example 1 as part of the device.
[0178] In the above embodiments of the present application, the combination module is also used to obtain at least one scenario template corresponding to the test scenario, and combine at least one version of the microservice component and at least one scenario template corresponding to the test scenario to obtain a test set.
[0179] In the above embodiment of the present application, the combination module is also used to determine at least one mirror template corresponding to the test scenario based on at least one scenario template of the test scenario, perform Cartesian product combination on at least one version of the microservice component and at least one mirror template to obtain a first test set, and use the namespace to isolate multiple test items in the first test set to obtain a test set.
[0180] In the above embodiment of the present application, the combination module is also used to isolate multiple test items using a namespace to obtain a second test set. In response to the presence of a target test item containing a target microservice component in the second test set, the target microservice component in the target test item is replaced based on a preset placeholder to obtain a test set, wherein the target microservice component is a microservice component that meets preset conditions in at least one version of the microservice component.
[0181] In the above embodiment of the present application, the component update instruction is generated based on the new microservice component sent by the first client to the target warehouse.
[0182] In the above embodiments of the present application, the device further includes: a determination module, a generation module, and a mirroring module.
[0183] Among them, the determination module is used to determine the scenario use case and test code according to the test scenario of the service governance function in response to receiving the function update instruction of the service governance function; the generation module is used to generate at least one scenario template of the test scenario based on the scenario use case and the test code; the mirroring module is used to mirror at least one scenario template of the test scenario to obtain at least one mirror template corresponding to the test scenario.
[0184] In the above embodiments of the present application, the generation module is also used to add grayscale traffic to the test code to obtain the target test code, test the target test code in the grayscale environment, and obtain a second test result, wherein the second test result is used to indicate whether the target test code runs successfully in the grayscale environment. In response to the second test result that the target test code runs successfully in the grayscale environment, at least one scenario template of the test scenario is generated based on the test code and the scenario case. In response to the second test result that the target test code does not run successfully in the grayscale environment, the test code is adjusted, and at least one scenario template of the test scenario is generated based on the adjusted test code and the scenario case.
[0185] In the above embodiment of the present application, the test module is also used to obtain the test logic of the test set, deploy the test set to the test cluster for testing based on the test logic, and obtain the first test result.
[0186] In the above embodiment of the present application, the test module is also used to inject the target test scenario in the test set into the target test cluster for testing in response to receiving the target test scenario and target test cluster sent by the second client, so as to obtain a third test result.
[0187] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1.
[0188] Example 6
[0189] According to an embodiment of the present application, a scene template generation device for implementing the above-mentioned scene template generation method is also provided. Fig.11 is a schematic diagram of a scene template generation device according to Example 6 of the present application, such as Fig.11 As shown, the device 1100 includes: a determination module 1102 , a generation module 1104 , and a mirroring module 1106 .
[0190] Among them, the determination module is also used to determine the scenario use case and test code according to the test scenario of the service governance function in response to receiving the function update instruction of the service governance function; the generation module is also used to generate at least one scenario template of the test scenario based on the scenario use case and the test code; the mirroring module is also used to mirror at least one scenario template of the test scenario to obtain at least one mirror template corresponding to the test scenario.
[0191] It should be noted here that the above-mentioned determination module 1102, generation module 1104, and mirroring module 1106 correspond to steps S702 to S706 in Example 2, and the three modules and the corresponding steps implement the same examples and application scenarios, but are not limited to the contents disclosed in the above-mentioned Example 1. It should be noted that the above-mentioned modules or units can be hardware components or software components stored in a memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n), and the above-mentioned modules can also be part of the device and can be run in the computer terminal 10 provided in Example 1.
[0192] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1.
[0193] Example 7
[0194] According to an embodiment of the present application, a testing device for a service governance function for implementing the above-mentioned testing method for a service governance function is also provided. Fig.12 is a schematic diagram of a testing device for a service governance function according to Embodiment 7 of the present application, such as Fig.12 As shown, the device 1200 includes: a first display module 1202 and a second display module 1204 .
[0195] Among them, the first display module is used to respond to input instructions acting on the operation interface, and display at least one version of the microservice component stored in the target warehouse and the test scenario of the service governance function on the operation interface, wherein the microservice component is used to execute the service governance function; the second display module is used to respond to the test instructions acting on the operation interface, and display the first test result of the service governance function on the operation interface, wherein the first test result is obtained by deploying the test set to the test cluster for testing, and the test set of the service governance function is obtained by combining at least one version of the microservice component and the test scenario of the service governance function.
[0196] It should be noted that the first display module 1202 and the second display module 1204 correspond to steps S802 to S804 in Embodiment 3, and the examples and application scenarios implemented by the two modules and the corresponding steps are the same, but are not limited to the contents disclosed in Embodiment 1. It should be noted that the modules or units may be hardware components or software components stored in a memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n), and the modules may also be part of a device and run in the computer terminal 10 provided in Embodiment 1.
[0197] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1.
[0198] Example 8
[0199] According to an embodiment of the present application, a testing device for a service governance function for implementing the above-mentioned testing method for a service governance function is also provided. Fig.13 is a schematic diagram of a testing device for a service management function according to Embodiment 8 of the present application, such as Fig.13 As shown, the device 1300 includes: an acquisition module 1302 , a combination module 1304 , a test module 1306 , and an output module 1308 .
[0200] Among them, the acquisition module is used to obtain at least one version of the microservice component stored in the target warehouse and the test scenario of the service governance function by calling the first interface, wherein the microservice component is used to execute the service governance function, and the first interface includes a first parameter, and the parameter value of the first parameter is the test scenario of at least one version of the microservice component and the service governance function; the combination module is used to combine the test scenario of at least one version of the microservice component and the service governance function to obtain a test set of the service governance function; the testing module is used to deploy the test set to the test cluster for testing to obtain a first test result of the service governance function; the output module is used to output the first test result by calling the second interface, wherein the second interface includes a second parameter, and the parameter value of the second parameter is the first test result.
[0201] It should be noted that the acquisition module 1302, the combination module 1304, the test module 1306, and the output module 1308 correspond to steps S902 to S908 in Example 4, and the four modules and the corresponding steps implement the same examples and application scenarios, but are not limited to the contents disclosed in the above-mentioned Example 1. It should be noted that the above-mentioned modules or units can be hardware components or software components stored in a memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n), and the above-mentioned modules can also be run in the computer terminal 10 provided in Example 1 as part of the device.
[0202] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1.
[0203] Example 9
[0204] The embodiment of the present application may provide a computer terminal, which may be any computer terminal device in a computer terminal group. Optionally, in this embodiment, the computer terminal may also be replaced by a terminal device such as a mobile terminal.
[0205] Optionally, in this embodiment, the computer terminal may be located in at least one network device among a plurality of network devices of the computer network.
[0206] In this embodiment, the above-mentioned computer terminal can execute the program code of the following steps in the testing method of the service governance function: in response to receiving a component update instruction from the target warehouse, obtain at least one version of the microservice component stored in the target warehouse, and the test scenario of the service governance function, wherein the microservice component is used to perform the service governance function; combine at least one version of the microservice component and the test scenario of the service governance function to obtain a test set of the service governance function; deploy the test set to the test cluster for testing to obtain a first test result of the service governance function.
[0207] Optionally, Fig.14 is a structural block diagram of a computer terminal according to an embodiment of the present application. Fig.14 As shown, the computer terminal A may include: one or more (only one is shown in the figure) processors 102, a memory 104, a storage controller, and a peripheral interface, wherein the peripheral interface is connected to a radio frequency module, an audio module, and a display.
[0208] Among them, the memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the test method and device of the service governance function in the embodiment of the present application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the test method of the service governance function mentioned above. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the terminal A via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0209] The processor can call the information and application programs stored in the memory through the transmission device to perform the following steps: in response to receiving a component update instruction from the target warehouse, obtain at least one version of the microservice component stored in the target warehouse, and a test scenario for the service governance function, wherein the microservice component is used to perform the service governance function; combine at least one version of the microservice component and the test scenario for the service governance function to obtain a test set for the service governance function; deploy the test set to a test cluster for testing to obtain a first test result for the service governance function.
[0210] Optionally, the processor may also execute the program code of the following steps: obtaining at least one scenario template corresponding to the test scenario; combining at least one version of a microservice component and at least one scenario template corresponding to the test scenario to obtain a test set.
[0211] Optionally, the processor may also execute the program code of the following steps: determining at least one mirror template corresponding to the test scenario based on at least one scenario template of the test scenario; performing Cartesian product combination on at least one version of a microservice component and at least one mirror template to obtain a first test set; and isolating multiple test items in the first test set using a namespace to obtain a test set.
[0212] Optionally, the processor may also execute program code of the following steps: isolating multiple test items using a namespace to obtain a second test set; in response to the presence of a target test item containing a target microservice component in the second test set, replacing the target microservice component in the target test item based on a preset placeholder to obtain a test set, wherein the target microservice component is a microservice component that meets preset conditions in at least one version of the microservice component.
[0213] Optionally, the processor may further execute program code of the following steps: a component update instruction is generated based on a new microservice component sent by the first client to the target warehouse.
[0214] Optionally, the processor may also execute program code for the following steps: in response to receiving a function update instruction for a service governance function, determining a scenario use case and a test code according to a test scenario for the service governance function; generating at least one scenario template for the test scenario based on the scenario use case and the test code; and mirroring at least one scenario template for the test scenario to obtain at least one mirror template corresponding to the test scenario.
[0215] Optionally, the processor may also execute program code for the following steps: adding grayscale traffic to the test code to obtain a target test code; testing the target test code in a grayscale environment to obtain a second test result, wherein the second test result is used to indicate whether the target test code runs successfully in the grayscale environment; in response to the second test result being that the target test code runs successfully in the grayscale environment, generating at least one scenario template for the test scenario based on the test code and scenario use cases; in response to the second test result being that the target test code does not run successfully in the grayscale environment, adjusting the test code, and generating at least one scenario template for the test scenario based on the adjusted test code and scenario use cases.
[0216] Optionally, the processor may further execute program code of the following steps: obtaining the test logic of the test set; and deploying the test set to a test cluster for testing based on the test logic to obtain a first test result.
[0217] Optionally, the processor may further execute program code of the following steps: in response to receiving the target test scenario and the target test cluster sent by the second client, inject the target test scenario in the test set into the target test cluster for testing to obtain a third test result.
[0218] The processor can call the information and application programs stored in the memory through the transmission device to perform the following steps: in response to receiving a function update instruction of the service governance function, determine the scenario use case and test code according to the test scenario of the service governance function; generate at least one scenario template of the test scenario based on the scenario use case and the test code; mirror at least one scenario template of the test scenario to obtain at least one mirror template corresponding to the test scenario.
[0219] The processor can call the information and application programs stored in the memory through the transmission device to perform the following steps: responding to input instructions acting on the operation interface, displaying at least one version of the microservice component stored in the target warehouse and the test scenario of the service governance function on the operation interface, wherein the microservice component is used to perform the service governance function; responding to the test instructions acting on the operation interface, displaying the first test result of the service governance function on the operation interface, wherein the first test result is obtained by deploying the test set to the test cluster for testing, and the test set of the service governance function is obtained by combining at least one version of the microservice component and the test scenario of the service governance function.
[0220] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: obtain at least one version of the microservice component stored in the target warehouse and the test scenario of the service governance function by calling the first interface, wherein the microservice component is used to perform the service governance function, and the first interface includes a first parameter, and the parameter value of the first parameter is the test scenario of at least one version of the microservice component and the service governance function; combine the test scenario of at least one version of the microservice component and the service governance function to obtain a test set of the service governance function; deploy the test set to the test cluster for testing to obtain a first test result of the service governance function; output the first test result by calling the second interface, wherein the second interface includes a second parameter, and the parameter value of the second parameter is the first test result.
[0221] According to an embodiment of the present application, in response to receiving a component update instruction from a target warehouse, at least one version of a microservice component stored in the target warehouse and a test scenario of a service governance function are obtained, wherein the microservice component is used to perform the service governance function; at least one version of the microservice component and the test scenario of the service governance function are combined to obtain a test set of the service governance function; the test set is deployed to a test cluster for testing to obtain a first test result of the service governance function, thereby improving the test efficiency of the service governance function of the microservice component. It is easy to notice that the test scenario of at least one version of the microservice component and the service governance function can be combined to obtain a test set containing the service governance function under different versions and scenarios, so that the service governance function can be comprehensively tested through the test set, and the test set is deployed to a test cluster for testing, thereby improving the test efficiency of the service governance function, thereby solving the technical problem of low test efficiency of the service governance function in the related art.
[0222] It can be understood by those skilled in the art that Fig.14 The structure shown is for illustration only, and the computer terminal may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, or other terminal devices. Fig.14 It does not limit the structure of the above electronic device. For example, the computer terminal A may also include Fig.14 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Fig.14 Different configurations are shown.
[0223] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0224] Example 4
[0225] The embodiment of the present application further provides a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the test method of the service governance function provided in the first embodiment.
[0226] Optionally, in this embodiment, the above storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.
[0227] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: in response to receiving a component update instruction from a target repository, obtaining at least one version of a microservice component stored in the target repository, and a test scenario for a service governance function, wherein the microservice component is used to perform the service governance function; combining at least one version of the microservice component and the test scenario for the service governance function to obtain a test set for the service governance function; deploying the test set to a test cluster for testing to obtain a first test result for the service governance function.
[0228] Optionally, the storage medium is also configured to store program code for executing the following steps: obtaining at least one scenario template corresponding to the test scenario; combining at least one version of a microservice component and at least one scenario template corresponding to the test scenario to obtain a test set.
[0229] Optionally, the storage medium is also configured to store program code for executing the following steps: determining at least one mirror template corresponding to the test scenario based on at least one scenario template of the test scenario; performing a Cartesian product combination on at least one version of a microservice component and at least one mirror template to obtain a first test set; and isolating multiple test items in the first test set using a namespace to obtain a test set.
[0230] Optionally, the storage medium is also configured to store program code for executing the following steps: isolating multiple test items using a namespace to obtain a second test set; in response to the presence of a target test item containing a target microservice component in the second test set, replacing the target microservice component in the target test item based on a preset placeholder to obtain a test set, wherein the target microservice component is a microservice component that meets preset conditions in at least one version of the microservice component.
[0231] Optionally, the processor may further execute program code of the following steps: a component update instruction is generated based on a new microservice component sent by the first client to the target warehouse.
[0232] Optionally, the storage medium is also configured to store program code for executing the following steps: in response to receiving a function update instruction of the service governance function, determining scenario use cases and test codes according to the test scenarios of the service governance function; generating at least one scenario template for the test scenario based on the scenario use cases and the test codes; and mirroring at least one scenario template for the test scenario to obtain at least one mirror template corresponding to the test scenario.
[0233] Optionally, the storage medium is also configured to store program code for executing the following steps: adding grayscale traffic to the test code to obtain a target test code; testing the target test code in a grayscale environment to obtain a second test result, wherein the test result is used to indicate whether the target test code runs successfully in the grayscale environment; in response to the second test result being that the target test code runs successfully in the grayscale environment, generating at least one scenario template for the test scenario based on the test code and scenario use cases; in response to the second test result being that the target test code does not run successfully in the grayscale environment, adjusting the test code and generating at least one scenario template for the test scenario based on the adjusted test code and scenario use cases.
[0234] Optionally, the storage medium is further configured to store program codes for executing the following steps: obtaining the test logic of the test set; deploying the test set to a test cluster for testing based on the test logic to obtain a first test result.
[0235] Optionally, the storage medium is further configured to store program code for executing the following steps: in response to receiving a target test scenario and a target test cluster sent by the second client, injecting the target test scenario in the test set into the target test cluster for testing to obtain a third test result.
[0236] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: in response to receiving a function update instruction of the service governance function, determining a scenario use case and a test code according to a test scenario of the service governance function; generating at least one scenario template for the test scenario based on the scenario use case and the test code; and mirroring at least one scenario template for the test scenario to obtain at least one mirror template corresponding to the test scenario.
[0237] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: in response to input instructions acting on an operation interface, displaying at least one version of a microservice component stored in a target warehouse and a test scenario of a service governance function on the operation interface, wherein the microservice component is used to perform the service governance function; in response to a test instruction acting on the operation interface, displaying a first test result of the service governance function on the operation interface, wherein the first test result is obtained by deploying a test set to a test cluster for testing, and the test set of the service governance function is obtained by combining at least one version of a microservice component and a test scenario of the service governance function.
[0238] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: obtaining at least one version of a microservice component stored in a target repository and a test scenario for a service governance function by calling a first interface, wherein the microservice component is used to perform the service governance function, and the first interface includes a first parameter, and a parameter value of the first parameter is a test scenario for at least one version of the microservice component and the service governance function; combining at least one version of the test scenario for the microservice component and the service governance function to obtain a test set for the service governance function; deploying the test set to a test cluster for testing to obtain a first test result for the service governance function; and outputting the first test result by calling a second interface, wherein the second interface includes a second parameter, and a parameter value of the second parameter is the first test result.
[0239] According to an embodiment of the present application, in response to receiving a component update instruction from a target warehouse, at least one version of a microservice component stored in the target warehouse and a test scenario of a service governance function are obtained, wherein the microservice component is used to perform the service governance function; at least one version of the microservice component and the test scenario of the service governance function are combined to obtain a test set of the service governance function; the test set is deployed to a test cluster for testing to obtain a first test result of the service governance function, thereby improving the test efficiency of the service governance function of the microservice component. It is easy to notice that the test scenario of at least one version of the microservice component and the service governance function can be combined to obtain a test set containing the service governance function under different versions and scenarios, so that the service governance function can be comprehensively tested through the test set, and the test set is deployed to a test cluster for testing, thereby improving the test efficiency of the service governance function, thereby solving the technical problem of low test efficiency of the service governance function in the related art.
[0240] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0241] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0242] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0243] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0244] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0245] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.
[0246] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A testing method for service governance functions, It is characterized in that include: In response to receiving a component update instruction from a target warehouse, obtaining at least one version of a microservice component stored in the target warehouse and a test scenario of a service governance function, wherein the microservice component is used to perform the service governance function; Combining the at least one version of the microservice component and the test scenario of the service governance function to obtain a test set of the service governance function; The test set is deployed to a test cluster for testing to obtain a first test result of the service governance function.
2. The method according to claim 1, It is characterized in that Combining the at least one version of the microservice component and the test scenario of the service governance function to obtain a test set of the service governance function includes: Obtaining at least one scenario template corresponding to the test scenario; The at least one version of the microservice component and the at least one scenario template corresponding to the test scenario are combined to obtain the test set.
3. The method according to claim 2, It is characterized in that Combining the at least one version of the microservice component and the at least one scenario template corresponding to the test scenario to obtain the test set includes: Determine, according to at least one scene template of the test scene, at least one mirror template corresponding to the test scene; Performing a Cartesian product combination on the at least one version of the microservice component and the at least one image template to obtain a first test set; The multiple test items in the first test set are isolated by using a namespace to obtain the test set.
4. The method according to claim 3, It is characterized in that The multiple test items in the first test set are isolated by using a namespace to obtain the test set, including: Isolating the multiple test items by using the namespace to obtain a second test set; In response to the presence of a target test item containing a target microservice component in the second test set, the target microservice component in the target test item is replaced based on a preset placeholder to obtain the test set, wherein the target microservice component is a microservice component that meets preset conditions in the at least one version of the microservice component.
5. The method according to claim 1, It is characterized in that The component update instruction is generated based on a new microservice component sent by the first client to the target warehouse.
6. The method according to claim 3, It is characterized in that The method further comprises: In response to receiving a function update instruction of the service governance function, determining a scenario use case and a test code according to a test scenario of the service governance function; The at least one scenario template is generated based on the scenario use case and the test code.
7. The method according to claim 6, It is characterized in that Generating at least one scenario template of the test scenario based on the scenario use case and the test code, including: Adding grayscale flow to the test code to obtain a target test code; Testing the target test code in a grayscale environment to obtain a second test result, wherein the second test result is used to indicate whether the target test code is successfully executed in the grayscale environment; In response to the second test result being that the target test code is successfully run in the grayscale environment, generating at least one scenario template of the test scenario based on the test code and the scenario use case; In response to the second test result that the target test code is not successfully executed in the grayscale environment, the test code is adjusted, and at least one scenario template of the test scenario is generated based on the adjusted test code and the scenario case.
8. The method according to claim 1, It is characterized in that Deploying the test set to a test cluster for testing to obtain a first test result of the service governance function includes: Obtaining the test logic of the test set; The test set is deployed to the test cluster for testing based on the test logic to obtain the first test result.
9. The method according to claim 1, It is characterized in that Deploying the test set to a test cluster for testing to obtain a first test result of the service governance function includes: In response to receiving the target test scenario and the target test cluster sent by the second client, the target test scenario in the test set is injected into the target test cluster for testing to obtain a third test result.
10. A method for generating a scene template, It is characterized in that include: In response to receiving a function update instruction of a service governance function, determining a scenario use case and a test code according to a test scenario of the service governance function; Generate at least one scenario template for the test scenario based on the scenario use case and the test code; At least one scene template of the test scene is mirrored to obtain at least one mirror template corresponding to the test scene.
11. A testing method for service governance functions, It is characterized in that include: In response to an input instruction acting on an operation interface, displaying at least one version of a microservice component stored in a target repository and a test scenario of a service governance function on the operation interface, wherein the microservice component is used to perform the service governance function; In response to a test instruction applied to the operation interface, a first test result of the service governance function is displayed on the operation interface, wherein the first test result is obtained by deploying a test set to a test cluster for testing, and the test set of the service governance function is obtained by combining the at least one version of the microservice component and the test scenario of the service governance function.
12. A testing method for service governance functions, It is characterized in that include: Obtain at least one version of a microservice component stored in a target repository and a test scenario of a service governance function by calling a first interface, wherein the microservice component is used to execute the service governance function, and the first interface includes a first parameter, and a parameter value of the first parameter is the at least one version of the microservice component and the test scenario of the service governance function; Combining the at least one version of the microservice component and the test scenario of the service governance function to obtain a test set of the service governance function; Deploy the test set to a test cluster for testing, and obtain a first test result of the service governance function; The first test result is output by calling a second interface, wherein the second interface includes a second parameter, and a parameter value of the second parameter is the first test result.
13. An electronic device, It is characterized in that include: A memory storing an executable program; A processor is used to run the program, wherein the program, when running, executes the testing method of the service governance function described in any one of claims 1 to 12.
14. A computer-readable storage medium, It is characterized in that The computer-readable storage medium includes a stored executable program, wherein when the executable program is running, the device where the storage medium is located is controlled to execute the test method for the service governance function described in any one of claims 1 to 12.