CN113326201A - Software testing method based on distributed system, electronic equipment and storage medium - Google Patents

Software testing method based on distributed system, electronic equipment and storage medium Download PDF

Info

Publication number
CN113326201A
CN113326201A CN202110688051.8A CN202110688051A CN113326201A CN 113326201 A CN113326201 A CN 113326201A CN 202110688051 A CN202110688051 A CN 202110688051A CN 113326201 A CN113326201 A CN 113326201A
Authority
CN
China
Prior art keywords
identifier
application
service
configuration information
distributed system
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
CN202110688051.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.)
WeBank Co Ltd
Original Assignee
WeBank 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 WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN202110688051.8A priority Critical patent/CN113326201A/en
Publication of CN113326201A publication Critical patent/CN113326201A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management

Landscapes

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

Abstract

The invention discloses a software testing method based on a distributed system, electronic equipment and a storage medium, wherein the method comprises the following steps: receiving a first deployment request; the first deployment request carries a first service system identifier, an installation package of a first application and a first application identifier; determining setting configuration information corresponding to the first application identifier from a setting database; determining an address set corresponding to the first service system identifier from the configuration information; sending the installation package based on the address set; when a first call instruction in the test script is executed, according to a set message format, packaging a service type included in configuration information of the test script, a service identifier and data included in the first call instruction into a first request message; replacing a field value corresponding to a first set field in the first request message with a first logic area identifier determined when the test script is executed to obtain a second request message, and sending the second request message to a message bus; and receiving the response message distributed by the message bus.

Description

