CN114077535A - Incremental test environment deployment method, device, server and storage medium - Google Patents

Incremental test environment deployment method, device, server and storage medium Download PDF

Info

Publication number
CN114077535A
CN114077535A CN202010809837.6A CN202010809837A CN114077535A CN 114077535 A CN114077535 A CN 114077535A CN 202010809837 A CN202010809837 A CN 202010809837A CN 114077535 A CN114077535 A CN 114077535A
Authority
CN
China
Prior art keywords
test
server
environment
test environment
incremental
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010809837.6A
Other languages
Chinese (zh)
Inventor
胡镇金
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Zhenai Jieyun Information Technology Co ltd
Original Assignee
Shenzhen Zhenai Jieyun Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Zhenai Jieyun Information Technology Co ltd filed Critical Shenzhen Zhenai Jieyun Information Technology Co ltd
Priority to CN202010809837.6A priority Critical patent/CN114077535A/en
Publication of CN114077535A publication Critical patent/CN114077535A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3664Environments for testing or debugging software

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application relates to an incremental test environment deployment method, which is applied to a server and comprises the following steps: acquiring a test environment deployment request, and extracting a test requirement from the test environment deployment request; determining a test branch and a test branch name from the test requirement; generating a mirror image package based on the test branch, and pushing the mirror image package to a mirror image warehouse; acquiring a test environment name list, and judging whether the test environment name list contains the test branch name or not; if yes, obtaining an incremental test environment corresponding to the test branch name; if not, determining a target test server from a preset test server cluster, pulling the mirror image package to the target test server, and deploying the incremental test environment based on the mirror image package. The embodiment has the advantage of high user experience.

Description

