CN115757121A - Test method, device, equipment and storage medium built based on test environment - Google Patents

Test method, device, equipment and storage medium built based on test environment Download PDF

Info

Publication number
CN115757121A
CN115757121A CN202211430575.8A CN202211430575A CN115757121A CN 115757121 A CN115757121 A CN 115757121A CN 202211430575 A CN202211430575 A CN 202211430575A CN 115757121 A CN115757121 A CN 115757121A
Authority
CN
China
Prior art keywords
server
test
calling
version
testing
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
CN202211430575.8A
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.)
Ping An Consumer Finance Co Ltd
Original Assignee
Ping An Consumer Finance 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 Ping An Consumer Finance Co Ltd filed Critical Ping An Consumer Finance Co Ltd
Priority to CN202211430575.8A priority Critical patent/CN115757121A/en
Publication of CN115757121A publication Critical patent/CN115757121A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention relates to a version test technology, and discloses a test method, a device, equipment and a storage medium based on test environment construction, wherein the method comprises the following steps: acquiring an updated version of software and an associated system, performing resource allocation according to a server corresponding to the associated system to obtain a main server and sub servers, and constructing a public resource pool according to the sub servers corresponding to the associated system; acquiring a calling system and a called system from the associated system, and calling the target server of the called system from the public resource pool according to the updated version; if the calling is successful, testing the updated version by using a testing environment corresponding to the target server; if the calling fails, testing the updated version by using a testing environment corresponding to a main server of the called system; and after the test is finished, the tested server synchronizes the updated version to the test environment corresponding to the servers except the tested server. The invention can improve the stability and efficiency of the test.

Description