Software testing method based on distributed system, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a software testing method based on a distributed system, an electronic device, and a storage medium.
Background
With the development of computer technology, more and more technologies (e.g., big data, etc.) are applied in the financial field, and the traditional financial industry is gradually shifting to financial technology, however, the financial technology also puts higher demands on the technologies due to the security and real-time requirements of the financial industry. In the field of financial technology, in order to release a new version of an application quickly, a newly developed application is usually deployed into multiple sets of environments for testing, wherein one set of environments refers to a minimum copy of all business systems integrated on an enterprise line, and one set of environments consists of a distributed system.
Because different environments are isolated from each other and internet protocol addresses of devices in different environments are different, in the related art, when a plurality of distributed systems are adopted to test the same application, a test flow is set for each distributed system, a set of test cases is compiled for the test flow corresponding to each distributed system, and the workload of compiling and maintaining a plurality of sets of test cases is large.
Disclosure of Invention
In view of this, embodiments of the present invention provide a software testing method based on a distributed system, an electronic device, and a storage medium, so as to solve the technical problem in the related art that the workload of writing and maintaining multiple sets of test cases is large when multiple distributed systems are used to test the same application.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
the embodiment of the invention provides a software testing method based on a distributed system, which comprises the following steps:
receiving a first deployment request; the first deployment request carries a first service system identifier, an installation package of a first application and a first application identifier;
determining the setting configuration information corresponding to the first application identifier carried by the first deployment request from a setting database; the setting configuration information comprises the setting corresponding relation among the identification of the distributed system, the identification of the service system and the address set;
determining an address set corresponding to the service system identifier matched with the first service system identifier from the determined configuration information;
sending an installation package of the first application based on each address in the determined address set;
under the condition of executing a first call instruction in a test script, according to a set message format, packaging a service type included in configuration information of the test script, a service identifier and data included in the first call instruction into a first request message;
replacing a field value corresponding to a first set field in the first request message with a first logic area identifier determined in the process of executing the test script to obtain a second request message, and sending the second request message to a message bus;
receiving a response message which is distributed by the message bus and carries the service identifier; wherein the content of the first and second substances,
the field value corresponding to the first set field represents the service type; the first logic area identification represents a logic area identification corresponding to a first distributed system with the application to be tested; the first logical area identifier included in the second request message is used for the message bus to route the second request message to a device corresponding to any address in the address set corresponding to the first logical area identifier.
In the above solution, the setting of the message format includes:
a first setting field for writing the service type;
a second setting field for writing the service identifier;
and the third setting field is used for writing data included in the call instruction.
In the above scheme, the method further comprises:
acquiring an identifier of the first distributed system;
and determining a first logic area identifier corresponding to the identifier of the first distributed system based on the set corresponding relationship between the identifier of the distributed system and the logic area identifier.
In the foregoing solution, the obtaining the identifier of the first distributed system includes one of:
acquiring an identifier of a first distributed system selected by a set test interface;
and acquiring the identifier of the first distributed system from the configuration information of the test script by executing a timing task.
In the above solution, the configuration information includes a corresponding relationship between an identifier of a distributed system, an identifier of a logic area, an identifier of a service system, and an address set.
In the above solution, the first deployment request further includes an identifier of a distributed system for deploying the first application; the determining, from the determined configuration information, an address set corresponding to the service system identifier matched with the first service system identifier includes:
and determining an address set corresponding to the first deployment request from the set configuration information based on a first service system identifier and a distributed system identifier carried by the first deployment request.
In the above solution, before executing the test script, the method further includes:
acquiring at least one address information and an installation package of a second application;
sending a second deployment request to the first device; the second deployment request carries the at least one address information and an installation package of a second application; wherein the content of the first and second substances,
the at least one address information is used for the first device to send an installation package of the second application.
An embodiment of the present invention further provides an electronic device, including:
a first receiving unit, configured to receive a first deployment request; the first deployment request carries a first service system identifier, an installation package of a first application and a first application identifier;
the first determining unit is used for determining the setting configuration information corresponding to the first application identifier from a setting database; the setting configuration information comprises a setting corresponding relation between the service system identification and the address set;
a second determining unit, configured to determine, from the determined configuration information, an address set corresponding to the service system identifier that matches the first service system identifier;
a first sending unit, configured to send an installation package of the first application based on each address in the determined address set;
the device comprises a packaging unit, a processing unit and a processing unit, wherein the packaging unit is used for packaging the service type included in the configuration information of the test script, the service identification and the data included in the first calling instruction into a first request message according to a set message format under the condition of executing the first calling instruction in the test script;
a replacing unit, configured to replace a field value corresponding to a first set field in the first request message with a first logic area identifier determined in a process of executing the test script, to obtain a second request message, and send the second request message to a message bus;
a receiving unit, configured to receive a response message carrying the service identifier and sent by the message bus; the field value corresponding to the first set field represents the service type; the first logic area identification represents a logic area identification corresponding to a first distributed system with the application to be tested; the first logical region identifier included in the second request message is used for the message bus to route the second request message to a device corresponding to any address in an address set corresponding to the first logical region identifier.
An embodiment of the present invention further provides an electronic device, including: a processor and a memory for storing a computer program capable of running on the processor,
when the computer program is run, the processor is used for executing the steps of the software testing method based on the distributed system.
The embodiment of the invention also provides a storage medium, wherein a computer program is stored on the storage medium, and when the computer program is executed by a processor, the steps of the software testing method based on the distributed system are realized.
In the embodiment of the invention, the setting configuration information stored in the setting database comprises the setting corresponding relation between the service system identification and the address set, the address information corresponding to the first service system identification carried by the first deployment request can be determined from the setting configuration information, and the first deployment request does not need to carry an IP address, so that the first application can be deployed to different distributed systems by sharing the same flow, and the application deployment efficiency can be improved. When a first call instruction in the test script is executed, according to a set message format, packaging a service type included in configuration information of the test script, a service identifier and data included in the first call instruction into a first request message; writing only the service type in a first setting field of the first request message, and not specifying a first logic area number corresponding to a first distributed system deployed with the application to be tested; under the condition that the number of the first logic area is determined in the process of executing the test script, the field value corresponding to the first set field in the first request message is replaced by the determined identifier of the first logic area to obtain a second request message, the second request message is sent to the message bus, so that the message bus determines the corresponding IP address according to the identifier of the first logic area, and the second message is sent based on the determined IP address. Because the logic area identifications, the distributed systems and the address sets correspond to one another, the message bus can determine corresponding IP addresses according to the logic area identifications, and the IP addresses of the devices of the distributed systems with the to-be-tested applications are not required to be appointed in the test scripts, the electronic devices can be switched to different distributed systems to test the to-be-tested applications by replacing different logic area identifications, so that the electronic devices can share the same set of test scripts to test the to-be-tested applications arranged in different distributed systems, relevant personnel do not need to compile and maintain multiple sets of test cases, and the efficiency of compiling and maintaining the test scripts can be improved.
Drawings
Fig. 1 is a schematic flow chart of an implementation process of software testing based on a distributed system according to an embodiment of the present invention;
FIG. 2 is a schematic diagram illustrating an implementation flow of software testing based on a distributed system according to another embodiment of the present invention;
FIG. 3 is a schematic diagram illustrating a flow of implementing software testing based on a distributed system according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to another embodiment of the present invention;
fig. 5 is a schematic diagram of a hardware component structure of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Fig. 1 is a schematic view of an implementation process of a software testing method based on a distributed system according to an embodiment of the present invention, where an execution subject of the process is an electronic device such as a terminal and a server. As shown in fig. 1, the software testing method based on the distributed system includes:
step 101: receiving a first deployment request; the first deployment request carries a first service system identifier, an installation package of a first application and a first application identifier.
Here, the first deployment request is for requesting deployment of the first application to the corresponding distributed system.
Step 102: determining the setting configuration information corresponding to the first application identifier carried by the first deployment request from a setting database; the setting configuration information comprises a setting corresponding relation between the service system identification and the address set.
The setting database stores setting configuration information corresponding to a plurality of applications; the configuration information at least comprises a set corresponding relation between at least one service system identification and at least one address set.
The electronic equipment determines the setting configuration information corresponding to the first application identifier from the setting database based on the setting corresponding relation between the application identifier and the setting configuration information.
In actual application, when a developer develops a new application or develops a new function of the application, the developer needs to test the new application or the application with the new function, and the developer can configure the application to be tested through a set configuration interface. And the electronic equipment writes the application identification of the application to be tested and the corresponding setting configuration information into a set database in a correlated manner under the condition of acquiring the setting configuration information corresponding to the application to be tested. The configuration information includes a set correspondence between an identifier of the distributed system, information of the logical area, an identifier of the service system, and an address (IP address) set. The information of the logical area includes a service type (or called name of the logical area) and a logical area identifier (or called ID of the logical area). The address set refers to a set of IP addresses of devices constituting the distributed system. The logical area identifier may be divided geographically.
In some embodiments, the configuration information includes a configuration correspondence between an identifier of the distributed system, an identifier of the logical area, an identifier of the business system, and an address set. That is, the configuration information includes a set correspondence relationship between an identifier of at least one distributed system, at least one logical area identifier, at least one service system identifier, and at least one address set.
Illustratively, the setting configuration information stored in the setting database is shown in table 1:
TABLE 1
Figure BDA0003125495990000061
Figure BDA0003125495990000071
Wherein, Rdcn in the table corresponds to a service type, for example, Rdcn represents a private transfer service; m0, N0, K0 and L0 correspond to logical region identifications.
Step 103: and determining an address set corresponding to the service system identifier matched with the first service system identifier from the set configuration information.
And the electronic equipment determines an address set corresponding to the service system identifier matched with the first service system identifier based on the set corresponding relation included in the determined set configuration information.
Considering that the same application may be deployed in different distributed systems, the setting configuration information corresponding to the same application includes identifiers of at least two distributed systems, and different distributed system identifiers may correspond to the same service system, therefore, in order to determine an address set corresponding to a first deployment request more quickly and accurately, so as to deploy a first application to a corresponding distributed system, in some embodiments, in a case that the setting configuration information includes a setting correspondence relationship between an identifier of a distributed system, a logical area identifier, a service system identifier, and an address set, the first deployment request further includes an identifier of a distributed system used for deploying the first application; the determining, from the configuration information, an address set corresponding to the service system identifier matched with the first service system identifier includes:
and determining an address set corresponding to the first deployment request from the set configuration information based on a first service system identifier and a distributed system identifier carried by the first deployment request.
Here, when determining the setting configuration information corresponding to the first application identifier, the electronic device determines, based on the setting correspondence included in the setting configuration information and based on the first service system identifier and the identifier of the distributed system carried in the first deployment request, an address set corresponding to the first deployment request from the setting configuration information.
It should be noted that, when the first deployment request does not carry the identifier of the distributed system, the representation does not specify the distributed system, and the first application is deployed to all devices corresponding to all address sets corresponding to the identifier of the first service system, so that the first application is deployed to all distributed systems corresponding to the identifier of the first service system.
Step 104: and sending the installation package of the first application based on each address in the determined address set.
The electronic device sends the installation package of the first application carried in the first deployment request based on each address in the determined address set, so that the device receiving the installation package of the first application installs the first application.
In this embodiment, the first deployment request does not need to carry an IP address, so that the first application can be deployed to different distributed systems by sharing the same flow, and the application deployment efficiency can be improved.
Step 105: and under the condition of executing a first call instruction in the test script, according to a set message format, packaging the service type included in the configuration information of the test script, the service identifier and the data included in the first call instruction into a first request message.
Here, the electronic device executes the test instruction in the test script when receiving at least one test script corresponding to the application to be tested and detecting a set test start operation, so as to test the set function of the application to be tested by using the test script and verify whether the test result is consistent with the set result. The test script is corresponding to the automatic test case.
The application to be tested includes a first application deployed to the distributed system by the method described in steps 101 to 104, and may also include a second application deployed to the distributed system by another method, for example, by another electronic device.
In actual application, the same test script is adopted to test the same application to be tested deployed in at least two different distributed systems. Each distributed system forms a test environment, each distributed system comprises a plurality of service systems, and one subsystem can correspond to one cluster. The set of test scripts comprises at least one test script, and each test script is used for testing at least one set function of the first application.
And the electronic equipment judges whether the currently executed test instruction is the first call instruction or not in the process of executing the test instruction included in the test script to obtain a judgment result. In actual application, when detecting that the currently executed test instruction includes the setting identifier, the electronic device determines the currently executed test instruction as a first call instruction.
And under the condition that the judgment result represents that the currently executed test instruction is the first call instruction, encapsulating the service type included in the configuration information of the test script, the service identifier and the data included in the first call instruction into a first request message according to a set message format.
The test script comprises configuration information and a test instruction; the configuration information at least comprises the identification of the test script and the service type of the first service corresponding to the setting function to be tested. The first call instruction characterizes an instruction to call any service provided by any business system in the distributed system. The first calling instruction comprises the service identification and related data of the called service.
In some embodiments, the setting a message format comprises:
a first setting field for writing the service type;
a second setting field for writing the service identifier;
and the third setting field is used for writing data included in the calling instruction, wherein the data includes the data requested to be acquired and may also include an incoming parameter.
In practical application, the field name of the first setting field is targetDCN; the field name of the second field is Service ID; the field name of the third field is Data, and the first request message is as follows:
message field Field value
Second setting field 10000256
A first setting field Rdcn
Third setting field Data
Wherein the service identification is 10000256; the identification of the traffic type is Rdcn.
Step 106: and replacing the field value corresponding to the first set field in the first request message with the first logic area identifier determined in the process of executing the test script to obtain a second request message, and sending the second request message to a message bus.
The field value corresponding to the first set field represents the service type; the first logic area identification represents a logic area identification corresponding to a first distributed system with the application to be tested; the first logical area identifier included in the second request message is used for the message bus to route the second request message to a device corresponding to any address in the address set corresponding to the first logical area identifier.
The electronic device determines a first logic area identifier during executing the test script, replaces a field value corresponding to a first set field in the first request message with the determined first logic area identifier to obtain a second request message under the condition that the first logic area identifier is determined and the first request message is obtained, and sends the second request message to the message bus. It should be noted that, at this time, the electronic device utilizes the test script to test the application to be tested deployed in the first distributed system.
The electronic device may obtain the first logic area identifier selected by the tester, and may also obtain the first logic area identifier in other manners, where the manner of obtaining the first logic area identifier is not limited herein. In practical application, a tester may select the first logic area identifier in the process of executing the test script by the electronic device, or may trigger the electronic device to start executing the test script after selecting the first logic area identifier.
In some embodiments, when the determined first logical region is identified as M0, the second request message is as follows:
message field Field value
Second setting field 10000256
A first setting field M0
Third setting field Data
In practical applications, when the field name of the first setting field is targetDCN, the field name of the second field is Service ID, and the field name of the third field is Data, the second request message is: { \\ "serviceId \", "'01300181 \", \\ "targetDCN \", "' M0\", \ "input \", "{ \\" data \ "," "data \".
After the electronic device sends the second request message to the message bus, the message bus determines a first address set corresponding to the first logic area identifier from the first set corresponding relation based on the first logic area identifier in the second request message; and the message bus routes the second request message to the equipment corresponding to any address in the determined first address set so as to trigger the equipment to process the second request message, and sends a response message corresponding to the second request message to the message bus based on the processing result and the service identifier included in the second request message. And under the condition that the message bus receives the response message corresponding to the second request message, the message bus sends the response message corresponding to the second request message to the electronic equipment sending the second request message based on the service identifier carried by the response message corresponding to the second request message.
In actual application, the first set correspondence represents a set correspondence between the logical area identifier and the address set. The message bus accesses the setting database, and a first address set corresponding to the first logic area identifier is determined from the setting configuration information stored in the setting database. The setting configuration information is shown in table 1 above. In the case that the setting configuration information includes a setting correspondence between an identifier of the distributed system, a logical area identifier, an identifier of the service system, and an address set, the electronic device may determine, from the setting configuration information corresponding to the first application, a first address set corresponding to the first logical area identifier.
In order to save the time consumed by the tester to search or select the first logic area identifier and improve the efficiency of the automated testing, in some embodiments, the electronic device may further determine the first logic area identifier by:
acquiring an identifier of the first distributed system;
and determining a first logic area identifier corresponding to the identifier of the first distributed system based on the set corresponding relationship between the identifier of the distributed system and the logic area identifier.
Here, the electronic device may obtain an identifier of the first distributed system selected by the tester; when the configuration information in the test script further includes the identifier of the first distributed system, the electronic device may also obtain the identifier of the first distributed system from the configuration information in the test script.
Under the condition that the electronic equipment acquires the identifier of the first distributed system, the first logic area identifier corresponding to the identifier of the first distributed system is determined based on the set corresponding relationship between the identifier of the distributed system and the logic area identifier.
In actual application, the electronic device accesses the setting database, and determines a first logic area identifier corresponding to the identifier of the first distributed system from the setting database. The setting database stores the setting corresponding relation between the identification of the distributed system and the logic area identification.
In practical application, under the condition that the setting configuration information stored in the setting database includes the identifiers of the distributed systems, the logical area identifiers, the service system identifiers and the address set, the electronic device may determine the target service system identifier corresponding to the service identifier included in the first call instruction based on the setting correspondence between the service identifier and the service system identifier, and determine the corresponding first logical area identifier from the setting configuration information corresponding to the first application based on the acquired identifier of the first distributed system and the target service system identifier.
Considering that the testing personnel may manually select the identifier of the first distributed system, the personnel writing the testing script may also write the identifier of the first distributed system into the configuration information of the testing specimen, and in some examples, the obtaining the identifier of the first distributed system includes one of the following:
acquiring an identifier of a first distributed system selected or input through a set test interface;
and acquiring the identifier of the first distributed system from the configuration information of the test script by executing a timing task.
Here, when testing an application to be tested deployed in a first distributed system, the electronic device obtains an identifier of the first distributed system selected or input by a tester through a set test interface, and transmits the obtained identifier of the first distributed system to a set of test scripts corresponding to the application to be tested.
The configuration information in the test script may further include an identifier of the first distributed system, and the electronic device obtains the identifier of the first distributed system from the configuration information in the test script by executing the timing task when testing the application to be tested deployed in the first distributed system.
Step 107: and receiving a response message which is distributed by the message bus and carries the service identification.
The electronic device receives a response message distributed by the message bus based on the service identification.
In the embodiment of the invention, when a first call instruction in a test script is executed, a service type included in configuration information of the test script, a service identifier and data included in the first call instruction are packaged into a first request message according to a set message format; writing only the service type in a first setting field of the first request message, and not specifying a first logic area number corresponding to a first distributed system deployed with the application to be tested; when the number of the first logic area is determined in the process of executing the test script, the field value corresponding to the first set field in the first request message is replaced by the determined identifier of the first logic area to obtain a second request message, the second request message is sent to the message bus, so that the message bus determines the corresponding IP address according to the identifier of the first logic area, and the second message is sent based on the determined IP address. Because the logic area identifications correspond to the distributed systems and the address sets one by one, the message bus can determine corresponding IP addresses according to the logic area identifications, and the IP addresses of the devices of the distributed systems with the to-be-tested applications are not required to be appointed in the test scripts, the electronic devices can be switched to different distributed systems to test the to-be-tested applications by replacing different logic area identifications, so that the electronic devices can share the same set of test scripts to test the to-be-tested applications arranged in different distributed systems, relevant personnel do not need to compile and maintain a plurality of sets of test cases, and the efficiency of compiling and maintaining the test scripts can be improved.
In consideration of the fact that in practical application, a tester may uniformly deploy an application to be tested to different distributed systems through other devices, fig. 2 shows an implementation flow diagram of a software testing method based on a distributed system according to another embodiment of the present invention. The embodiment corresponding to fig. 2 differs from the embodiment corresponding to fig. 1 in that, before executing the test script, the method further comprises:
step 201: acquiring at least one address information and an installation package of a second application; wherein the at least one address information is used for the first device to send an installation package of the second application.
The electronic equipment acquires at least one piece of address information input or selected by the tester, and acquires an installation package of the second application selected by the tester. And at least one piece of address information is corresponding to the distributed system needing to deploy the second application.
Step 202: sending a second deployment request to the first device; the second deployment request carries the at least one address information and an installation package of a second application.
The electronic device sends a second deployment request to the first device under the condition that at least one piece of address information and an installation package of a second application are obtained, wherein the second deployment request carries the obtained address information and the installation package of the second application. And the first device sends the installation package of the second application based on each address information carried by the second deployment request under the condition that the second deployment request is received, so that the device in the corresponding distributed system installs the second application under the condition that the installation package of the second application is received.
For the implementation process of step 203 to step 205, please refer to the related description of step 105 to step 107, which is not described herein. It should be noted that, because the application to be tested is the second application, after the electronic device executes step 205, in the case of executing step 107, the first logic area identifier represents the logic area identifier corresponding to the first distributed system in which the second application is deployed.
In this embodiment, the electronic device sends the second deployment request to the first device when acquiring the at least one piece of address information and the installation package of the second application, so as to distribute the installation package of the second application through the first device, thereby deploying the second application to different distributed systems, which can reduce the data processing amount of the electronic device executing the test script, and improve the data processing speed of the electronic device executing the test script.
Fig. 3 is a schematic flow chart illustrating an implementation of the distributed system-based software testing method according to an embodiment of the present invention. As shown in fig. 3, the software testing method based on the distributed system includes:
step 301: receiving a first deployment request; the first deployment request carries a first service system identifier, an installation package of a first application, a first application identifier, and an identifier of a first distributed system for deploying the first application.
Here, the first deployment request is for requesting deployment of the first application to the corresponding distributed system.
Step 302: determining the setting configuration information corresponding to the first application identifier carried by the first deployment request from a setting database; the setting configuration information comprises the setting corresponding relation among the identification of the distributed system, the identification of the logic area, the identification of the service system and the address set.
The implementation process of step 302 refers to the related description in step 102, which is not repeated herein.
Step 303: and determining an address set corresponding to the first deployment request from the set configuration information based on the first service system identifier and the identifier of the first distributed system.
The implementation process of step 303 refers to the related description of step 103, which is not described herein again.
Step 304: and sending the installation package of the first application based on each address in the determined address set.
Step 305: and under the condition of executing a first call instruction in the test script, according to a set message format, packaging the service type included in the configuration information of the test script, the service identifier and the data included in the first call instruction into a first request message.
The electronic equipment executes the test script to test the first application in the first distributed system.
Step 306: and acquiring the identification of the first distributed system under the condition of executing the test script.
Wherein step 306 and step 305 may be performed simultaneously.
Step 307: and determining a first logic area identifier from the set configuration information based on the identifier of the first distributed system and the target service system identifier corresponding to the first service identifier.
Step 308: and replacing the field value corresponding to the first set field in the first request message with the determined first logic area identifier to obtain a second request message, and sending the second request message to a message bus.
The field value corresponding to the first set field represents the service type; the first logic area identification represents a logic area identification corresponding to a first distributed system with the application to be tested; the first logic area identifier included in the second request message is used for the message bus to route the second request message to a device corresponding to any address in an address set determined based on a first set corresponding relationship; the first set correspondence represents a set correspondence between the logical area identification and the address set.
Step 309: and receiving a response message which is distributed by the message bus and carries the service identification.
In order to implement the software testing method based on the distributed system according to the embodiment of the present invention, an embodiment of the present invention further provides an electronic device, as shown in fig. 4, where the electronic device includes:
a first receiving unit 41, configured to receive a first deployment request; the first deployment request carries a first service system identifier, an installation package of a first application and a first application identifier;
a first determining unit 42, configured to determine, from a setting database, setting configuration information corresponding to the first application identifier; the setting configuration information comprises a setting corresponding relation between the service system identification and the address set;
a second determining unit 43, configured to determine, from the determined configuration information, an address set corresponding to the service system identifier that matches the first service system identifier;
a first sending unit 44, configured to send an installation package of the first application based on each address in the determined address set; an encapsulating unit 45, configured to encapsulate, as a first request message, a service type included in configuration information of a test script, and a service identifier and data included in a first call instruction according to a set message format when the first call instruction in the test script is executed;
a replacing unit 46, configured to replace a field value corresponding to a first set field in the first request message with a first logic area identifier determined in a process of executing the test script, to obtain a second request message, and send the second request message to a message bus;
a second receiving unit 47, configured to receive a response message carrying the service identifier and distributed by the message bus; wherein the content of the first and second substances,
the field value corresponding to the first set field represents the service type; the first logic area identification represents a logic area identification corresponding to a first distributed system with the application to be tested; the first logical area identifier included in the second request message is used for the message bus to route the second request message to a device corresponding to any address in the address set corresponding to the first logical area identifier.
In some embodiments, the setting a message format comprises:
a first setting field for writing the service type;
a second setting field for writing the service identifier;
and the third setting field is used for writing data included in the call instruction.
In some embodiments, the electronic device further comprises:
a first obtaining unit, configured to obtain an identifier of the first distributed system;
and the third determining unit is used for determining the first logic area identifier corresponding to the identifier of the first distributed system based on the set corresponding relationship between the identifier of the distributed system and the logic area identifier.
In some embodiments, the first obtaining unit is specifically configured to:
acquiring an identifier of a first distributed system selected or input through a set test interface;
and acquiring the identifier of the first distributed system from the configuration information of the test script by executing a timing task.
In some embodiments, the configuration information includes a configuration correspondence between an identifier of the distributed system, an identifier of the logical area, an identifier of the business system, and an address set.
In some embodiments, the first deployment request further includes an identification of a distributed system for deploying the first application; the second determining unit 43 is specifically configured to: and determining an address set corresponding to the first deployment request from the set configuration information based on a first service system identifier and a distributed system identifier carried by the first deployment request.
In some embodiments, the electronic device further comprises:
a second obtaining unit, configured to obtain at least one of address information and an installation package of a second application before executing the test script;
a second sending unit, configured to send a second deployment request to the first device; the second deployment request carries the at least one address information and an installation package of a second application; wherein the content of the first and second substances,
the at least one address information is used for the first device to send an installation package of the second application.
In practical applications, each Unit included in the electronic device may be implemented by a Processor in the electronic device, such as a Central Processing Unit (CPU), a Digital Signal Processor (DSP), a Micro Control Unit (MCU), a Programmable Gate Array (FPGA), or the like, or implemented by a Processor and a communication interface in the electronic device.
It should be noted that: in the electronic device provided in the above embodiment, when performing software testing based on a distributed system, only the division of the program modules is illustrated, and in practical applications, the processing distribution may be completed by different program modules according to needs, that is, the internal structure of the apparatus may be divided into different program modules to complete all or part of the processing described above. In addition, the electronic device provided by the above embodiment and the embodiment of the software testing method based on the distributed system belong to the same concept, and the specific implementation process thereof is described in the embodiment of the method, which is not described herein again.
Based on the hardware implementation of the program module, in order to implement the method according to the embodiment of the present invention, an embodiment of the present invention further provides an electronic device. Fig. 5 is a schematic diagram of a hardware component structure of an electronic device according to an embodiment of the present invention, and as shown in fig. 5, the electronic device 5 includes:
a communication interface 51 capable of information interaction with other devices such as network devices and the like;
and the processor 52 is connected with the communication interface 51 to realize information interaction with other devices, and is used for executing the software testing method based on the distributed system provided by one or more of the technical solutions when running a computer program. And the computer program is stored on the memory 53.
Of course, in practice, the various components in the electronic device 5 are coupled together by a bus system 54. It will be appreciated that the bus system 54 is used to enable communications among the components. The bus system 54 includes a power bus, a control bus, and a status signal bus in addition to the data bus. For clarity of illustration, however, the various buses are labeled as bus system 54 in fig. 5.
The memory 53 in embodiments of the present invention is used to store various types of data to support the operation of the electronic device 5. Examples of such data include: any computer program for operating on the electronic device 5.
It will be appreciated that the memory 53 can be either volatile memory or nonvolatile memory, and can include both volatile and nonvolatile memory. Among them, the nonvolatile Memory may be a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), a magnetic random access Memory (FRAM), a Flash Memory (Flash Memory), a magnetic surface Memory, an optical disk, or a Compact Disc Read-Only Memory (CD-ROM); the magnetic surface storage may be disk storage or tape storage. Volatile Memory can be Random Access Memory (RAM), which acts as external cache Memory. By way of illustration and not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), Enhanced Synchronous Dynamic Random Access Memory (Enhanced DRAM), Synchronous Dynamic Random Access Memory (SLDRAM), Direct Memory (DRmb Access), and Random Access Memory (DRAM). The memory 53 described in connection with the embodiments of the invention is intended to comprise, without being limited to, these and any other suitable types of memory.
The method disclosed in the above embodiments of the present invention may be applied to the processor 52, or implemented by the processor 52. Processor 52 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 52. The processor 52 described above may be a general purpose processor, a DSP, or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like. Processor 52 may implement or perform the methods, steps, and logic blocks disclosed in embodiments of the present invention. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed by the embodiment of the invention can be directly implemented by a hardware decoding processor, or can be implemented by combining hardware and software modules in the decoding processor. The software modules may be located in a storage medium located in the memory 53, and the processor 52 reads the program in the memory 53 and performs the steps of the aforementioned method in conjunction with its hardware.
Optionally, when the processor 52 executes the program, the corresponding process implemented by the terminal in each method according to the embodiment of the present invention is implemented, and for brevity, no further description is given here.
In an exemplary embodiment, the present invention further provides a storage medium, i.e. a computer storage medium, in particular a computer readable storage medium, for example comprising a first memory 53 storing a computer program, which is executable by a processor 52 of a terminal to perform the steps of the aforementioned method. The computer readable storage medium may be Memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface Memory, optical disk, or CD-ROM.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described device embodiments are merely illustrative, for example, the division of the unit is only a logical functional division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed on a plurality of network units; some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, all the functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may be separately used as one unit, or two or more units may be 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 unit.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; and the aforementioned storage medium includes: a mobile storage device, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The technical means described in the embodiments of the present invention may be arbitrarily combined without conflict.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.

