CN109873731B - Test method, device and system - Google Patents

Test method, device and system Download PDF

Info

Publication number
CN109873731B
CN109873731B CN201711268134.1A CN201711268134A CN109873731B CN 109873731 B CN109873731 B CN 109873731B CN 201711268134 A CN201711268134 A CN 201711268134A CN 109873731 B CN109873731 B CN 109873731B
Authority
CN
China
Prior art keywords
test
server
target
script
servers
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.)
Active
Application number
CN201711268134.1A
Other languages
Chinese (zh)
Other versions
CN109873731A (en
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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke 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 Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201711268134.1A priority Critical patent/CN109873731B/en
Publication of CN109873731A publication Critical patent/CN109873731A/en
Application granted granted Critical
Publication of CN109873731B publication Critical patent/CN109873731B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)
  • Computer And Data Communications (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the application discloses a test method, a test device and a test system. One embodiment of the method comprises: receiving a test request containing the name and the version number of a target test script; determining at least one target server in the test server cluster based on the name and the version number; sending a script obtaining instruction containing the name and the version number to each target server in the at least one target server so that the target server obtains the target test script based on the name, the version number and a script storage server; and in response to receiving a target test script ready message returned by each target server in the at least one target server, sending a test instruction to each target server to enable each target server to execute the target test script. This embodiment improves the testing efficiency.

Description

Test method, device and system
Technical Field
The application relates to the technical field of computers, in particular to the technical field of internet, and particularly relates to a testing method, a testing device and a testing system.
Background
With the increasing number of internet users and the peak access caused by various special events, the network service has higher and higher requirements on performance. The system's higher response speed at high concurrency is the key to the user experience, so performance testing becomes more important. However, the testing process may occupy a large number of test servers. If the resources of the test server are insufficient, the test server needs to be released after the test task is finished, so that a plurality of test tasks are put aside.
The existing method is to manually allocate the test servers, and the test servers are released after the allocation is finished when the test plan is completely executed, and the test servers usually have a large amount of time in an idle state in the period, which causes resource waste and lower test efficiency. The other existing method is to distribute the test servers through the automatic test platform, however, the automatic test platform is usually required to be responsible for downloading the test scripts uniformly and distributing the test scripts to each test server, and repeated downloading and distribution usually requires a long time, resulting in low test efficiency.
Disclosure of Invention
An object of the embodiments of the present application is to provide an improved testing method, apparatus and system, so as to solve the technical problems mentioned in the above background.
In a first aspect, an embodiment of the present application provides a test method for a control server, where the control server is in communication connection with a test server cluster, and the test server cluster is in communication connection with a script server, and the method includes: receiving a test request containing the name and the version number of a target test script; determining at least one target server in the test server cluster based on the name and the version number; sending a script obtaining instruction containing a name and a version number to each target server in at least one target server so that the target server obtains a target test script based on the name, the version number and a script storage server; and in response to receiving a target test script ready message returned by each target server in the at least one target server, sending a test instruction to each target server to enable each target server to execute the target test script.
In some embodiments, the test request further includes a number of test servers required to execute the target test script; and determining at least one target server in the test server cluster based on the name and the version number, including: determining whether the test server cluster executes the test script matched with the name or not by taking the number as a first number; and in response to determining that the test server cluster executed the test script matching the name, taking the number of test servers in the test server cluster that executed the test script as a second number, and determining a target server in the test server cluster based on a comparison of the first number and the second number.
In some embodiments, determining a target server in the cluster of test servers based on the comparison of the first number to the second number comprises: and in response to determining that the first number is not greater than the second number, selecting the first number of test servers from the test servers executing the test scripts in the order from the last to the first according to the time for executing the test scripts, and determining the selected test servers as target servers. In some embodiments, determining a target server in the cluster of test servers based on the comparison of the first number to the second number comprises: and in response to the fact that the first number is larger than the second number, determining a difference value between the first number and the second number, selecting the test servers with the difference values from the test server cluster according to the sequence of the idle time of the test servers from large to small, and determining the selected test servers and the test servers which execute the test scripts as target servers.
In some embodiments, determining at least one target server in the cluster of test servers based on the name and the version number further comprises: and in response to the fact that the test server cluster does not execute the test script matched with the name, selecting a first number of test servers from the test server cluster according to the sequence of the idle time of the test servers from large to small, and determining the selected test servers as target servers.
In a second aspect, an embodiment of the present application provides a testing apparatus for a control server, where the control server is in communication connection with a script storage server and a testing server cluster, respectively, the control server is in communication connection with the testing server cluster, and the testing server cluster is in communication connection with the script server, and the apparatus includes: a receiving unit configured to receive a test request including a name and a version number of a target test script; the determining unit is configured to determine at least one target server in the test server cluster based on the name and the version number; the device comprises a first sending unit, a second sending unit and a third sending unit, wherein the first sending unit is used for sending a script obtaining instruction containing a name and a version number to each target server in at least one target server so as to enable the target server to obtain a target test script based on the name, the version number and a script storage server; and the second sending unit is used for responding to the received target test script ready message returned by each target server in the at least one target server and sending a test instruction to each target server so as to enable each target server to execute the target test script.
In some embodiments, the test request further includes a number of test servers required to execute the target test script; and the determination unit includes: the first determining module is configured to determine whether the test server cluster executes the test script matched with the name or not by taking the number as a first number; and the second determining module is configured to, in response to determining that the test server cluster has executed the test script matched with the name, determine, as a second number, the number of test servers in the test server cluster that have executed the test script, and determine, based on a comparison between the first number and the second number, a target server in the test server cluster.
In some embodiments, the third determination module is further configured to: and in response to determining that the first number is not greater than the second number, selecting the first number of test servers from the test servers executing the test scripts in the order from the last to the first according to the time for executing the test scripts, and determining the selected test servers as target servers.
In some embodiments, the third determination module is further configured to: and in response to the fact that the first number is larger than the second number, determining a difference value between the first number and the second number, selecting the test servers with the difference values from the test server cluster according to the sequence of the idle time of the test servers from large to small, and determining the selected test servers and the test servers which execute the test scripts as target servers.
In some embodiments, the determining unit is further configured to: and in response to the fact that the test server cluster does not execute the test script matched with the name, selecting a first number of test servers from the test server cluster according to the sequence of the idle time of the test servers from large to small, and determining the selected test servers as target servers.
In a third aspect, an embodiment of the present application provides a test system, where the test system includes a control server, a script storage server, and a test server cluster; the control server is used for receiving a test request containing the name and the version number of the target test script, determining at least one target server in the test server cluster based on the name and the version number, and sending a script acquisition instruction containing the name and the version number to each target server in the at least one target server; the target server in the test server cluster is used for determining whether a test script matched with the name is stored locally or not, if not, acquiring the target test script from the script storage server, storing the target test script to the local, and sending a target test script ready message to the control server; and the control server is also used for responding to the received target test script ready message returned by each target server in the at least one target server and sending a test instruction to each target server so as to enable each target server to execute the target test script.
In some embodiments, the target server in the test server cluster is further configured to determine whether a version number of the test script is consistent with a version number of the target test script in response to determining that a test script matched with the name is locally stored, obtain the target test script from the script storage server in response to determining that the version number of the test script is not consistent with the version number of the target test script, store the target test script to the local, and send a target test script ready message to the control server.
In some embodiments, the target server in the cluster of test servers is further configured to send a target test script ready message to the control server in response to determining that the version number of the test script is consistent with the version number of the target test script.
In some embodiments, the control server is further configured to determine a number of test servers required to execute the target test script, determine whether the cluster of test servers has executed the test script that matches the name using the determined number as a first number, determine, in response to determining that the cluster of test servers has executed the test script that matches the name, determine, as a second number, the number of test servers in the cluster of test servers that have executed the test script, and determine the target server in the cluster of test servers based on a comparison of the first number and the second number.
In some embodiments, the control server is further configured to select a first number of test servers from the test servers executing the test script in an order from last to first according to the time of executing the test script in response to determining that the first number is not greater than the second number, and determine the selected test servers as the target servers.
In some embodiments, the control server is further configured to, in response to determining that the first number is greater than the second number, determine a difference between the first number and the second number, select a number of test servers with the difference from the test server cluster in an order from a large idle duration to a small idle duration of the test servers, and determine the selected test servers and the test servers that have executed the test script as the target servers.
In some embodiments, the control server is further configured to select a first number of test servers from the test server cluster in an order from a large idle duration to a small idle duration of the test servers in response to determining that the test server cluster has not executed the test script matching the name, and determine the selected test servers as the target servers.
In a fourth aspect, an embodiment of the present application provides a server, including: one or more processors; a storage device to store one or more programs that, when executed by one or more processors, cause the one or more processors to implement a method as in any embodiment of the test method.
In a fifth aspect, embodiments of the present application provide a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements a method as in any of the embodiments of the testing method.
According to the testing method, the testing device and the testing system, the control server determines at least one target server in the testing server cluster based on the received name and the received version number, then the script acquisition instruction is sent to the target server, so that the target server acquires the target testing script based on the name, the version number and the script storage server, finally the testing instruction is sent to each target server in response to the fact that the target testing script ready message returned by each target server in the at least one target server is received, so that each target server executes the target testing script, the control server is not required to download and distribute the target testing script uniformly, and the testing efficiency is improved.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a testing method according to the present application;
FIG. 3 is a schematic diagram of an application scenario of a test method according to the present application;
FIG. 4 is a flow chart of yet another embodiment of a testing method according to the present application;
FIG. 5 is a schematic block diagram of one embodiment of a test apparatus according to the present application;
FIG. 6 is a schematic illustration of an interaction process between devices in a test system according to the present application;
FIG. 7 is a block diagram of a computer system suitable for use in implementing a server according to embodiments of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 shows an exemplary system architecture 100 to which the test method or test apparatus of the present application may be applied.
As shown in FIG. 1, system architecture 100 may include a control server 101, a script storage server 103, a cluster of test servers 105, and networks 102, 104. The service test server cluster 105 includes servers 106, 107, and 108. The network 102 is the medium used to provide the communication link between the control server 101 and the cluster of test servers 105; network 104 is used to provide a medium for communication links between script storage server 103 and test server cluster 105. The networks 102, 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The control server 101 may interact with the test server cluster 105 over the network 102 to receive or send messages or the like. The control server 101 may receive a test request sent by a client (not shown in the figure); target servers in the test server cluster 105 may also be determined based on the name and version number of the test script to cause the target servers to perform testing.
The script storage server 103 may be used to store scripts for various tests, and may store multiple versions of the same name script. In practice, the script server may employ various existing version management servers (for example, an existing version management tool svn (version), an existing open source code library, and a version control system gitubb, etc.). The script storage server 103 may be one server, or may be a server cluster including a plurality of servers, and the server cluster may implement load balancing.
The test servers 106, 107, 108 in the test server cluster 105 may be used to execute test scripts to implement test functions. The test servers 106, 107, 108 may interact with the script storage server 103 through the network 104. For example, the test servers 106, 107, 108 may download scripts from the script storage server 103, query version numbers of certain scripts, and so on.
It should be noted that the test method provided in the embodiment of the present application is generally executed by the control server 101, and accordingly, the test apparatus is generally disposed in the control server 101.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of control servers, networks, test server clusters, and script storage servers, as desired for an implementation.
With continued reference to FIG. 2, a flow 200 of one embodiment of a testing method for a control server according to the present application is shown. The control server is in communication connection with a test server cluster, and the test server cluster is in communication connection with a script server, and the test method comprises the following steps:
step 201, a test request containing the name and version number of a target test script is received.
In this embodiment, an electronic device (for example, the control server 101 shown in fig. 1) on which the test method operates may receive a test request sent by a client, where the test request may include a name and a version number of a target test script. Here, the target test script may be a test script that is written in advance by a technician and needs to be executed in a current test. In practice, a test script (Testing script) refers to a series of instructions for a particular test that can be executed by an automated test tool.
At least one target server in the test server cluster is determined based on the name and version number, step 202.
In this embodiment, the electronic device may determine at least one target server in a test server cluster (e.g., the server cluster 105 shown in fig. 1) based on the name and the version number of the target test script. For example, the electronic device may first determine whether the test server cluster executes a test script matching both the name and the version number, and if the test script is executed, may determine the test server in the test server cluster that executed the test script as the target server. If not, at least one server in the test server cluster can be randomly selected as a target server.
Step 203, sending a script obtaining instruction containing a name and a version number to each target server in at least one target server, so that the target server obtains a target test script based on the name, the version number and the script storage server.
In this embodiment, the electronic device may send a script obtaining instruction including the name and the version number to each of the at least one target server, so that the target server obtains a target test script based on the name, the version number, and a script storage server (e.g., the script storage server 103 shown in fig. 1).
In practice, for each target server, the target server may determine whether a test script matching the name is stored locally, and if not, may obtain the target test script from the script storage server and store the target test script to the local, and then send a target test script ready message to the control server. In response to determining that the local storage of the test script matched with the name is provided, the target server may determine whether the version number of the test script is consistent with the version number of the target test script, and in response to determining that the version number of the test script is not consistent with the version number of the target test script, may obtain the target test script from the script storage server, store the target test script to the local, and then send a target test script ready message to the control server. In response to determining that the version number of the test script is consistent with the version number of the target test script, a target test script ready message may be directly sent to the control server.
And step 204, in response to receiving a target test script ready message returned by each target server of the at least one target server, sending a test instruction to each target server to enable each target server to execute the target test script.
In this embodiment, in response to receiving a target test script ready message returned by each target server of the at least one target server, the electronic device may send a test instruction to each target server, so that each target server executes the target test script.
With continued reference to fig. 3, fig. 3 is a schematic diagram of an application scenario of the test method according to the present embodiment. In the application scenario of fig. 3, first, a control server 301 receives a test request 302 containing the name and version number of a target test script. Then, based on the name and version number, the control server 301 can determine the target server 304 in the test server cluster 303. Thereafter, the control server 301 sends a script acquisition instruction 305 to the target server 304 to cause the target server 304 to acquire the target test script based on the name, the version number, and the script storage server 306. Finally, after the target server 304 returns a target test script ready message 307 to the control server 301, the control server 301 sends a test instruction 308 to the target server 304 so that the target server 304 executes the target test script.
In the method provided by the embodiment of the application, at least one target server in the test server cluster is determined based on the received name and version number, then the script acquisition instruction is sent to the target server, so that the target server acquires the target test script based on the name, the version number and the script storage server, and finally the test instruction is sent to each target server in response to the received target test script ready message returned by each target server in the at least one target server, so that each target server executes the target test script, and therefore the control server is not required to download and distribute the target test script uniformly, and the test efficiency is improved.
With further reference to fig. 4, a flow 400 of yet another embodiment of a testing method for a control server is shown. The control server is communicatively connected to a test server cluster, and the test server cluster is communicatively connected to a script server, and the process 400 of the test method includes the following steps:
step 401, a test request containing the name and version number of a target test script is received.
In this embodiment, an electronic device (for example, the control server 101 shown in fig. 1) on which the test method operates may receive a test request sent by a client, where the test request may include a name and a version number of a target test script. The test request may further include the number of test servers that are preset by a technician and are required to execute the target test script.
Step 402, using the above number as a first number, determining whether the test server cluster has executed the test script matching the name.
In this embodiment, the electronic device may determine, by using the number as the first number, whether the test server cluster has executed the test script matching the name of the target test script. In practice, the electronic device may store a historical test record, and the historical test record may include a time, a name, a version number, a name or an identifier of a test server, and the like of a test script executed before a current time. The electronic device may query, from the historical test record, whether the test server cluster executed the test script whose name is consistent with the name of the target test script.
And step 403, in response to determining that the test server cluster executes the test script matched with the name, taking the number of the test servers in the test server cluster, which execute the test script, as a second number, and determining a target server in the test server cluster based on comparison between the first number and the second number.
In this embodiment, in response to determining that the test server cluster has executed the test script matching the name, the electronic device may determine, as a second number, a target server in the test server cluster based on a comparison between the first number and the second number, where the second number is the number of test servers in the test server cluster that have executed the test script.
In some optional implementations of this embodiment, in response to determining that the first number is not greater than the second number, the electronic device may select, in order from the last time to the first time when the test script is executed, the first number of test servers from among the test servers on which the test script is executed, and determine the selected test servers as target servers.
In some optional implementations of this embodiment, in response to determining that the first number is not greater than the second number, the electronic device may select, in order from the last time to the first time when the test script is executed, the first number of test servers from among the test servers on which the test script is executed, and determine the selected test servers as target servers.
Step 404, in response to determining that the test server cluster has not executed the test script matching the name, selecting a first number of test servers from the test server cluster according to the sequence of the idle durations of the test servers from large to small, and determining the selected test servers as target servers.
In this embodiment, in response to determining that the test server cluster has not executed the test script matching the name, the electronic device may select the first number of test servers from the test server cluster according to a descending order of idle durations of the test servers, and determine the selected test servers as the target servers.
Step 405, a script obtaining instruction containing a name and a version number is sent to each target server in at least one target server, so that the target server obtains a target test script based on the name, the version number and the script storage server.
In this embodiment, the electronic device may send a script obtaining instruction including the name and the version number to each of the at least one target server, so that the target server obtains a target test script based on the name, the version number, and a script storage server (e.g., the script storage server 103 shown in fig. 1).
And step 406, in response to receiving a target test script ready message returned by each target server of the at least one target server, sending a test instruction to each target server to enable each target server to execute the target test script.
In this embodiment, in response to receiving a target test script ready message returned by each target server of the at least one target server, the electronic device may send a test instruction to each target server, so that each target server executes the target test script.
As can be seen from fig. 4, compared with the embodiment corresponding to fig. 2, the flow 400 of the testing method in this embodiment highlights the step of determining the target server in the testing server cluster based on the name and the version number. Therefore, the scheme described in the embodiment can enable the same test server to execute the same test script, execute the script downloading process as little as possible, avoid repeated downloading of the script, reasonably use the test server and avoid long-term idle or use; in addition, the test scripts do not need to be distributed uniformly, and the scripts are pulled by the target servers, so that the test efficiency is further improved.
With further reference to fig. 5, as an implementation of the methods shown in the above diagrams, the present application provides an embodiment of a testing apparatus, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 2, and the apparatus may be specifically applied to a control server, where the control server is communicatively connected to a test server cluster, and the test server cluster is communicatively connected to a script server.
As shown in fig. 5, the testing apparatus 500 of the present embodiment includes: a receiving unit 501, configured to receive a test request including a name and a version number of a target test script; a determining unit 502 configured to determine at least one target server in the test server cluster based on the name and the version number; a first sending unit 503, configured to send a script obtaining instruction including the name and the version number to each of the at least one target server, so that the target server obtains the target test script based on the name, the version number, and the script storage server; a second sending unit 504, configured to, in response to receiving a target test script ready message returned by each target server of the at least one target server, send a test instruction to each target server, so that each target server executes the target test script.
In this embodiment, the receiving unit 501 may receive a test request sent by a client, where the test request may include a name and a version number of a target test script.
In this embodiment, the determining unit 502 may determine at least one target server in a test server cluster (for example, the server cluster 105 shown in fig. 1) based on the name and the version number of the target test script. As an example, the determining unit 502 may first determine whether the test server cluster executes a test script matching both the name and the version number, and if the test script is executed, may determine the test server in the test server cluster, which has executed the test script, as the target server. If not, at least one server in the test server cluster can be randomly selected as a target server.
In this embodiment, the first sending unit 503 may send a script obtaining instruction including the name and the version number to each of the at least one target server, so that the target server obtains a target test script based on the name, the version number, and a script storage server (e.g., the script storage server 103 shown in fig. 1).
In this embodiment, the second sending unit 504 may send a test instruction to each target server in response to receiving a target test script ready message returned by each target server of the at least one target server, so that each target server executes the target test script.
In some optional implementations of this embodiment, the test request further includes the number of test servers required to execute the target test script. The determining unit 502 may include a first determining module and a second determining module (not shown in the figure). The first determining module may be configured to determine whether the test server cluster has executed the test script matching the name, with the number as a first number. The second determining module may be configured to, in response to determining that the test server cluster has executed the test script matching the name, determine, as a second number, a target server in the test server cluster based on a comparison between the first number and the second number, the number of test servers in the test server cluster that have executed the test script.
In some optional implementation manners of this embodiment, the third determining module may be further configured to, in response to determining that the first number is not greater than the second number, select, in order from last to first time of executing the test script, the first number of test servers from the test servers that have executed the test script, and determine the selected test servers as target servers.
In some optional implementation manners of this embodiment, the third determining module may be further configured to, in response to determining that the first number is greater than the second number, determine a difference between the first number and the second number, select, in order from a large idle duration to a small idle duration of the test servers, a number of test servers from the test server cluster that is the difference, and determine the selected test server and the test server that has executed the test script as the target server.
In some optional implementations of this embodiment, the determining unit 502 may be further configured to: and in response to determining that the test server cluster does not execute the test script matched with the name, selecting the first number of test servers from the test server cluster according to the sequence of the idle time of the test servers from large to small, and determining the selected test servers as target servers.
In the apparatus provided in the foregoing embodiment of the present application, the determining unit 502 determines at least one target server in the test server cluster based on the name and the version number received by the receiving unit 501, then the first sending unit 503 sends a script obtaining instruction to the target server, so that the target server obtains a target test script based on the name, the version number, and the script storage server, and finally the second sending unit 504 sends a test instruction to each target server in response to receiving a target test script ready message returned by each target server in the at least one target server, so that each target server executes the target test script, thereby the target test script does not need to be downloaded and distributed uniformly by the control server, and the test efficiency is improved.
With further reference to FIG. 6, an illustration 600 of an interaction process between devices in a test system according to the present application is shown.
The test system comprises a control server, a script storage server and a test server cluster. The control server is configured to receive a test request including a name and a version number of a target test script, determine at least one target server in the test server cluster based on the name and the version number, and send a script acquisition instruction including the name and the version number to each target server in the at least one target server; the target server in the test server cluster is used for determining whether a test script matched with the name is stored locally, if not, acquiring the target test script from the script storage server, storing the target test script to the local, and sending a target test script ready message to the control server; the control server is further configured to send a test instruction to each target server in response to receiving a target test script ready message returned by each target server of the at least one target server, so that each target server executes the target test script.
As shown in fig. 6, the interaction process 600 between devices in the test system may include the following steps:
step 601, the control server receives a test request containing the name and version number of the target test script.
In this embodiment, the control server may receive a test request sent by the client, where the test request may include a name and a version number of the target test script. Here, the target test script may be a test script that is written in advance by a technician and needs to be executed in a current test. In practice, a test script (Testing script) refers to a series of instructions for a particular test that can be executed by an automated test tool.
Step 602, the control server determines at least one target server in the test server cluster based on the name and the version number.
In this embodiment, the control server may determine at least one target server in the test server cluster based on the name and the version number of the target test script. As an example, the control server may first determine whether the test server cluster executes a test script matching both the name and the version number, and if the test script is executed, may determine the test server in the test server cluster, which executed the test script, as the target server. If not, at least one server in the test server cluster can be randomly selected as a target server.
In some optional implementations of this embodiment, the test request may further include the number of test servers required to execute the target test script. The control server may be further configured to determine whether the test server cluster has executed a test script matching the name, using the number as a first number, and in response to determining that the test server cluster has executed a test script matching the name, determine a target server in the test server cluster, using the number of test servers in the test server cluster that have executed the test script as a second number, based on a comparison between the first number and the second number.
In some optional implementation manners of this embodiment, in response to determining that the first number is not greater than the second number, the control server may select, in order from the last time to the first time when the test script is executed, the first number of test servers from among the test servers on which the test script is executed, and determine the selected test server as a target server.
In some optional implementation manners of this embodiment, in response to determining that the first number is greater than the second number, the control server may determine a difference between the first number and the second number, and select, according to an order from a large idle duration to a small idle duration of the test servers, a number of test servers in the test server cluster that is the difference, and determine the selected test server and the test server that has executed the test script as the target server.
In some optional implementation manners of this embodiment, in response to determining that the test server cluster has not executed the test script matching the name, the control server may select the first number of test servers from the test server cluster according to a descending order of idle durations of the test servers, and determine the selected test servers as target servers.
Step 603, the control server sends a script obtaining instruction containing the name and the version number to each target server in the at least one target server.
In this embodiment, the control server may send a script obtaining instruction including the name and the version number to each of the at least one target server.
In step 604, the target server determines whether a test script matching the name is stored locally.
In this embodiment, the target server may determine whether a test script matching the name is locally stored, and store the test script locally.
Step 605, the target server obtains the target test script from the script storage server in response to determining that the test script matching the name is not stored locally.
In this embodiment, the target server may obtain the target test script from the script storage server and store the target test script to the local in response to determining that the test script matching the name is not stored locally.
In some optional implementation manners of this embodiment, the target server may determine whether a version number of the test script is consistent with a version number of the target test script in response to determining that the test script matched with the name is locally stored, and may obtain the target test script from the script storage server and store the target test script to the local in response to determining that the version number of the test script is not consistent with the version number of the target test script.
In some optional implementation manners of this embodiment, the target server may send a target test script ready message to the control server in response to determining that the version number of the test script is consistent with the version number of the target test script.
Step 606, the target server sends a target test script ready message to the control server.
In this embodiment, the target server may send a target test script ready message to the control server.
Step 607, the control server sends a test instruction to each target server in response to receiving the target test script ready message returned by each target server in the at least one target server, so that each target server executes the target test script.
In this embodiment, the control server may send a test instruction to each target server in response to receiving a target test script ready message returned by each target server of the at least one target server, so that each target server executes the target test script.
Referring now to FIG. 7, shown is a block diagram of a computer system 700 suitable for use in implementing a server according to embodiments of the present application. The server shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 7, the computer system 700 includes a Central Processing Unit (CPU)701, which can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data necessary for the operation of the system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
The following components are connected to the I/O interface 705: an input portion 706 including a keyboard, a mouse, and the like; an output section 707 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 708 including a hard disk and the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. A drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read out therefrom is mounted into the storage section 708 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 709, and/or installed from the removable medium 711. The computer program, when executed by a Central Processing Unit (CPU)701, performs the above-described functions defined in the method of the present application. It should be noted that the computer readable medium described herein can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes a receiving unit, a determining unit, a first transmitting unit, and a second transmitting unit. Where the names of these elements do not in some cases constitute a limitation on the elements themselves, for example, a receiving element may also be described as an "element that receives a test request containing the name and version number of a target test script".
As another aspect, the present application also provides a computer-readable medium, which may be contained in the apparatus described in the above embodiments; or may be present separately and not assembled into the device. The computer readable medium carries one or more programs which, when executed by the apparatus, cause the apparatus to: receiving a test request containing the name and the version number of a target test script; determining at least one target server in the test server cluster based on the name and the version number; sending a script obtaining instruction containing the name and the version number to each target server in the at least one target server so that the target server obtains the target test script based on the name, the version number and a script storage server; and in response to receiving a target test script ready message returned by each target server in the at least one target server, sending a test instruction to each target server to enable each target server to execute the target test script.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (16)

1. A test method for a control server, the control server communicatively coupled to a cluster of test servers, the cluster of test servers communicatively coupled to a script storage server, the method comprising:
receiving a test request containing the name and the version number of a target test script, wherein the test request further comprises the number of test servers required for executing the target test script;
determining at least one target server in the cluster of test servers based on the name and the version number; the determining at least one target server in the cluster of test servers based on the name and the version number comprises: determining whether the test server cluster executes the test script matched with the name or not by taking the number as a first number; in response to determining that the test server cluster executed a test script that matches the name, taking a number of test servers in the test server cluster that executed the test script as a second number, determining at least one target server in the test server cluster based on a comparison of the first number and the second number;
sending a script obtaining instruction containing the name and the version number to each target server in the at least one target server so that the target server obtains the target test script based on the name, the version number and the script storage server;
and in response to receiving a target test script ready message returned by each target server in the at least one target server, sending a test instruction to each target server to enable each target server to execute the target test script.
2. The method of claim 1, wherein determining the target server in the cluster of test servers based on the comparison of the first number to the second number comprises:
and in response to determining that the first number is not greater than the second number, selecting the first number of test servers from the test servers executing the test scripts in the order from the back to the first according to the time of executing the test scripts, and determining the selected test servers as target servers.
3. The method of claim 1, wherein determining the target server in the cluster of test servers based on the comparison of the first number to the second number comprises:
and in response to the fact that the first number is larger than the second number, determining a difference value between the first number and the second number, selecting the test servers with the number being the difference value from the test server cluster according to the sequence from large idle time length to small idle time length of the test servers, and determining the selected test servers and the test servers which execute the test scripts as target servers.
4. The method of claim 1, wherein determining at least one target server in the cluster of test servers based on the name and the version number further comprises:
and in response to the fact that the test server cluster does not execute the test script matched with the name, selecting the first number of test servers from the test server cluster according to the sequence of the idle time of the test servers from large to small, and determining the selected test servers as target servers.
5. A test apparatus for a control server, the control server communicatively coupled to a cluster of test servers, the cluster of test servers communicatively coupled to a script storage server, the apparatus comprising:
a receiving unit, configured to receive a test request including a name and a version number of a target test script, where the test request further includes the number of test servers required to execute the target test script;
a determining unit configured to determine at least one target server in the test server cluster based on the name and the version number;
a first sending unit, configured to send a script obtaining instruction including the name and the version number to each of the at least one target server, so that the target server obtains the target test script based on the name, the version number, and the script storage server;
a second sending unit, configured to send a test instruction to each target server in response to receiving a target test script ready message returned by each target server of the at least one target server, so that each target server executes the target test script;
the determination unit includes:
a first determining module, configured to determine whether the test server cluster has executed the test script matching the name, with the number as a first number;
and the second determining module is configured to, in response to determining that the test server cluster has executed the test script matched with the name, take the number of the test servers in the test server cluster, which have executed the test script, as a second number, and determine a target server in the test server cluster based on a comparison between the first number and the second number.
6. The testing device of claim 5, wherein the third determining module is further configured to:
and in response to determining that the first number is not greater than the second number, selecting the first number of test servers from the test servers executing the test scripts in the order from the back to the first according to the time of executing the test scripts, and determining the selected test servers as target servers.
7. The testing device of claim 6, wherein the third determining module is further configured to:
and in response to the fact that the first number is larger than the second number, determining a difference value between the first number and the second number, selecting the test servers with the number being the difference value from the test server cluster according to the sequence from large idle time length to small idle time length of the test servers, and determining the selected test servers and the test servers which execute the test scripts as target servers.
8. The testing device of claim 5, wherein the determining unit is further configured to:
and in response to the fact that the test server cluster does not execute the test script matched with the name, selecting the first number of test servers from the test server cluster according to the sequence of the idle time of the test servers from large to small, and determining the selected test servers as target servers.
9. A test system is characterized by comprising a control server, a script storage server and a test server cluster;
the control server is used for receiving a test request containing a name and a version number of a target test script, determining at least one target server in the test server cluster based on the name and the version number, and sending a script acquisition instruction containing the name and the version number to each target server in the at least one target server, wherein the test request further comprises the number of the test servers required for executing the target test script;
the target server in the test server cluster is used for determining whether a test script matched with the name is stored locally or not, if not, acquiring the target test script from the script storage server, storing the target test script to the local, and sending a target test script ready message to the control server;
the control server is further configured to send a test instruction to each target server in response to receiving a target test script ready message returned by each target server of the at least one target server, so that each target server executes the target test script;
the control server is further configured to determine whether the test server cluster has executed a test script matching the name, using the number as a first number, determine, in response to determining that the test server cluster has executed a test script matching the name, use the number of test servers in the test server cluster that have executed the test script as a second number, and determine a target server in the test server cluster based on a comparison of the first number and the second number.
10. The test system of claim 9, wherein the target server in the test server cluster is further configured to determine whether a version number of the test script is consistent with a version number of the target test script in response to determining that a test script matching the name is locally stored, and to retrieve the target test script from the script storage server and store the target test script locally in response to determining that the version number of the test script is inconsistent with the version number of the target test script, and send a target test script ready message to the control server.
11. The test system of claim 9, wherein a target server in the cluster of test servers is further configured to send a target test script ready message to the control server in response to determining that the version number of the test script is consistent with the version number of the target test script.
12. The test system of claim 9, wherein the control server is further configured to select the first number of test servers from the test servers that executed the test script in order from last to first according to the time for executing the test script in response to determining that the first number is not greater than the second number, and determine the selected test server as the target server.
13. The testing system of claim 9, wherein the control server is further configured to determine a difference between the first number and the second number in response to determining that the first number is greater than the second number, select a number of test servers from the cluster of test servers as the difference in order of idle durations of the test servers from large to small, and determine the selected test servers and the test servers that have executed the test script as target servers.
14. The test system according to claim 9, wherein the control server is further configured to select the first number of test servers from the test server cluster in order of a large idle duration of the test servers and determine the selected test server as the target server in response to determining that the test script matching the name has not been executed by the test server cluster.
15. A server, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-4.
16. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-4.
CN201711268134.1A 2017-12-05 2017-12-05 Test method, device and system Active CN109873731B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711268134.1A CN109873731B (en) 2017-12-05 2017-12-05 Test method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711268134.1A CN109873731B (en) 2017-12-05 2017-12-05 Test method, device and system

Publications (2)

Publication Number Publication Date
CN109873731A CN109873731A (en) 2019-06-11
CN109873731B true CN109873731B (en) 2021-04-30

Family

ID=66916458

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711268134.1A Active CN109873731B (en) 2017-12-05 2017-12-05 Test method, device and system

Country Status (1)

Country Link
CN (1) CN109873731B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110457205A (en) * 2019-07-05 2019-11-15 深圳壹账通智能科技有限公司 Interface test method, device, computer equipment and storage medium
CN113010405A (en) * 2019-12-20 2021-06-22 北京沃东天骏信息技术有限公司 Application program testing method and device
CN112564999A (en) * 2020-11-02 2021-03-26 鹏城实验室 Network measurement method, measurement management server, system and storage medium

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101404596B (en) * 2008-11-17 2010-12-08 福建星网锐捷网络有限公司 Multi-topological environmental test method, system and equipment
CN102075409B (en) * 2009-11-24 2013-03-20 华为技术有限公司 Method and system for processing request message as well as load balancer equipment
CN104252413B (en) * 2013-06-27 2018-06-05 阿里巴巴集团控股有限公司 A kind of automatized script generation method, apparatus and system
CN104461856B (en) * 2013-09-22 2018-04-20 阿里巴巴集团控股有限公司 Performance test methods, apparatus and system based on cloud computing platform
US9348573B2 (en) * 2013-12-02 2016-05-24 Qbase, LLC Installation and fault handling in a distributed system utilizing supervisor and dependency manager nodes
CN104198917B (en) * 2014-08-07 2017-04-19 兆讯恒达微电子技术(北京)有限公司 Automatic test system and automatic test method for magnetic card decoding chip
CN107302475A (en) * 2017-07-06 2017-10-27 郑州云海信息技术有限公司 The method of testing and device of a kind of Based on Distributed storage cluster

Also Published As

Publication number Publication date
CN109873731A (en) 2019-06-11

Similar Documents

Publication Publication Date Title
CN108182111B (en) Task scheduling system, method and device
US10572285B2 (en) Method and apparatus for elastically scaling virtual machine cluster
CN109388626B (en) Method and apparatus for assigning numbers to services
CN109873731B (en) Test method, device and system
CN110377440B (en) Information processing method and device
CN109240802B (en) Request processing method and device
CN115617511A (en) Resource data processing method and device, electronic equipment and storage medium
CN109828830B (en) Method and apparatus for managing containers
CN108696554B (en) Load balancing method and device
CN108764866B (en) Method and equipment for allocating resources and drawing resources
CN110225082B (en) Task processing method and device, electronic equipment and computer readable medium
CN109462491B (en) System, method and apparatus for testing server functionality
CN111125503B (en) Method and apparatus for generating information
CN114465919B (en) Network service testing method, system, electronic equipment and storage medium
CN108933802B (en) Method and apparatus for monitoring operation
CN111488268A (en) Dispatching method and dispatching device for automatic test
CN112559001B (en) Method and device for updating application
CN112579447A (en) Browser testing method and device
CN109947613B (en) File reading test method and device
CN108882229B (en) Information processing method and device
CN108494982B (en) Method and apparatus for generating information
CN108287792B (en) Method and apparatus for outputting information
CN112241357A (en) Method, device, equipment and computer readable medium for gray scale test
CN111460270B (en) Information pushing method and device
CN111831530A (en) Test method and device

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
GR01 Patent grant
GR01 Patent grant