Test method, device, equipment and storage medium built based on test environment
Technical Field
The invention relates to the technical field of version testing, in particular to a testing method, a testing device, testing equipment and a storage medium which are built based on a testing environment.
Background
The current Internet industry project development cycle is tight, iteration is frequent, and many projects need to be developed and tested in parallel. A project often includes multiple systems, and when a system is tested, the system often depends on a test environment built by a server corresponding to the system, and the test is performed according to the test environment, and the number of servers corresponding to each system is often more than one, and further, one system often corresponds to multiple sets of test environments. The testing environment is utilized one by one to carry out testing, so that the problems of computer resource waste and low testing efficiency exist. Moreover, each system may involve calling an associated system and the associated system being called, but in practical applications, there is a situation that a certain system is deployed or a service is suspended, which may cause that the associated system cannot be called, thereby possibly affecting the test progress, causing a problem of unstable test, and reducing the test efficiency.
Disclosure of Invention
The invention provides a testing method, a testing device, testing equipment and a storage medium which are built based on a testing environment, and mainly aims to solve the problems of unstable testing and low testing efficiency.
In order to achieve the above object, the present invention provides a test method based on test environment construction, which includes:
acquiring an updated version of software and an associated system, performing resource allocation according to a server corresponding to the associated system to obtain a main server and a sub-server, and constructing a public resource pool by using the sub-server corresponding to the associated system;
acquiring a calling system and a called system from the associated system, and calling a target server of the called system from the public resource pool by the calling system according to the updated version;
if the calling is successful, testing the updated version by using a testing environment corresponding to the target server;
if the calling fails, testing the updated version by using a testing environment corresponding to a main server of the called system;
and after the test is finished, the server which finishes the test synchronizes the updated version to the test environment corresponding to the server except the server which finishes the test in the called system.
Optionally, the resource allocation according to the server corresponding to the association system to obtain the main server and the sub-server includes:
calling a preset server corresponding to each system in the associated system;
and randomly selecting one server from the servers as a main server, and taking the servers except the main server from the servers as sub-servers.
Optionally, the obtaining of the calling system and the called system from the association system includes:
selecting one target system from the associated systems one by one to obtain the associated system of the target system;
generating a system call combination according to the target system and the associated system;
and repeatedly screening the system calling combination corresponding to each system in the associated system to obtain a target system calling combination, and generating a calling system and a called system according to the target system calling combination.
Optionally, said invoking the target server of the invoked system from the common resource pool according to the updated version includes:
acquiring an update version number of the update version, and using the update version number as a request header of a server calling request;
and the calling system calls a server meeting preset conditions from the public resource pool as a target server of the called system according to the server calling request.
Optionally, the testing the updated version by using the testing environment corresponding to the target server includes:
obtaining a previous version code and a historical version code corresponding to the update code, and performing differentiation comparison according to the update code and the previous version code to obtain an incremental code of the previous version code;
determining an increment code of the historical version code relative to the previous version code as a target code corresponding to the historical version code, and generating code coverage information according to the target code;
and determining code coverage information corresponding to the updated code according to the code coverage rate, and testing the updated version according to the code coverage information.
Optionally, the synchronizing, by the server after the test, the updated version to the test environment corresponding to the server in the called system except for the server after the test is completed includes:
generating a version number according to the updated version; generating a server call request by using the version number as a request header identifier;
taking the tested server as a tested server, and taking servers except the tested server in the called system as servers to be tested;
remotely copying the shell script of the tested server to the server to be tested by using a preset automatic operation and maintenance tool;
and executing the shell script on the server to be tested to obtain a synchronous test result of the test environment of the server to be tested.
Optionally, before the testing the updated version by using the testing environment corresponding to the target server, the method further includes:
acquiring all types of test environments, and determining a plurality of test environment types meeting preset conditions according to all types of the test environments;
acquiring a basic installation package and an auxiliary installation package of the test environment type, newly building a virtual machine corresponding to the target server, and importing the basic installation package into the virtual machine;
connecting the basic installation package with the virtual machine by using a preset Xshell, configuring the environment variable of the auxiliary installation package, and uploading the configured auxiliary installation package to the environment of the virtual machine by using a preset xftp.
In order to solve the above problem, the present invention further provides a testing apparatus constructed based on a testing environment, the apparatus including:
the public resource pool building module is used for obtaining an updated version of software and an associated system, performing resource allocation according to a server corresponding to the associated system to obtain a main server and a sub-server, and building a public resource pool by using a sub-server corresponding to the associated system;
the target server calling module is used for obtaining a calling system and a called system from the associated system, and the calling system calls a target server of the called system from the public resource pool according to the updated version;
the version testing module is used for testing the updated version by using a testing environment corresponding to the target server when the calling is successful; when the calling fails, testing the updated version by using a testing environment corresponding to a main server of the called system;
and the version code synchronization module is used for synchronizing the updated version to the test environment corresponding to the servers except the tested server in the called system by the tested server after the test is finished.
In order to solve the above problem, the present invention also provides an electronic device, including:
at least one processor; and (c) a second step of,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the test method set up based on a test environment as described above.
In order to solve the above problem, the present invention further provides a computer-readable storage medium, in which at least one computer program is stored, and the at least one computer program is executed by a processor in an electronic device to implement the test method based on test environment building.
The embodiment of the invention constructs the main server and the sub-servers through the servers corresponding to the system, and selects one of the servers from the main server and the sub-servers to carry out the environmental test according to the calling condition, thereby ensuring the stability of the test environment to the maximum extent and reducing the mutual dependence among the systems; the public resource pool is constructed according to the sub-servers, and the servers meeting the server calling request are called through the public resource pool to test the updated version, so that the stability of the servers of the system is improved; the updated version is updated to the test environment of other servers in the called system through the tested server, so that the version verification workload in the version synchronization process is reduced, and the version test efficiency is improved. Therefore, the test method and device, the electronic equipment and the computer readable storage medium which are set up based on the test environment can solve the problems of unstable test and low test efficiency.
Drawings
Fig. 1 is a schematic flowchart of a testing method built based on a testing environment according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of acquiring a calling system and a called system from the associated system according to an embodiment of the present invention;
fig. 3 is a schematic flowchart illustrating a process of synchronizing the updated version by the server after completing the test according to an embodiment of the present invention;
FIG. 4 is a functional block diagram of a testing apparatus constructed based on a testing environment according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device implementing the test method based on test environment building according to an embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The embodiment of the application provides a testing method based on test environment construction. The execution subject of the test method built based on the test environment includes, but is not limited to, at least one of electronic devices, such as a server and a terminal, which can be configured to execute the method provided by the embodiment of the present application. In other words, the test method built based on the test environment may be executed by software or hardware installed in the terminal device or the server device, and the software may be a block chain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like. The server may be an independent server, or may be a cloud server that provides basic cloud computing services such as cloud service, a cloud database, cloud computing, cloud functions, cloud storage, web service, cloud communication, middleware service, domain name service, security service, content Delivery Network (CDN), and a big data and artificial intelligence platform.
Referring to fig. 1, a schematic flow chart of a test method based on test environment building provided by an embodiment of the present invention is shown. In this embodiment, the test method based on test environment construction includes the following steps:
s1, obtaining an updated version of software and an associated system, performing resource allocation according to a server corresponding to the associated system to obtain a main server and a sub-server, and constructing a public resource pool by using the sub-server corresponding to the associated system.
In the embodiment of the invention, the update version of the software comprises an update version code and an update version number; the updated version code can be subjected to version test in an environment corresponding to a server of the system; the update version number may enable identification of a server of the system.
In an actual application scenario of the present invention, in an actual application, an enterprise usually includes different departments or systems, each department or system is specifically responsible for a certain business of the enterprise, and different systems may interact with each other to different degrees, so that in one software project, the different systems need to ensure that the testing joint debugging is performed in the same set of testing environment. Therefore, the embodiment of the invention can identify the servers with the same version number in different systems, and realize the test of the updated version code in the same set of test environment of different systems.
In the embodiment of the invention, the updated version of the software and the associated system can be captured from a storage area corresponding to the associated system set by a storage administrator and an updated version database written by a storage developer through a python statement with a data capture function, a crawler technology and the like, wherein the storage area includes but is not limited to a database, a cache node, a block chain node and the like. The efficiency of acquiring the updated version of the software and the associated system can be improved by capturing the prestored updated version and the corresponding associated system from the blockchain node and utilizing the high throughput of the blockchain to the data.
In this embodiment of the present invention, the performing resource allocation according to the server corresponding to the association system to obtain the main server and the sub-server includes:
calling a preset server corresponding to each system in the associated system;
and randomly selecting one server from the servers as a main server, and taking the servers except the main server from the servers as sub-servers.
In the embodiment of the present invention, each system in the association system may be correspondingly provided with a plurality of servers according to different test environments, the test environment of each server may be different, and the function of each server is the same, and the updated version may be tested, and further, the functions executed by the main server and the sub-servers are the same.
In the embodiment of the invention, the public resource pool comprises the sub servers of each system in the associated system, the sub servers can be used for calling the associated system firstly, and when the calling of the sub servers is in trouble, the main server of the associated system is accessed to realize the normal calling of the server and the normal test of the updated version, thereby ensuring the stability of the test.
S2, acquiring a calling system and a called system from the associated system, and calling a target server of the called system from the public resource pool by the calling system according to the updated version.
In the embodiment of the present invention, the association system may include a plurality of sets of systems having a calling relationship, each system having a calling relationship includes a calling system and a called system, where one system may call a plurality of different systems or may be called by a plurality of systems.
Referring to fig. 2, in the embodiment of the present invention, the acquiring a calling system and a called system from the associated system includes:
s21, selecting one target system from the associated systems one by one to obtain the associated system of the target system;
s22, generating a system call combination according to the target system and the associated system;
and S23, repeatedly screening the system calling combination corresponding to each system in the associated system to obtain a target system calling combination, and generating a calling system and a called system according to the target system calling combination.
In this embodiment of the present invention, the invoking system invokes the target server of the invoked system from the common resource pool according to the updated version, including:
acquiring an update version number of the update version, and using the update version number as a request header of a server calling request;
and the calling system calls a server meeting preset conditions from the public resource pool as a target server of the called system according to the server calling request.
In the embodiment of the present invention, the preset condition may be that the identifier of the update version number exists, and the server is called according to whether the identifier of the update version number exists in the server.
For example, assuming that there are calling system a and called system B, and update version number 220526 of version C, if there is a server marked as 220526 in called system B in the public resource pool, it is determined that the target server of the called system is successfully called; if the called system B in the public resource pool does not have the server marked as 220526, judging that the calling of the target server of the called system fails.
And if the calling is successful, executing S3 and testing the updated version by using the testing environment corresponding to the target server.
In this embodiment of the present invention, the testing the updated version by using the testing environment corresponding to the target server includes:
obtaining a previous version code and a historical version code corresponding to the update code, and performing differentiation comparison according to the update code and the previous version code to obtain an incremental code of the previous version code;
determining an increment code of the historical version code relative to the previous version code as a target code corresponding to the historical version code, and generating code coverage information according to the target code;
and determining code coverage information corresponding to the updated code according to the code coverage rate, and testing the updated version according to the code coverage information.
In an embodiment of the present invention, before the testing the updated version by using the testing environment corresponding to the target server, the method further includes:
acquiring all types of test environments, and determining a plurality of test environment types meeting preset conditions according to all types of the test environments;
acquiring a basic installation package and an auxiliary installation package of the test environment type, newly building a virtual machine corresponding to the target server, and importing the basic installation package into the virtual machine;
connecting the basic installation package with the virtual machine by using a preset Xshell, configuring the environment variable of the auxiliary installation package, and uploading the configured auxiliary installation package to the environment of the virtual machine by using a preset xftp.
In the embodiment of the invention, the preset Xshell is a safety terminal simulation software which supports SSH1, SSH2 and the TELNET protocol of a Microsoft Windows platform. The preset xshell can be used for accessing the servers under different remote systems, so that the purpose of better remotely controlling the terminal is realized. The xftp is SFTP and FTP file transfer software, and file data can be transferred between UNIX/Linux and Windows PC by using the xftp.
In the embodiment of the present invention, all types of the test environments include, but are not limited to, a meter environment, a jenkins environment, and a database environment (the database may include an oracle or mysql). The test environment type may be a single environment or a combined environment, for example, the combined environment may be a linux operating system based Tomcat + Mysql + Jdk environment.
And if the calling fails, executing S4 and testing the updated version by using the testing environment corresponding to the main server of the called system.
In this embodiment of the present invention, the process of testing the updated version by using the testing environment corresponding to the main server of the called system is similar to the process of testing the updated version by using the testing environment corresponding to the target server in step S3, and details are not repeated here.
For example, assuming that there are a calling system a and a called system B, and an update version number 220526 of an update version C, if there is no server marked as 220526 in the called system B in the common resource pool, it is determined that the target server of the called system fails to be called, and then the host service of the called system B can be extracted, and the update version C is tested by using the host environment corresponding to the host server.
And S5, after the test is finished, the tested server synchronizes the updated version to the test environment corresponding to the servers in the called system except the tested server.
Referring to fig. 3, in an embodiment of the present invention, synchronizing the updated version by the server that completes the test to the test environment corresponding to the server in the called system except for the server that completes the test includes:
s31, generating a version number according to the updated version; generating a server call request by using the version number as a request header identifier;
s32, taking the tested server as a tested server, and taking servers except the tested server in the called system as servers to be tested;
s33, remotely copying the shell script of the tested server to the server to be tested by using a preset automatic operation and maintenance tool;
and S34, executing the shell script on the server to be tested to obtain a synchronous test result of the server to be tested to the test environment.
In the embodiment of the invention, after the called server is tested, the version synchronization efficiency is improved through the synchronization between the servers.
The embodiment of the invention constructs the main server and the sub-servers through the servers corresponding to the system, and selects one of the servers from the main server and the sub-servers to carry out the environmental test according to the calling condition, thereby ensuring the stability of the test environment to the maximum extent and reducing the mutual dependence among the systems; the public resource pool is constructed according to the sub-servers, and the servers meeting the server calling request are called through the public resource pool to test the updated version, so that the stability of the servers of the system is improved; the updated version is updated to the test environment of other servers in the called system through the tested server, so that the version verification workload in the version synchronization process is reduced, and the version test efficiency is improved. Therefore, the testing method set up based on the testing environment can solve the problems of unstable testing and low testing efficiency.
Fig. 4 is a functional block diagram of a test apparatus built based on a test environment according to an embodiment of the present invention.
The testing device 100 constructed based on the testing environment can be installed in electronic equipment. According to the realized functions, the testing device 100 built based on the testing environment may include a common resource pool building module 101, a target server invoking module 102, a version testing module 103, and a version code synchronization module 104. The module of the present invention, which may also be referred to as a unit, refers to a series of computer program segments that can be executed by a processor of an electronic device and can perform a fixed function, and are stored in a memory of the electronic device.
In the present embodiment, the functions regarding the respective modules/units are as follows:
the public resource pool building module 101 is configured to obtain an updated version of software and an associated system, perform resource allocation according to a server corresponding to the associated system to obtain a main server and a sub-server, and build a public resource pool by using a sub-server corresponding to the associated system;
the target server invoking module 102 is configured to acquire an invoking system and an invoked system from the associated system, and according to the updated version, the invoking system invokes a target server of the invoked system from the public resource pool;
the version testing module 103 is configured to test the updated version by using a testing environment corresponding to the target server when the calling is successful; when the calling fails, testing the updated version by using a testing environment corresponding to a main server of the called system;
the version code synchronization module 104 is configured to synchronize, by the server that completes the test, the updated version to the test environment corresponding to the server in the called system except for the server that completes the test after the test is completed.
In detail, when the modules in the testing device 100 built based on the testing environment according to the embodiment of the present invention are used, the same technical means as the testing method built based on the testing environment shown in the drawings can be adopted, and the same technical effects can be produced, which is not described herein again.
Fig. 5 is a schematic structural diagram of an electronic device implementing a test method built based on a test environment according to an embodiment of the present invention.
The electronic device 1 may include a processor 10, a memory 11, a communication bus 12, and a communication interface 13, and may further include a computer program stored in the memory 11 and operable on the processor 10, such as a test program built based on a test environment.
In some embodiments, the processor 10 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same function or different functions, and includes one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the whole electronic device by using various interfaces and lines, runs or executes programs or modules stored in the memory 11 (for example, executes a test program built based on a test environment, etc.), and calls data stored in the memory 11 to execute various functions of the electronic device and process data.
The memory 11 includes at least one type of readable storage medium including flash memory, removable hard disks, multimedia cards, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disks, optical disks, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device, for example a removable hard disk of the electronic device. The memory 11 may also be an external storage device of the electronic device in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device. The memory 11 may be used to store not only application software installed in the electronic device and various types of data, such as codes of a test program built based on a test environment, but also temporarily store data that has been output or is to be output.
The communication bus 12 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like.
The communication interface 13 is used for communication between the electronic device and other devices, and includes a network interface and a user interface. Optionally, the network interface may include a wired interface and/or a wireless interface (e.g., WI-FI interface, bluetooth interface, etc.), which are typically used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a Display (Display), an input unit, such as a Keyboard (Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable, among other things, for displaying information processed in the electronic device and for displaying a visualized user interface.
Fig. 5 only shows an electronic device with components, and it will be understood by a person skilled in the art that the structure shown in fig. 5 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than shown, or a combination of certain components, or a different arrangement of components.
For example, although not shown, the electronic device may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so that functions of charge management, discharge management, power consumption management and the like are realized through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The test program built based on the test environment stored in the memory 11 of the electronic device 1 is a combination of a plurality of instructions, and when running in the processor 10, the following can be implemented:
acquiring an updated version of software and an associated system, performing resource allocation according to a server corresponding to the associated system to obtain a main server and a sub-server, and constructing a public resource pool by using the sub-server corresponding to the associated system;
acquiring a calling system and a called system from the associated system, and calling a target server of the called system from the public resource pool by the calling system according to the updated version;
if the calling is successful, testing the updated version by using a testing environment corresponding to the target server;
if the calling fails, testing the updated version by using a testing environment corresponding to a main server of the called system;
and after the test is finished, the server which finishes the test synchronizes the updated version to the test environment corresponding to the server except the server which finishes the test in the called system.
Specifically, the specific implementation method of the instruction by the processor 10 may refer to the description of the relevant steps in the embodiment corresponding to the drawings, which is not described herein again.
Further, the integrated modules/units of the electronic device 1 may be stored in a computer-readable storage medium if they are implemented in the form of software functional units and sold or used as separate products. The computer readable storage medium may be volatile or non-volatile. For example, the computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, read-Only Memory (ROM).
The present invention also provides a computer-readable storage medium, storing a computer program which, when executed by a processor of an electronic device, may implement:
acquiring an updated version of software and an associated system, performing resource allocation according to a server corresponding to the associated system to obtain a main server and a sub-server, and constructing a public resource pool by using the sub-server corresponding to the associated system;
acquiring a calling system and a called system from the associated system, and calling a target server of the called system from the public resource pool by the calling system according to the updated version;
if the calling is successful, testing the updated version by using a testing environment corresponding to the target server;
if the calling fails, testing the updated version by using a testing environment corresponding to a main server of the called system;
and after the test is finished, the server which finishes the test synchronizes the updated version to the test environment corresponding to the server except the server which finishes the test in the called system.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules 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 modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, functional modules in the embodiments of the present invention 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, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms first, second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only intended to illustrate the technical solutions of the present invention and not to limit the same, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. A test method built based on a test environment is characterized by comprising the following steps:
acquiring an updated version of software and an associated system, performing resource allocation according to a server corresponding to the associated system to obtain a main server and a sub-server, and constructing a public resource pool by using the sub-server corresponding to the associated system;
acquiring a calling system and a called system from the associated system, and calling a target server of the called system from the public resource pool by the calling system according to the updated version;
if the calling is successful, testing the updated version by using a testing environment corresponding to the target server;
if the calling fails, testing the updated version by using a testing environment corresponding to a main server of the called system;
and after the test is finished, the server which finishes the test synchronizes the updated version to the test environment corresponding to the server except the server which finishes the test in the called system.
2. The test environment set-up-based test method according to claim 1, wherein the obtaining of the main server and the sub-servers by performing resource allocation according to the server corresponding to the association system comprises:
calling a preset server corresponding to each system in the associated system;
and randomly selecting one server from the servers as a main server, and taking the servers except the main server from the servers as sub-servers.
3. The test method set up based on the test environment according to claim 1, wherein the obtaining of the calling system and the called system from the associated system comprises:
selecting one target system from the associated systems one by one to obtain the associated system of the target system;
generating a system call combination according to the target system and the associated system;
and repeatedly screening the system calling combination corresponding to each system in the associated system to obtain a target system calling combination, and generating a calling system and a called system according to the target system calling combination.
4. The test environment built based on the test environment according to the claim 1, wherein the calling system calls the target server of the called system from the public resource pool according to the updated version, comprising:
acquiring an update version number of the update version, and using the update version number as a request header of a server calling request;
and the calling system calls a server meeting preset conditions from the public resource pool as a target server of the called system according to the server calling request.
5. The test method set up based on the test environment according to claim 1, wherein the testing the updated version by using the test environment corresponding to the target server includes:
obtaining a previous version code and a historical version code corresponding to the update code, and performing differentiation comparison according to the update code and the previous version code to obtain an incremental code of the previous version code;
determining an increment code of the historical version code relative to the previous version code as a target code corresponding to the historical version code, and generating code coverage information according to the target code;
and determining code coverage information corresponding to the updated code according to the code coverage rate, and testing the updated version according to the code coverage information.
6. The test environment built based on the test environment according to claim 1, wherein the step of synchronizing the updated version to the test environment corresponding to the server in the called system except the server in which the test is completed by the server in which the test is completed comprises:
generating a version number according to the updated version; generating a server call request by using the version number as a request header identifier;
taking the tested server as a tested server, and taking servers except the tested server in the called system as servers to be tested;
remotely copying the shell script of the tested server to the server to be tested by using a preset automatic operation and maintenance tool;
and executing the shell script on the server to be tested to obtain a synchronous test result of the test environment of the server to be tested.
7. The test environment set-up-based test method according to any one of claims 1 to 6, wherein before the test of the updated version by using the test environment corresponding to the target server, the method further comprises:
acquiring all types of test environments, and determining a plurality of test environment types meeting preset conditions according to all types of the test environments;
acquiring a basic installation package and an auxiliary installation package of the test environment type, newly building a virtual machine corresponding to the target server, and importing the basic installation package into the virtual machine;
connecting the basic installation package with the virtual machine by using a preset Xshell, configuring environment variables of the auxiliary installation package, and uploading the configured auxiliary installation package to the environment of the virtual machine by using a preset xftp.
8. A test device built based on a test environment, the device comprising:
the public resource pool building module is used for obtaining an updated version of software and an associated system, performing resource allocation according to a server corresponding to the associated system to obtain a main server and a sub-server, and building a public resource pool by using a sub-server corresponding to the associated system;
the target server calling module is used for obtaining a calling system and a called system from the associated system, and the calling system calls a target server of the called system from the public resource pool according to the updated version;
the version testing module is used for testing the updated version by using a testing environment corresponding to the target server when the calling is successful; when the calling fails, testing the updated version by using a testing environment corresponding to a main server of the called system;
and the version code synchronization module is used for synchronizing the updated version to the test environment corresponding to the servers except the tested server in the called system by the tested server after the test is finished.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform a test method built on a test environment as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium, storing a computer program, wherein the computer program, when executed by a processor, implements the test environment set-up based test method according to any one of claims 1 to 7.
CN202211430575.8A 2022-11-15 2022-11-15 Test method, device, equipment and storage medium built based on test environment Pending CN115757121A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211430575.8A CN115757121A (en) 2022-11-15 2022-11-15 Test method, device, equipment and storage medium built based on test environment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211430575.8A CN115757121A (en) 2022-11-15 2022-11-15 Test method, device, equipment and storage medium built based on test environment

Publications (1)

Publication Number Publication Date
CN115757121A true CN115757121A (en) 2023-03-07

Family

ID=85371843

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211430575.8A Pending CN115757121A (en) 2022-11-15 2022-11-15 Test method, device, equipment and storage medium built based on test environment

Country Status (1)

Country Link
CN (1) CN115757121A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117472675A (en) * 2023-12-28 2024-01-30 合肥康芯威存储技术有限公司 Memory testing system and method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117472675A (en) * 2023-12-28 2024-01-30 合肥康芯威存储技术有限公司 Memory testing system and method

Similar Documents

Publication Publication Date Title
CN112506779A (en) Software interface testing method and device, electronic equipment and storage medium
CN113238929B (en) Code testing method and device based on Mock data, electronic equipment and storage medium
CN114881616A (en) Business process execution method and device, electronic equipment and storage medium
CN113704665A (en) Dynamic service publishing method, device, electronic equipment and storage medium
CN111538573A (en) Asynchronous task processing method and device and computer readable storage medium
CN112506559A (en) Gray scale publishing method and device based on gateway, electronic equipment and storage medium
CN113468049A (en) Test method, device, equipment and medium based on configurable interface
CN113806434A (en) Big data processing method, device, equipment and medium
CN115757121A (en) Test method, device, equipment and storage medium built based on test environment
CN111651121A (en) Data logic calculation method and device, electronic equipment and storage medium
CN114356530A (en) Task scheduling method and device, electronic equipment and storage medium
CN113297180A (en) Data migration method and device, electronic equipment and storage medium
CN112579452A (en) Software automation test method, device, equipment and storage medium
CN112580079A (en) Authority configuration method and device, electronic equipment and readable storage medium
CN115687384A (en) UUID (user identifier) identification generation method, device, equipment and storage medium
CN114020414A (en) Symbiotic method and device of Android system and bottom layer Linux, electronic equipment and storage medium
CN114896164A (en) Interface optimization method and device, electronic equipment and storage medium
CN114461531A (en) Platform adaptability test method, device, equipment and storage medium of test case
CN114185588A (en) Incremental package generation method, device, equipment and storage medium
CN114510400A (en) Task execution method and device, electronic equipment and storage medium
CN114489861A (en) Target component conversion method and device, electronic equipment and readable storage medium
CN114124835A (en) Interface-based data transmission method, device, equipment and medium
CN113469649A (en) Project progress analysis method and device, electronic equipment and storage medium
CN112667244A (en) Data verification method and device, electronic equipment and computer readable storage medium
CN111651509A (en) Data importing method and device based on Hbase database, electronic device and medium

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