Claims (10)

1. A software testing method based on a distributed system is characterized by comprising the following steps:
receiving a first deployment request; the first deployment request carries a first service system identifier, an installation package of a first application and a first application identifier;
determining the setting configuration information corresponding to the first application identifier from a setting database; the setting configuration information comprises a setting corresponding relation between the service system identification and the address set;
determining an address set corresponding to the service system identifier matched with the first service system identifier from the determined configuration information;
sending an installation package of the first application based on each address in the determined address set;
under the condition of executing a first call instruction in a test script, according to a set message format, packaging a service type included in configuration information of the test script, a service identifier and data included in the first call instruction into a first request message;
replacing a field value corresponding to a first set field in the first request message with a first logic area identifier determined in the process of executing the test script to obtain a second request message, and sending the second request message to a message bus;
receiving a response message which is distributed by the message bus and carries the service identifier; wherein the content of the first and second substances,
the field value corresponding to the first set field represents the service type; the first logic area identification represents a logic area identification corresponding to a first distributed system with the application to be tested; the first logical area identifier included in the second request message is used for the message bus to route the second request message to a device corresponding to any address in the address set corresponding to the first logical area identifier.
2. The method of claim 1, wherein the setting the message format comprises:
a first setting field for writing the service type;
a second setting field for writing the service identifier;
and the third setting field is used for writing data included in the call instruction.
3. The method of claim 1, further comprising:
acquiring an identifier of the first distributed system;
and determining a first logic area identifier corresponding to the identifier of the first distributed system based on the set corresponding relationship between the identifier of the distributed system and the logic area identifier.
4. The method of claim 3, wherein obtaining the identity of the first distributed system comprises one of:
acquiring an identifier of a first distributed system selected or input through a set test interface;
and acquiring the identifier of the first distributed system from the configuration information of the test script by executing a timing task.
5. The method of claim 1, wherein the configuration information comprises a configuration correspondence between an identifier of a distributed system, an identifier of a logical area, an identifier of a service system, and an address set.
6. The method of claim 5, wherein the first deployment request further comprises an identification of a distributed system for deploying the first application;
the determining, from the determined configuration information, an address set corresponding to the service system identifier matched with the first service system identifier includes:
and determining an address set corresponding to the first deployment request from the set configuration information based on a first service system identifier and a distributed system identifier carried by the first deployment request.
7. The method of any of claims 1 to 4, wherein prior to executing the test script, the method further comprises:
acquiring at least one address information and an installation package of a second application;
sending a second deployment request to the first device; the second deployment request carries the at least one address information and an installation package of a second application; wherein the content of the first and second substances,
the at least one address information is used for the first device to send an installation package of the second application.
8. An electronic device, comprising:
a first receiving unit, configured to receive a first deployment request; the first deployment request carries a first service system identifier, an installation package of a first application and a first application identifier;
the first determining unit is used for determining the setting configuration information corresponding to the first application identifier from a setting database; the setting configuration information comprises a setting corresponding relation between the service system identification and the address set;
a second determining unit, configured to determine, from the determined configuration information, an address set corresponding to the service system identifier that matches the first service system identifier;
a first sending unit, configured to send an installation package of the first application based on each address in the determined address set;
the device comprises a packaging unit, a processing unit and a processing unit, wherein the packaging unit is used for packaging the service type included in the configuration information of the test script, the service identification and the data included in the first calling instruction into a first request message according to a set message format under the condition of executing the first calling instruction in the test script;
a replacing unit, configured to replace a field value corresponding to a first set field in the first request message with a first logic area identifier determined in a process of executing the test script, to obtain a second request message, and send the second request message to a message bus;
a second receiving unit, configured to receive a response message carrying the service identifier and sent by the message bus; the field value corresponding to the first set field represents the service type; the first logic area identification represents a logic area identification corresponding to a first distributed system with the application to be tested; the first logical area identifier included in the second request message is used for the message bus to route the second request message to a device corresponding to any address in the address set corresponding to the first logical area identifier.
9. An electronic device, comprising: a processor and a memory for storing a computer program capable of running on the processor,
wherein the processor is adapted to perform the steps of the method of any one of claims 1 to 7 when running the computer program.
10. A storage medium having a computer program stored thereon, the computer program, when being executed by a processor, realizing the steps of the method of any one of claims 1 to 7.
CN202110688051.8A 2021-06-21 2021-06-21 Software testing method based on distributed system, electronic equipment and storage medium Pending CN113326201A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110688051.8A CN113326201A (en) 2021-06-21 2021-06-21 Software testing method based on distributed system, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110688051.8A CN113326201A (en) 2021-06-21 2021-06-21 Software testing method based on distributed system, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113326201A true CN113326201A (en) 2021-08-31