Incremental test environment deployment method, device, server and storage medium
Technical Field
The present application relates to the field of testing technologies, and in particular, to a method, an apparatus, a server, and a storage medium for deploying an incremental testing environment.
Background
Micro-services (or micro-service architecture) is a cloud-native architecture approach in which a single application consists of many loosely-coupled and independently deployable smaller components or services, and with the development of electronic technology, micro-services are becoming a popular architecture in software development.
The method has the advantages that the micro-service system is realized, the number of micro-services is increased suddenly, the test environment needs to be deployed when the function requirements are iterated, each function requirement needs to be an independent test environment when the test is carried out, at present, on the problem of deploying the test environment, a set of complete test environment is generally deployed for each requirement, however, the deployment of the whole micro-service test environment needs to occupy a large number of server resources, the waste of the server resources is easily caused, the deployment workload is large, the deployment period is long, and the working efficiency is low.
Disclosure of Invention
In view of the above, it is desirable to provide an incremental test environment deployment method, an incremental test environment deployment apparatus, a server, and a storage medium, which can save server resources and improve test environment deployment efficiency.
In a first aspect, an embodiment of the present application provides an incremental test environment deployment method, which is applied to a server, and the method includes:
acquiring a test environment deployment request, and extracting a test requirement from the test environment deployment request;
determining a test branch and a test branch name from the test requirement;
generating a mirror image package based on the test branch, and pushing the mirror image package to a mirror image warehouse;
acquiring a test environment name list, and judging whether the test environment name list contains the test branch name or not;
if yes, obtaining an incremental test environment corresponding to the test branch name;
if not, determining a target test server from a preset test server cluster, pulling the mirror image package to the target test server, and deploying the incremental test environment based on the mirror image package.
In a possible embodiment, the determining a target test server from a preset test server cluster includes: obtaining a plurality of server loads corresponding to a plurality of test servers in the test server cluster; and determining the test server corresponding to the minimum value in the server loads as the target test server.
In a possible embodiment, the deploying the incremental test environment based on the mirror package includes: deploying the running environment corresponding to the mirror image package in the target test server, and marking the running environment based on the test branch name to obtain a test environment; and generating the incremental test environment through a preset full test environment and the test environment deployment request.
In a possible embodiment, the generating the incremental test environment through a preset full test environment and the test environment deployment request includes: extracting a flow access address from the test environment deployment request; generating a test interface corresponding to the flow access address; generating a load balancing server corresponding to the test interface; and establishing the test interface, the load balancing server and a call link of the test environment through the full test environment to obtain the incremental test environment.
In a possible embodiment, the generating a mirror packet based on the test branch includes: extracting mirror test code from the test branch; executing code packing operation on the mirror image test code to obtain a mirror image code packet; and marking the mirror image code packet based on the test branch name to obtain the mirror image packet.
In a second aspect, an embodiment of the present application provides an incremental test environment deployment apparatus, including:
the device comprises an acquisition unit, a test environment deployment unit and a test environment management unit, wherein the acquisition unit is used for acquiring a test environment deployment request and extracting a test requirement from the test environment deployment request;
the determining unit is used for determining a test branch and a test branch name from the test requirement;
the pushing unit is used for generating a mirror image package based on the test branch and pushing the mirror image package to a mirror image warehouse;
the judging unit is used for acquiring a test environment name list and judging whether the test environment name list contains the test branch name or not;
and the deployment unit is used for acquiring the incremental test environment corresponding to the test branch name when the test branch name is contained, determining a target test server from a preset test server cluster when the test branch name is not contained, pulling the mirror image package to the target test server, and deploying the incremental test environment based on the mirror image package.
In a possible embodiment, in the aspect of determining a target test server from a preset test server cluster, the deployment unit is specifically configured to: obtaining a plurality of server loads corresponding to a plurality of test servers in the test server cluster; and determining the test server corresponding to the minimum value in the server loads as the target test server.
In a possible embodiment, in the aspect of deploying the incremental test environment based on the mirror package, the deployment unit is specifically configured to: deploying the running environment corresponding to the mirror image package in the target test server, and marking the running environment based on the test branch name to obtain a test environment; and generating the incremental test environment through a preset full test environment and the test environment deployment request.
In a third aspect, an embodiment of the present application provides a server, including a processor, a memory, a communication device, and one or more programs, where the processor, the memory, and the communication device are connected to each other, where the communication device is configured to perform information interaction with an external device, and the one or more programs are stored in the memory and configured to be executed by the processor, and the programs include instructions for performing the steps in any of the methods of the first aspect of the embodiment of the present application.
In a fourth aspect, the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program for electronic data exchange, where the computer program makes a computer perform some or all of the steps described in the method according to the first aspect of the present application.
In a fifth aspect, the present application provides a computer program product, where the computer program product includes a non-transitory computer-readable storage medium storing a computer program, where the computer program is operable to cause a computer to perform some or all of the steps described in the method according to the first aspect of the present application. The computer program product may be a software installation package.
It can be seen that, in the embodiment of the present application, a server extracts a test requirement from a test environment deployment request by obtaining the test environment deployment request; determining a test branch and a test branch name from the test requirement; generating a mirror image package based on the test branch, and pushing the mirror image package to a mirror image warehouse; acquiring a test environment name list, and judging whether the test environment name list contains the test branch name or not; if yes, obtaining an incremental test environment corresponding to the test branch name; if not, determining a target test server from a preset test server cluster, pulling the mirror image package to the target test server, and deploying the incremental test environment based on the mirror image package. Therefore, the incremental test environment is applied to the incremental test system, the existence of the test environment can be determined through the test branch name, the incremental test environment is deployed based on the test environment and the mirror image package, the deployment workload of the test environment is reduced, the deployment period is shortened, and the work efficiency and the user experience are improved.
Drawings
FIG. 1 is an environment architecture diagram of a method for deploying an incremental test environment according to an embodiment of the present disclosure;
FIG. 2 is a flowchart illustrating a method for deploying an incremental test environment according to an embodiment of the present disclosure;
FIG. 3 is a schematic structural diagram of an incremental testing system according to an embodiment of the present disclosure;
FIG. 4 is a schematic structural diagram of another incremental testing system provided in the embodiments of the present application;
fig. 5 is a schematic structural diagram of a server 500 according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an incremental test environment deployment apparatus 600 according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first," "second," "third," and "fourth," etc. in the description and claims of this application and in the accompanying drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, result, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
The following describes embodiments of the present application in detail.
Referring to fig. 1, fig. 1 is an environment architecture diagram of an incremental test environment deployment method provided in an embodiment of the present application, and as shown in the figure, the environment architecture diagram of the incremental test environment deployment method includes a server 101 and a test server cluster 102, where the server 101 establishes a network connection with the test server cluster 102 through a network communication link, the server 101 connects with an electronic device or a server of a user through the network communication link, the server 101 receives a test environment deployment request transmitted by the user, determines a target test server in the test server cluster 102 based on the test environment deployment request, deploys a test environment in the target test server, and establishes a call link between the server 101 and the test environment in the target test server through the communication link to obtain an incremental test environment.
Referring to fig. 2, fig. 2 is a schematic flowchart of a method for deploying an incremental test environment according to an embodiment of the present application, which is applied to a server, where the server includes an incremental test system, and the method for deploying the incremental test environment includes:
step 201, acquiring a test environment deployment request, and extracting a test requirement from the test environment deployment request;
optionally, when a test environment deployment request is obtained, a traffic input address is extracted from the test environment deployment request, and a traffic interface is generated based on the traffic input address, where the traffic interface is uniquely corresponding to the traffic input address.
Optionally, the format of the test requirement may include txt, xls, doc, and the like, which is not limited again.
Step 202, determining a test branch and a test branch name from the test requirement;
optionally, after determining the test branch and the test branch name, obtaining a trunk name corresponding to the test branch, and referring to extracting a full test environment corresponding to the trunk name.
Step 203, generating a mirror image package based on the test branch, and pushing the mirror image package to a mirror image warehouse;
optionally, a test branch code is extracted based on the test branch, a preset maven plugin executes a packing operation on a mirror image code of the test branch to obtain a mirror image code packet, and the maven plugin is controlled to execute a marking operation on the mirror image code packet according to the test branch name to obtain the mirror image packet.
Step 204, obtaining a test environment name list, and judging whether the test environment name list contains the test branch name;
optionally, a test environment name list is obtained based on the full test environment, where the test environment name list includes at least one test environment name, and any one of the at least one test environment name corresponds to one incremental test environment.
And judging whether the test environment name list contains the test branch name or not through a maven plug-in.
Step 205, if yes, obtaining an incremental test environment corresponding to the test branch name;
and if the test branch name exists, extracting the incremental test environment corresponding to the test branch name through a maven plug-in.
And step 206, if not, determining a target test server from a preset test server cluster, pulling the mirror image package to the target test server, and deploying the incremental test environment based on the mirror image package.
Optionally, an API included in the Kubernetes application is called to create a test interface and a load balancing server, and the image package is pulled in the image warehouse through the API to be deployed and run.
In a possible example, the determining a target test server from a preset test server cluster includes: obtaining a plurality of server loads corresponding to a plurality of test servers in the test server cluster; and determining the test server corresponding to the minimum value in the server loads as the target test server.
And the server manages the test server cluster through Kubernets application.
For example, the test server cluster includes 3 test servers, and obtains 3 server loads corresponding to the 3 test servers, where a first load value < a third load value < a second load value, and it is determined that the first test server corresponding to the first load value is a target test server. Therefore, the target test server can be determined through the minimum load limit strategy, servers do not need to be distributed for each developer, the resource distribution of the test server is optimized, and the resource saving of the test server is facilitated.
In a possible example, the deploying the incremental test environment based on the image package includes: deploying the running environment corresponding to the mirror image package in the target test server, and marking the running environment based on the test branch name to obtain a test environment; and generating the incremental test environment through a preset full test environment and the test environment deployment request.
Optionally, the image packet is pulled from the image warehouse to the target test server by calling an API of a Kubernetes application, at least one micro service corresponding to the image packet is determined based on the image packet, the at least one micro service is deployed in the target test server, a preset full test environment is obtained, a connection between the full test environment and the at least one micro service is established, an operating environment corresponding to the image packet is obtained, and the operating environment is marked based on the test branch name, so that the test environment is obtained.
In a possible example, the generating the incremental test environment through the preset full test environment and the test environment deployment request includes: extracting a flow access address from the test environment deployment request; generating a test interface corresponding to the flow access address; generating a load balancing server corresponding to the test interface; and establishing the test interface, the load balancing server and a call link of the test environment through the full test environment to obtain the incremental test environment.
The test interface is uniquely corresponding to the flow access address, and the load balancing server is used for dyeing the flow accessed by the test interface.
And the calling link is a link which is accessed by the test interface and finally returned after the flow passes through at least one micro server.
In a possible example, the generating a mirror packet based on the test branch includes: extracting mirror test code from the test branch; executing code packing operation on the mirror image test code to obtain a mirror image code packet; and marking the mirror image code packet based on the test branch name to obtain the mirror image packet.
It can be seen that, in the embodiment of the present application, a server extracts a test requirement from a test environment deployment request by obtaining the test environment deployment request; determining a test branch and a test branch name from the test requirement; generating a mirror image package based on the test branch, and pushing the mirror image package to a mirror image warehouse; acquiring a test environment name list, and judging whether the test environment name list contains the test branch name or not; if yes, obtaining an incremental test environment corresponding to the test branch name; if not, determining a target test server from a preset test server cluster, pulling the mirror image package to the target test server, and deploying the incremental test environment based on the mirror image package. Therefore, the incremental test environment is applied to the incremental test system, the existence of the test environment can be determined through the test branch name, the incremental test environment is deployed based on the test environment and the mirror image package, the deployment workload of the test environment is reduced, the deployment period is shortened, and the work efficiency and the user experience are improved.
Referring to fig. 3, fig. 3 is a schematic structural diagram of an incremental testing system according to an embodiment of the present application, and as shown in the drawing, the system includes a traffic access layer 310, a load balancing server layer 320, a full environment layer 330, and at least one incremental testing environment layer 340, where:
the traffic access layer 310 accesses the load balancing server layer, and is configured to access traffic and send the traffic to the load balancing server layer;
the load balancing server layer 320 is accessed to the full-scale testing environment layer 330, and is configured to provide the load balancing server 320 for the traffic access layer, mark the traffic to obtain marked traffic, and send the marked traffic to the full-scale environment layer 330;
the full test environment layer 330 accesses the at least one incremental test environment layer 340, and is configured to send the marking traffic to the at least one incremental test environment layer 340, so as to provide a call environment for the at least one incremental test environment layer;
any one of the at least one incremental test environment layer 340 is configured to provide an incremental test environment, receive the marked traffic, and invoke the full test environment layer to perform a test operation.
Optionally, the traffic access layer 310 includes: the system comprises at least one test interface, at least one flow input address and at least one test interface, wherein the at least one test interface corresponds to the at least one flow input address one to one, and any one test interface in the at least one test interface is used for accessing and accessing only the flow transmitted by the flow input address corresponding to the any test interface; when accessing traffic and sending the traffic to the load balancing server layer, the traffic access layer 310 is further configured to: acquiring a traffic input address corresponding to the traffic, and determining a target test interface corresponding to the traffic input address based on a mapping relation between a preset test interface and the input address; accessing the flow through the target test interface; determining a target load balancing server corresponding to the target test interface based on a preset mapping relation between the test interface and the load balancing server; and controlling the target test interface to send the flow to the target load balancing server.
Optionally, the load balancing server layer 320 includes at least one load balancing server, and the at least one load balancing server is in one-to-one correspondence with the at least one test interface.
Optionally, the full-volume test environment layer includes an application programming interface API gateway, and in terms of sending the marked traffic to the at least one incremental test environment layer, the full-volume environment layer is specifically configured to: acquiring a flow label corresponding to the marked flow; and sending the marked flow to an incremental testing environment layer corresponding to the flow label based on the API gateway.
Optionally, in the aspect that the API gateway sends the marked traffic to the incremental test environment layer corresponding to the traffic label, the full-volume environment layer is further configured to: judging whether the incremental test environment layer receives the marked flow; and if the incremental testing environment layer does not receive the sent marked flow, determining the current node of the marked flow, generating an error response according to the current node, and returning the error response to the testing server corresponding to the incremental testing environment layer.
Optionally, in the aspect of invoking the full environment layer to execute the test operation, the incremental test environment layer is specifically configured to: acquiring the micro service corresponding to the current node marking the flow; judging whether the incremental test environment layer contains the micro service or not; and if the incremental test environment layer does not contain the micro service, sending a calling request to the full environment layer, wherein the calling request is used for calling the micro service contained in the full environment layer.
For example, as shown in fig. 4, fig. 4 is a schematic structural diagram of another incremental testing system provided in this embodiment of the present application, where a traffic access layer 310 includes three access units (a full access unit, an access unit 1, and an access unit 2), a load balancing server layer 320 includes three load balancing servers (a full load balancing server, a load balancing server 1, and a load balancing server 2), a full environment layer 330 includes a full testing environment constructed by an API gateway and four micro services (a micro service 1, a micro service 2, a micro service 3, and a micro service 4), and an incremental testing environment layer 340 includes an incremental testing environment layer 341 (zone: feature1) and an incremental testing environment layer 342 (zone: feature2), where the incremental testing environment corresponding to the incremental testing environment layer 341 includes a micro service 1 and a micro service 3; the incremental test environment corresponding to the incremental test environment layer 342 includes microservice 2 and microservice 4; as shown in the figure, the load balancing server 1 receives the traffic transmitted by the access unit 1, performs a marking operation on the traffic to obtain a marked traffic, the marked traffic has a "zone _ failure 1" label, the load balancing server 2 receives the traffic transmitted by the access unit 2, performs a marking operation on the traffic to obtain a marked traffic, and the marked traffic has a "zone _ failure 2" label; the load balancing server layer sends the marked traffic to the full server layer, the API gateway of the full server layer receives the marked traffic, and splits the traffic according to the traffic tag corresponding to the marked traffic, that is, the marked traffic with the traffic tag "zone-feature 1" is sent to the incremental testing environment layer 341, and the marked traffic with the traffic tag "zone-feature 2" is sent to the incremental testing environment layer 342; the incremental test environment layer 341 receives the flag traffic, runs the incremental test environment "zone: feature1 ", after the marked traffic passes through microservice 1, detecting that the incremental test environment does not contain microservice 2, and operating the invoking link of incremental test environment layer 341 and full test environment layer to invoke microservice 2 in full test environment; the incremental test environment layer 342 receives the marker traffic, runs the incremental test environment "zone: feature2 ", which detects the incremental test environment" zone: the micro service 4 in the feature2 ″ does not receive the micro service 4, generates an error response according to the incremental test environment layer 342 and the micro service 4, and returns the error response to the test server corresponding to the incremental test environment layer 342.
Therefore, the incremental test system can comprise a plurality of incremental test environments, wherein the incremental test environments can run simultaneously, and the traffic routing function is realized through a plurality of traffic access layers and a load balancing server layer to realize the parallel running of the incremental test environments according to the environment, so that the test server resources are reasonably utilized, and the waste of the server resources is avoided.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a server 500 according to an embodiment of the present application, and as shown in the figure, the electronic device 500 includes an application processor 510, a memory 520, a communication interface 530, and one or more programs 521, where the one or more programs 521 are stored in the memory 520 and configured to be executed by the application processor 510, and the one or more programs 521 include instructions for:
acquiring a test environment deployment request, and extracting a test requirement from the test environment deployment request;
determining a test branch and a test branch name from the test requirement;
generating a mirror image package based on the test branch, and pushing the mirror image package to a mirror image warehouse;
acquiring a test environment name list, and judging whether the test environment name list contains the test branch name or not;
if yes, obtaining an incremental test environment corresponding to the test branch name;
if not, determining a target test server from a preset test server cluster, pulling the mirror image package to the target test server, and deploying the incremental test environment based on the mirror image package.
It can be seen that, in the embodiment of the present application, a server extracts a test requirement from a test environment deployment request by obtaining the test environment deployment request; determining a test branch and a test branch name from the test requirement; generating a mirror image package based on the test branch, and pushing the mirror image package to a mirror image warehouse; acquiring a test environment name list, and judging whether the test environment name list contains the test branch name or not; if yes, obtaining an incremental test environment corresponding to the test branch name; if not, determining a target test server from a preset test server cluster, pulling the mirror image package to the target test server, and deploying the incremental test environment based on the mirror image package. Therefore, the incremental test environment is applied to the incremental test system, the existence of the test environment can be determined through the test branch name, the incremental test environment is deployed based on the test environment and the mirror image package, the deployment workload of the test environment is reduced, the deployment period is shortened, and the work efficiency and the user experience are improved.
In a possible example, the determining a target test server from a preset cluster of test servers is specifically performed by instructions in the program to: obtaining a plurality of server loads corresponding to a plurality of test servers in the test server cluster; and determining the test server corresponding to the minimum value in the server loads as the target test server.
In a possible example, the incremental test environment is deployed based on the image package, and the instructions in the program are specifically configured to perform the following operations: deploying the running environment corresponding to the mirror image package in the target test server, and marking the running environment based on the test branch name to obtain a test environment; and generating the incremental test environment through a preset full test environment and the test environment deployment request.
In a possible example, the generating the incremental test environment through the preset full test environment and the test environment deployment request includes: extracting a flow access address from the test environment deployment request; generating a test interface corresponding to the flow access address; generating a load balancing server corresponding to the test interface; and establishing the test interface, the load balancing server and a call link of the test environment through the full test environment to obtain the incremental test environment.
In a possible example, the generating a mirror packet based on the test branch includes: extracting mirror test code from the test branch; executing code packing operation on the mirror image test code to obtain a mirror image code packet; and marking the mirror image code packet based on the test branch name to obtain the mirror image packet.
The above description has introduced the solution of the embodiment of the present application mainly from the perspective of the method-side implementation process. It is understood that the electronic device comprises corresponding hardware structures and/or software modules for performing the respective functions in order to realize the above-mentioned functions. Those of skill in the art would readily appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiment of the present application, the electronic device may be divided into the functional units according to the method example, for example, each functional unit may be divided corresponding to each function, or two or more functions may be integrated into one control unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit. It should be noted that the division of the unit in the embodiment of the present application is schematic, and is only a logic function division, and there may be another division manner in actual implementation.
Referring to fig. 6, fig. 6 is a schematic structural diagram of an incremental test environment deployment apparatus 600 according to an embodiment of the present application, where the incremental test environment deployment apparatus 600 includes: an obtaining unit 601, a determining unit 602, a generating unit 603, a judging unit 604 and a deploying unit 605, wherein:
an obtaining unit 601, configured to obtain a test environment deployment request, and extract a test requirement from the test environment deployment request;
a determining unit 602, configured to determine a test branch and a test branch name from the test requirement;
a pushing unit 603, configured to generate a mirror package based on the test branch, and push the mirror package to a mirror warehouse;
a determining unit 604, configured to obtain a test environment name list, and determine whether the test environment name list includes the test branch name;
the deployment unit 605 is configured to, when the test branch name is included, obtain an incremental test environment corresponding to the test branch name, when the test branch name is not included, determine a target test server from a preset test server cluster, pull the mirror package to the target test server, and deploy the incremental test environment based on the mirror package.
It can be seen that, in the embodiment of the present application, a server extracts a test requirement from a test environment deployment request by obtaining the test environment deployment request; determining a test branch and a test branch name from the test requirement; generating a mirror image package based on the test branch, and pushing the mirror image package to a mirror image warehouse; acquiring a test environment name list, and judging whether the test environment name list contains the test branch name or not; if yes, obtaining an incremental test environment corresponding to the test branch name; if not, determining a target test server from a preset test server cluster, pulling the mirror image package to the target test server, and deploying the incremental test environment based on the mirror image package. Therefore, the incremental test environment is applied to the incremental test system, the existence of the test environment can be determined through the test branch name, the incremental test environment is deployed based on the test environment and the mirror image package, the deployment workload of the test environment is reduced, the deployment period is shortened, and the work efficiency and the user experience are improved.
In a possible example, the determining a target test server from a preset test server cluster, where the deployment unit 605 is specifically configured to: obtaining a plurality of server loads corresponding to a plurality of test servers in the test server cluster; and determining the test server corresponding to the minimum value in the server loads as the target test server.
In a possible example, in the deploying the incremental test environment based on the image package, the deploying unit 605 is specifically configured to: deploying the running environment corresponding to the mirror image package in the target test server, and marking the running environment based on the test branch name to obtain a test environment; and generating the incremental test environment through a preset full test environment and the test environment deployment request.
In a possible example, the incremental test environment is generated according to a preset full test environment and the test environment deployment request, and the deployment unit 605 is specifically configured to: extracting a flow access address from the test environment deployment request; generating a test interface corresponding to the flow access address; generating a load balancing server corresponding to the test interface; and establishing the test interface, the load balancing server and a call link of the test environment through the full test environment to obtain the incremental test environment.
In a possible example, the pushing unit 603 is specifically configured to, based on the generation of the mirror packet by the test branch, specifically: extracting mirror test code from the test branch; executing code packing operation on the mirror image test code to obtain a mirror image code packet; and marking the mirror image code packet based on the test branch name to obtain the mirror image packet.
Embodiments of the present application also provide a computer storage medium, where the computer storage medium stores a computer program for electronic data exchange, the computer program enabling a computer to execute part or all of the steps of any one of the methods described in the above method embodiments, and the computer includes an electronic device.
Embodiments of the present application also provide a computer program product comprising a non-transitory computer readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of any of the methods as described in the above method embodiments. The computer program product may be a software installation package, the computer comprising an electronic device.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other manners. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the above-described division of the units is only one type of division of logical functions, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of some interfaces, devices or units, and may be an electric or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit may be stored in a computer readable memory if it is implemented in the form of a software functional unit and sold or used as a stand-alone product. Based on such understanding, the technical solution of the present application may be substantially implemented or a part of or all or part of the technical solution contributing to the prior art may be embodied in the form of a software product stored in a memory, and including several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the above-mentioned method of the embodiments of the present application. And the aforementioned memory comprises: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. An incremental test environment deployment method applied to a server, the method comprising:
acquiring a test environment deployment request, and extracting a test requirement from the test environment deployment request;
determining a test branch and a test branch name from the test requirement;
generating a mirror image package based on the test branch, and pushing the mirror image package to a mirror image warehouse;
acquiring a test environment name list, and judging whether the test environment name list contains the test branch name or not;
if yes, obtaining an incremental test environment corresponding to the test branch name;
if not, determining a target test server from a preset test server cluster, pulling the mirror image package to the target test server, and deploying the incremental test environment based on the mirror image package.
2. The method of claim 1, wherein determining a target test server from a predetermined cluster of test servers comprises:
obtaining a plurality of server loads corresponding to a plurality of test servers in the test server cluster;
and determining the test server corresponding to the minimum value in the server loads as the target test server.
3. The method of any of claims 1 or 2, wherein said deploying the incremental test environment based on the mirror package comprises:
deploying the running environment corresponding to the mirror image package in the target test server, and marking the running environment based on the test branch name to obtain a test environment;
and generating the incremental test environment through a preset full test environment and the test environment deployment request.
4. The method of claim 3, wherein the generating the incremental test environment from the preset full test environment and the test environment deployment request comprises:
extracting a flow access address from the test environment deployment request;
generating a test interface corresponding to the flow access address;
generating a load balancing server corresponding to the test interface;
and establishing the test interface, the load balancing server and a call link of the test environment through the full test environment to obtain the incremental test environment.
5. The method of claim 1, wherein generating a mirror packet based on the test branch comprises:
extracting mirror test code from the test branch;
executing code packing operation on the mirror image test code to obtain a mirror image code packet;
and marking the mirror image code packet based on the test branch name to obtain the mirror image packet.
6. An incremental test environment deployment apparatus, comprising:
the device comprises an acquisition unit, a test environment deployment unit and a test environment management unit, wherein the acquisition unit is used for acquiring a test environment deployment request and extracting a test requirement from the test environment deployment request;
the determining unit is used for determining a test branch and a test branch name from the test requirement;
the pushing unit is used for generating a mirror image package based on the test branch and pushing the mirror image package to a mirror image warehouse;
the judging unit is used for acquiring a test environment name list and judging whether the test environment name list contains the test branch name or not;
and the deployment unit is used for acquiring the incremental test environment corresponding to the test branch name when the test branch name is contained, determining a target test server from a preset test server cluster when the test branch name is not contained, pulling the mirror image package to the target test server, and deploying the incremental test environment based on the mirror image package.
7. The apparatus according to claim 6, wherein, in the aspect of determining a target test server from a preset cluster of test servers, the deployment unit is specifically configured to:
obtaining a plurality of server loads corresponding to a plurality of test servers in the test server cluster;
and determining the test server corresponding to the minimum value in the server loads as the target test server.
8. The apparatus according to any one of claims 6 or 7, wherein in the deploying the incremental test environment based on the mirror package, the deploying unit is specifically configured to:
deploying the running environment corresponding to the mirror image package in the target test server, and marking the running environment based on the test branch name to obtain a test environment;
and generating the incremental test environment through a preset full test environment and the test environment deployment request.
9. A server comprising a memory and a processor, the memory storing a computer program, wherein the processor when executing the computer program implements the steps of the method of any one of claims 1 to 5.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 5.
CN202010809837.6A 2020-08-18 2020-08-18 Incremental test environment deployment method, device, server and storage medium Pending CN114077535A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010809837.6A CN114077535A (en) 2020-08-18 2020-08-18 Incremental test environment deployment method, device, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010809837.6A CN114077535A (en) 2020-08-18 2020-08-18 Incremental test environment deployment method, device, server and storage medium