Family

ID=77424116

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110688051.8A Pending CN113326201A (en) 2021-06-21 2021-06-21 Software testing method based on distributed system, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113326201A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116431523A (en) * 2023-06-12 2023-07-14 建信金融科技有限责任公司 Test data management method, device, equipment, storage medium and product

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116431523A (en) * 2023-06-12 2023-07-14 建信金融科技有限责任公司 Test data management method, device, equipment, storage medium and product
CN116431523B (en) * 2023-06-12 2023-08-29 建信金融科技有限责任公司 Test data management method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
WO2018157588A1 (en) Firmware burning method, system, computer device and storage medium
CN112965700B (en) Routing-based micro-service processing method and device, computer equipment and medium
CN110673941B (en) Migration method of micro-services in multiple computer rooms, electronic equipment and storage medium
CN106302609B (en) Access method and device
CN106294113B (en) creation method and device based on programmable test service
CN110365724B (en) Task processing method and device and electronic equipment
CN107870802B (en) Virtual machine migration method and device
CN114205342B (en) Service debugging routing method, electronic equipment and medium
CN112671860A (en) Service access method, system, electronic device and medium for kubernets cluster
CN110716845B (en) Log information reading method of Android system
WO2021027700A1 (en) Application program starting method and apparatus, terminal device and readable storage medium
CN113810230A (en) Method, device and system for carrying out network configuration on containers in container cluster
CN113141405A (en) Service access method, middleware system, electronic device, and storage medium
CN113326201A (en) Software testing method based on distributed system, electronic equipment and storage medium
US20220206836A1 (en) Method and Apparatus for Processing Virtual Machine Migration, Method and Apparatus for Generating Virtual Machine Migration Strategy, Device and Storage Medium
CN111712795A (en) Method, apparatus, computer program product and readable medium for evaluating application deployment
CN112860507A (en) Method and device for controlling sampling rate of distributed link tracking system
CN109375946B (en) Method and system for managing component package of node package manager
CN116028290A (en) Solid state disk testing method, device, equipment and medium
CN113535578B (en) CTS test method, CTS test device and CTS test equipment
US10255155B2 (en) Scheduler
CN112738181B (en) Method, device and server for cluster external IP access
CN115794384A (en) Code compiling task allocation method, device, equipment and storage medium
CN107688479B (en) Android system network cluster, construction method thereof, and Android system network cluster data processing method and system
CN113626295A (en) Pressure measurement data processing method and system and computer readable storage 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