Publications (1)

Publication Number Publication Date
CN114077535A true CN114077535A (en) 2022-02-22

Family

ID=80280342

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010809837.6A Pending CN114077535A (en) 2020-08-18 2020-08-18 Incremental test environment deployment method, device, server and storage medium

Country Status (1)

Country Link
CN (1) CN114077535A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116893977A (en) * 2023-09-08 2023-10-17 中国空气动力研究与发展中心计算空气动力研究所 Automatic deployment method, device, equipment and medium for distributed simulation test environment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116893977A (en) * 2023-09-08 2023-10-17 中国空气动力研究与发展中心计算空气动力研究所 Automatic deployment method, device, equipment and medium for distributed simulation test environment
CN116893977B (en) * 2023-09-08 2024-01-16 中国空气动力研究与发展中心计算空气动力研究所 Automatic deployment method, device, equipment and medium for distributed simulation test environment

Similar Documents

Publication Publication Date Title
CN108418862B (en) Micro-service management method and system based on artificial intelligence service cloud platform
CN109104467B (en) Development environment construction method and device, platform system and storage medium
CN110535831B (en) Kubernetes and network domain-based cluster security management method and device and storage medium
CN105760184B (en) A kind of method and apparatus of charging assembly
CN108959385B (en) Database deployment method, device, computer equipment and storage medium
CN104219078B (en) A kind for the treatment of method and apparatus of more runtime environment data
CN106250104A (en) A kind of remote operating system for server, method and device
CN101571809A (en) Implementation method of plug-in registration and device thereof
CN110213326B (en) Method, system, equipment and storage medium for capacity expansion of metadata node cluster
CN109039751A (en) Configure method, apparatus, computer equipment and the storage medium of routing
CN110213392B (en) Data distribution method and device, computer equipment and storage medium
CN103905508A (en) Cloud platform application deployment method and device
CN101853152A (en) Method and system for generating graphical user interface
CN104580302A (en) Cloud service management system and cloud-cloud management system
US11893367B2 (en) Source code conversion from application program interface to policy document
CN109104368B (en) Connection request method, device, server and computer readable storage medium
CN114780080A (en) Micro front end integration method, device and monitoring method
KR102499705B1 (en) Method for detecting service of network and apparatus using the same
CN111865905B (en) Ukey-based communication method, device and storage medium
CN108196831A (en) The construction method and device of operation system
CN104079598A (en) Method and device for realizing collaborative browsing of webpages
CN114077535A (en) Incremental test environment deployment method, device, server and storage medium
CN109067645B (en) Network element equipment connected with NFV virtual security gateway
US9164817B2 (en) Mobile communication terminal to provide widget expansion function using message communication, and operation method of the mobile communication terminal
US11071151B2 (en) Methods and apparatuses for connecting a wireless access point through an application in a user equipment

Legal Events

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