WO2023273561A1 - Test method and apparatus, electronic device, and storage medium - Google Patents

Test method and apparatus, electronic device, and storage medium Download PDF

Info

Publication number
WO2023273561A1
WO2023273561A1 PCT/CN2022/088910 CN2022088910W WO2023273561A1 WO 2023273561 A1 WO2023273561 A1 WO 2023273561A1 CN 2022088910 W CN2022088910 W CN 2022088910W WO 2023273561 A1 WO2023273561 A1 WO 2023273561A1
Authority
WO
WIPO (PCT)
Prior art keywords
test
job
interface
qps
optimal
Prior art date
Application number
PCT/CN2022/088910
Other languages
French (fr)
Chinese (zh)
Inventor
李雄清
关健
李永
任政委
周东琳
Original Assignee
中国民航信息网络股份有限公司
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 中国民航信息网络股份有限公司 filed Critical 中国民航信息网络股份有限公司
Publication of WO2023273561A1 publication Critical patent/WO2023273561A1/en

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
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • 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
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • 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
    • G06F11/3692Test management for test results analysis

Definitions

  • the present invention relates to the field of computer technology, more specifically, to a test method, device, electronic equipment and storage medium.
  • testers of each project select performance testing tools for performance testing according to the projects they are responsible for.
  • testers of different projects may have different selections of performance testing tools, as well as inconsistencies in performance testing standards, scripts, execution processes, test strategies, and test reports. It accurately reflects the overall performance of the service system, and it is not convenient to maintain the service system.
  • the present invention provides a testing method, device, electronic equipment and storage medium to solve the problem that the prior art cannot accurately reflect the overall performance of the service system and is not convenient for maintaining the service system.
  • the first aspect of the present invention discloses a test method applied to a distributed performance test platform, the method comprising:
  • the Seed Job indicated by the Seed Job selection instruction is determined as the target Seed Job
  • test script to direct the test traffic to the service system under test indicated by the configuration information for testing until the service system under test completes the test, obtain corresponding test monitoring data through the test execution Job, and based on the test Monitor data to generate test reports.
  • the second aspect of the present invention discloses a test device, which is applied to a distributed performance test platform, and the device includes:
  • the first determining unit is configured to respond to a Seed Job selection instruction, and determine the Seed Job indicated by the Seed Job selection instruction as a target Seed Job;
  • a first execution unit configured to execute the target Seed Job, so that the target Seed Job generates a test execution Job based on configuration information, wherein the configuration information is pre-configured by the user according to project requirements;
  • the second execution unit is used to execute the test execution job, so that the test execution job obtains a corresponding test script according to the configuration information;
  • the third execution unit is configured to execute the test script to direct the test traffic to the service system under test indicated by the configuration information for testing until the service system under test completes the test, and obtain corresponding test monitoring through the test execution Job data, and generate a test report based on the test monitoring data.
  • the third aspect of the present invention discloses an electronic device, including: a processor and a memory, the processor and the memory are connected through a communication bus; wherein, the processor is used to call and execute the program stored in the memory; the memory is used to store the program, The program is used to implement the testing method disclosed in the first aspect of the present invention.
  • the fourth aspect of the present invention discloses a computer-readable storage medium, wherein computer-executable instructions are stored in the computer-readable storage medium, and the computer-executable instructions are used to execute the testing method disclosed in the above-mentioned first aspect of the present invention.
  • the present invention provides a test method, device, electronic equipment and storage medium.
  • the technical solution provided by the present invention supports multiple testing strategies at the same time by pre-setting a variety of Seed Jobs, and the user can select a corresponding Seed Job from a variety of pre-set Seed Jobs according to the project requirements, without having to select different ones according to different projects.
  • Model performance testing tools thus solving the situation in the prior art that due to the different types of performance testing tools and the inconsistency of data such as performance testing standards, scripts, execution processes, test strategies, and test reports, it cannot accurately reflect The overall performance of the service system and the inconvenient maintenance of the service system.
  • Fig. 1 is a schematic structural diagram of a distributed performance testing platform provided by an embodiment of the present invention
  • Fig. 2 is a schematic flow chart of a test method provided by an embodiment of the present invention.
  • Fig. 3 is a schematic flow chart of another testing method provided by the embodiment of the present invention.
  • Fig. 4 is a schematic structural view of a test device provided by an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention.
  • the term “comprise” and its variations are open-ended, ie “including but not limited to”.
  • the term “based on” is “based at least in part on”.
  • the term “one embodiment” means “at least one embodiment”; the term “another embodiment” means “at least one further embodiment”; the term “some embodiments” means “at least some embodiments.” Relevant definitions of other terms will be given in the description below.
  • the distributed performance testing platform 100 includes a configuration service module 101, a Jenkins control machine 102, a test script management module 103, a report service Module 104, Jenkins node machine cluster 105, multiple tested service systems 106 and monitoring service module 107.
  • FIG. 2 shows a schematic flow chart of a test method provided by an embodiment of the present invention.
  • the test method is applied to the distributed performance test platform shown in FIG. 1, and the test method specifically includes the following steps:
  • S201 In response to the Seed Job selection instruction, determine the Seed Job indicated by the Seed Job selection instruction as the target Seed Job.
  • test technicians can build templates of multiple test execution jobs corresponding to each project on the Jenkins control machine of the distributed performance testing platform, that is, build multiple seed jobs corresponding to each project.
  • Seed Job can execute job templates for single-interface tests, single-scenario tests, mixed-scenario tests, mixed-scenario RPS mode tests, load tests, and optimal QPS for single interfaces. Automatic discovery of test execution Job templates, load point automatic discovery of test execution jobs.
  • step S201 the user can select the corresponding Seed Job from the various Seed Jobs preset on the Jenkins control machine of the distributed performance testing platform according to the project requirements, and after the user confirms the selected Seed Job, respond to the Seed Job Select an instruction, and determine the Seed Job indicated by the Seed Job selection instruction as the target Seed Job.
  • the user here can be a tester or a test group.
  • S202 Executing the target Seed Job, so that the target Seed Job generates a test execution Job based on configuration information, wherein the configuration information is pre-configured by the user according to project requirements.
  • step S202 the user can configure corresponding configuration information according to project requirements on the configuration service module of the distributed performance testing platform.
  • the configuration information includes the relevant information of the test team (user), the git location and branch of the test script, the access entry address of the service system under test, that is, the performance test traffic entry, the name, version and test report of the service system under test Archive address, application name and version information of dependent services, application name and version information of middleware, monitoring service address and monitored service system name under test, IP address, test node machine information (such as IP, login account information).
  • test node machines can be configured so as to achieve high concurrent processing by triggering multiple test node machines at the same time.
  • step S202 after determining the target Seed Job, the user can input configuration address information on the selected Seed Job, and click the Execute button to execute the target Seed Job, so that the target Seed Job can be configured according to the input configuration address information , obtain the corresponding configuration information, analyze the obtained configuration information, determine the name of the test execution job to be created, and judge whether there is a test execution job corresponding to the name of the test execution job to be created. If it exists, update the current one according to the configuration information There is a test execution job corresponding to the name of the test execution job to be created. If it does not exist, create a new test execution job according to the configuration information.
  • the engine construction Job can also be updated based on the corresponding parameters of the generated test execution Job, using The updated engine construction job obtains the code of the engine construction job from Git of the test engine, and runs the acquired code of the engine construction job to obtain the test engine Bundle.
  • S203 Execute the test execution job, so that the test execution job acquires a corresponding test script according to the configuration information.
  • step S203 after executing the target Seed Job so that the target Seed Job generates a test execution job based on the configuration information, the generated test execution job can be executed so that the test execution job can be executed according to the test script in the configuration information
  • the git location where it is located obtains the corresponding test script from the test script management module.
  • S204 Execute the test script to direct the test traffic to the service system under test indicated by the configuration information for testing until the service system under test completes the test, obtain corresponding test monitoring data through the test execution Job, and generate a test report based on the test monitoring data.
  • the test execution Job is made to obtain the corresponding test script according to the configuration information, and automatically executes the test script based on the test engine Bundle to trigger the test node machine information indication in the configuration information
  • the test node machine direct the test traffic to the service system under test indicated by the information of the test node machine for testing.
  • the monitoring service module detects that the service system under test has completed the test, it triggers the test execution Job according to the name and IP of the service system under test being monitored. address, and obtain the corresponding test monitoring data, so that the report service module can integrate various information in the obtained test monitoring data to generate a test report and store it in the database.
  • the test monitoring data includes test model data, monitoring information, test scenario data, test strategy, Gatling result information and execution information generated during the execution of the test execution Job.
  • the generated test report can be displayed for the user to view, and a comprehensive test report can also be generated according to multiple test reports obtained from multiple tests.
  • the test node machine is pre-set in the Jenkins node machine cluster.
  • the present invention provides a testing method, in which a variety of Seed Jobs are pre-set, and the user can select a corresponding Seed Job from the various pre-set Seed Jobs according to project requirements, and respond to the Seed Job selection instruction after the user determines the selected Seed Job , determine the Seed Job indicated by the Seed Job selection command as the target SeedJob, execute the target Seed Job, so that the target Seed Job generates a corresponding test execution Job based on the configuration information pre-configured by the user, and by executing the generated test execution, you can obtain the same
  • the test script corresponding to the configuration information and finally execute the obtained test script to direct the test traffic to the service system under test indicated by the configuration information for testing, until the service system under test completes the test, and obtain the corresponding test monitoring through the test execution Job data, and generate test reports based on test monitoring data.
  • the technical solution provided by the present invention supports multiple testing strategies at the same time by presetting a variety of Seed Jobs, and users can select the corresponding Seed Job from the various pre-set Seed Jobs according to project requirements, without having to choose according to different projects
  • Different types of performance testing tools thus solving the problem of different types of performance testing tools in the prior art, as well as the inconsistency of performance testing standards, scripts, execution processes, test strategies, test reports and other data, resulting in inability to accurately It reflects the overall performance of the service system and the inconvenient maintenance of the service system.
  • the Seed Job indicated by the Seed Job selection instruction is a single-interface optimal QPS automatic discovery test execution Job template, see Figure 3, which shows a schematic flow chart of another test method provided by the embodiment of the present invention , the test method specifically includes the following steps:
  • S301 In response to the SeedJob selection instruction, determine the Seed Job indicated by the SeedJob selection instruction as the target Seed Job, wherein the Seed Job indicated by the SeedJob selection instruction is a single-interface optimal QPS automatic discovery test execution Job template.
  • step S301 the user can select the corresponding Seed Job from the various Seed Jobs preset on the Jenkins control machine of the distributed performance testing platform according to the project requirements, and after the user determines the selected Seed Job, respond to the Seed Job selection Instruction, determine the Seed Job indicated by the Seed Job selection instruction as the target Seed Job.
  • the Seed Job indicated by the Seed Job selection instruction is a single-interface optimal QPS automatic discovery test execution Job template.
  • S302 Execute the target Seed Job, so that the target Seed Job generates a single-interface optimal QPS discovery test execution job based on the configuration information.
  • step S302 after determining the target Seed Job, the user can input configuration address information in the selected target Seed Job, and click the Execute button to execute the target Seed Job, so that the target SeedJob can, according to the input configuration address information, Obtain the corresponding configuration information, analyze the obtained configuration information, determine the name of the test execution job to be created, and determine whether there is currently a single-interface optimal QPS discovery test execution job corresponding to the name of the test execution job to be created. If it exists, then Update the currently existing single-interface optimal QPS discovery test execution job corresponding to the name of the test execution job to be created according to the configuration information. If it does not exist, create a new single-interface optimal QPS discovery test execution job according to the configuration information.
  • the target Seed Job while executing the target Seed Job so that the target Seed Job generates a single-interface optimal QPS discovery test execution job based on the configuration information, it can also be based on the generated single-interface optimal QPS discovery test execution Update the engine construction job with the corresponding parameters of the job, use the updated engine construction job to obtain the code of the engine construction job from Git of the test engine, and run the acquired code of the engine construction job to obtain the test engine Bundle.
  • S303 Execute the single-interface optimal QPS discovery test execution job, so that the single-interface optimal QPS discovery test execution job responds to the user's interface selection instruction, determines the interface indicated by the interface selection instruction as the target interface, and obtains the target interface according to the configuration information.
  • the target interface needs to prepare data scripts, obtain the data preparation scripts returned by other interfaces associated with the target interface, and execute the data preparation scripts to obtain data files.
  • step S303 the target Seed Job is executed, so that the target Seed Job can generate the single-interface optimal QPS discovery test execution job based on the configuration information, and then display the generated single-interface optimal QPS discovery test execution job, and the user can use the displayed single interface Select the corresponding interface in the optimal QPS discovery test execution job, and configure the corresponding configuration parameters.
  • the configured configuration parameters include at least a preset response time threshold and a preset error rate.
  • step S303 after executing the target Seed Job so that the target Seed Job generates a single-interface optimal QPS discovery test execution job based on the configuration information, execute the single-interface optimal QPS discovery test execution job to make the single-interface optimal QPS discovery test execution job.
  • the optimal QPS finds that the test execution job responds to the user's interface selection instruction, determines the interface indicated by the interface selection instruction as the target interface, and obtains the test script corresponding to the target interface from the test script management module at the git location of the test script in the configuration information, if The target interface needs to prepare data scripts, obtain the data preparation scripts returned by other interfaces associated with the target interface, and execute the data preparation scripts to obtain data files.
  • the single-interface optimal QPS discovery test execution job is executed so that the single-interface optimal QPS discovery test execution job responds to the user's interface selection command, determines the interface indicated by the interface selection command as the target interface, and obtains the target interface Corresponding test scripts, if the target interface does not need to prepare data scripts, automatically execute the obtained test scripts to direct the test traffic to the service system under test indicated by the configuration information for testing, when the monitoring service module detects that the service system under test completes the test , trigger the test execution Job to obtain the corresponding test monitoring data according to the monitored service system name and IP address, and generate a test report based on the test monitoring data.
  • S304 Execute the test script based on the data file to direct the test traffic to the service system under test indicated by the configuration information for testing until the service system under test completes the test, obtain the corresponding test monitoring data through the test execution Job, and generate based on the test monitoring data testing report.
  • the test script is executed based on the data file to trigger the test node machine indicated by the test node machine information in the configuration information, and point the test flow to the tested service system indicated by the test node machine information for testing.
  • the monitoring service module detects that the service system under test has completed the test, and triggers the test execution Job to obtain the corresponding test monitoring data according to the name and IP address of the service system under test being monitored, so that the reporting service module can obtain the corresponding test monitoring data according to the obtained test monitoring data.
  • Class information is integrated to generate test reports.
  • the generated test report includes at least the interface QPS, the response time and error rate corresponding to the interface QPS.
  • step S305 after the test report is generated, the interface QPS in the test report, the response time of the interface QPS and the error rate of the interface QPS are obtained through the single interface optimal QPS discovery test execution job, and the interface is judged. Whether the QPS response time is less than the preset response time in the configuration parameters, whether the error rate of the interface QPS is less than the preset error rate in the configuration parameters, and whether the difference between the interface QPS and the last historical interface QPS exceeds the preset deviation threshold.
  • the interface QPS in this test report may be determined as the interface optimal QPS, and step S306 is executed.
  • step S308 If the response time of the interface QPS is not less than the preset response time in the configuration parameters, the error rate of the interface QPS is not less than the preset error rate in the configuration parameters, or the difference between the interface QPS and the latest interface QPS in history exceeds the preset If the deviation threshold is set, it can be determined that the interface QPS in this test report is not the interface optimal QPS, and step S308 is executed.
  • step S306 if the optimal QPS of the interface is found in this test report, the optimal QPS of the single interface is found to execute the job, and the difference between the optimal QPS of the current interface and the most recent optimal QPS of the interface in history is calculated. Difference value, whether the ratio of the most recent interface optimal QPS in history exceeds the preset threshold, if it exceeds, it can be determined that the performance of the service system under test is poor, and the corresponding alarm information will be output; if it is not too high, it can be determined that the service system under test The performance is good, end this test.
  • the optimal QPS of the interface is discovered, the optimal QPS of the interface to be discovered, and the process of discovering the optimal QPS of the interface Related data are stored together in the database.
  • S307 Execute a job by discovering and testing the optimal QPS of a single interface, and output corresponding alarm information.
  • step S307 when it is determined that the difference between the current optimal QPS of the interface and the optimal QPS of the most recent interface in history, and the ratio of the optimal QPS of the most recent interface in history exceeds a preset threshold, it can be determined that the service under test The performance of the system is poor.
  • the optimal QPS of the single interface is used to find the test execution job and output the corresponding alarm information in the form of email.
  • step S308 Execute the job through the discovery test of the optimal QPS of a single interface, and judge whether the error rate corresponding to the current interface QPS exceeds the preset error rate; if the error rate corresponding to the current interface QPS is less than the preset error rate, perform step S309; if the current interface QPS The corresponding error rate is not less than the preset error rate, and step S310 is executed.
  • step S308 if the optimal QPS of the interface is not found in this test report, the optimal QPS of the single interface is found to test and execute the job to determine whether the error rate corresponding to the current interface QPS exceeds the preset error rate , if the error rate corresponding to the current interface QPS is less than the preset error rate, perform step S309; if the error rate corresponding to the current interface QPS is not less than the preset error rate, perform step S310.
  • step S309 when it is determined that the error rate corresponding to the current interface QPS is less than the preset error rate, increase the access data of the service system under test, and return to execute the interface optimal QPS discovery test execution job until it is found Up to the optimal QPS of the interface.
  • the discovered optimal QPS of the interface and the data generated during the process of discovering the optimal QPS of the interface can be stored in the database, and the optimal QPS of the interface can also be found
  • the QPS of each interface is generated to generate the optimal QPS trend graph, and the generated optimal QPS trend graph is displayed.
  • step S310 when it is determined that the error rate corresponding to the current interface QPS is not less than the preset error rate, reduce the access data of the service system under test, and return to execute the interface optimal QPS discovery test execution job, Until the optimal QPS of the interface is found.
  • the Seed Job indicated by the Seed Job selection instruction is a single-interface optimal QPS automatic discovery test execution Job template
  • the target Seed Job is a single-interface optimal QPS automatic discovery test execution Job template
  • execute Target Seed Job so that the target Seed Job generates a single-interface optimal QPS discovery test execution job based on the configuration information
  • executes the single-interface optimal QPS discovery test execution job so that the single-interface optimal QPS discovery test execution job obtains according to the configuration information
  • the test script is automatically executed to direct the test traffic to the service system under test indicated by the configuration information for testing until the service system under test completes the test, and obtains the corresponding test monitoring data through the test execution Job, and based on the test monitoring
  • the test report is generated from the data, and then the test execution job is found through the optimal QPS of the single interface.
  • the test report and configuration parameters it is judged whether the optimal QPS of the interface is found, so as to judge the performance of the service system under test based on the optimal QPS of the interface found.
  • corresponding alarm information is output, so that the operation and maintenance personnel can maintain the service system under test according to the output alarm information.
  • each block in a flowchart or block diagram may represent a module, program segment, or portion of code that contains one or more logical functions for implementing specified executable instructions.
  • 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 they may sometimes be executed in the reverse order, depending upon the functionality involved.
  • each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations can be implemented by a dedicated hardware-based system that performs the specified functions or operations , or may be implemented by a combination of dedicated hardware and computer instructions.
  • the client and the server can communicate using any currently known or future network protocols such as HTTP (HyperText Transfer Protocol, Hypertext Transfer Protocol), and can communicate with digital data in any form or medium
  • HTTP HyperText Transfer Protocol
  • the communication eg, communication network
  • Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), internetworks (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network of.
  • Computer program code for performing the operations disclosed in the present invention may be written in one or more programming languages, or combinations thereof, including but not limited to object-oriented programming languages—such as Java, Smalltalk, C++, Also included are conventional procedural programming languages - such as the "C" language or similar programming languages.
  • the program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server.
  • the remote computer can be connected to the user computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (such as through an Internet service provider). Internet connection).
  • LAN local area network
  • WAN wide area network
  • Internet service provider such as AT&T, MCI, Sprint, EarthLink, MSN, GTE, etc.
  • the embodiment of the present invention also provides a schematic structural diagram of a test device, which includes:
  • the first determination unit 41 is used to respond to the Seed Job selection instruction, and determine the SeedJob indicated by the Seed Job selection instruction as the target Seed Job;
  • the first execution unit 42 is used to execute the target Seed Job, so that the target Seed Job generates a test execution Job based on configuration information, wherein the configuration information is pre-configured by the user according to project requirements;
  • the second execution unit 43 is configured to execute the test execution Job, so that the test execution Job obtains a corresponding test script according to the configuration information;
  • the third execution unit 44 is used to execute the test script to direct the test traffic to the service system under test indicated by the configuration information for testing until the service system under test completes the test, obtain the corresponding test monitoring data through the test execution Job, and based on the test Monitor data to generate test reports.
  • the present invention provides a test device, which is preset with multiple Seed Jobs, and the user can select the corresponding Seed Job from the preset multiple Seed Jobs according to the project requirements, and respond to the Seed Job selection instruction after the user determines the selected Seed Job , determine the Seed Job indicated by the Seed Job selection command as the target SeedJob, execute the target Seed Job, so that the target Seed Job generates a corresponding test execution Job based on the configuration information pre-configured by the user, and by executing the generated test execution, you can obtain the same
  • the test script corresponding to the configuration information and finally execute the obtained test script to direct the test traffic to the service system under test indicated by the configuration information for testing, until the service system under test completes the test, and obtain the corresponding test monitoring through the test execution Job data, and generate test reports based on test monitoring data.
  • the technical solution provided by the present invention supports multiple testing strategies at the same time by presetting a variety of Seed Jobs, and users can select the corresponding Seed Job from the various pre-set Seed Jobs according to project requirements, without having to choose according to different projects
  • Different types of performance testing tools thus solving the problem of different types of performance testing tools in the prior art, as well as the inconsistency of performance testing standards, scripts, execution processes, test strategies, test reports and other data, resulting in inability to accurately It reflects the overall performance of the service system and the inconvenient maintenance of the service system.
  • test device provided by the present invention also includes:
  • the update unit is used to update the engine construction job based on the test execution job.
  • the third execution unit is specifically used to execute the test script based on the test engine Bundle, to trigger the test node machine indicated by the configuration information, and direct the test traffic to the service system under test indicated by the configuration information for testing until the service system under test Complete the test, obtain the corresponding test monitoring data through the test execution Job, and generate a test report based on the test monitoring data;
  • the test engine Bundle is obtained by using the updated engine construction job to obtain and run the code of the engine construction job from Git of the test engine.
  • the first execution unit is specifically used to execute the target Seed Job, so that the target Seed Job obtains and parses the configuration information according to the input configuration address information, and determines the name of the test execution Job to be created. If it does not exist and to be created Create the test execution Job corresponding to the test execution Job name of the test execution job according to the configuration information;
  • the configuration information is pre-configured by the user, and the configuration address information is input by the user.
  • the second execution unit is specifically used to execute the single-interface optimal QPS discovery test execution job, so that the single-interface optimal QPS discovery test execution job responds
  • the user's interface selection command determines the interface indicated by the interface selection command as the target interface, and obtains the test script corresponding to the target interface according to the configuration information. If the target interface needs to prepare data scripts, obtain the preparation returned by other interfaces associated with the target interface Data script, and execute the prepare data script to get the data file;
  • the third execution unit is also used to execute the test script based on the data file.
  • test device provided by the present invention also includes:
  • the output unit is used to find the optimal QPS of the interface through the single interface optimal QPS discovery test execution job according to the test report and configuration parameters, and the difference between the current optimal QPS of the interface and the last optimal QPS of the interface in history is the same as the latest historical one When the ratio of the optimal QPS of the interface exceeds the preset threshold, the corresponding alarm information is output;
  • the access data adjustment unit is used for when the optimal QPS of a single interface is found for the test execution job. According to the test report and configuration parameters, the optimal QPS of the interface is not found, and the error rate corresponding to the current interface QPS is less than the preset error rate threshold, and the added value is added.
  • the configuration parameters are uploaded by the user based on the single-interface optimal QPS discovery test to execute the job upload, the configuration parameters include at least the preset error rate, and the test report includes the error rate corresponding to the current interface QPS.
  • the units involved in the disclosed embodiments of the present invention may be implemented by means of software or hardware.
  • the name of the unit does not constitute a limitation of the unit itself under certain circumstances, for example, the first obtaining unit may also be described as "a unit for obtaining at least two Internet Protocol addresses".
  • exemplary types of hardware logic components include: Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), System on Chips (SOCs), Complex Programmable Logical device (CPLD) and so on.
  • FPGAs Field Programmable Gate Arrays
  • ASICs Application Specific Integrated Circuits
  • ASSPs Application Specific Standard Products
  • SOCs System on Chips
  • CPLD Complex Programmable Logical device
  • the embodiment of the present application also provides an electronic device, the electronic device includes: a processor and a memory, the processor and the memory are connected through a communication bus; wherein, the processor is used to call and execute the program stored in the memory; the memory is used to Stores the program used to implement the test method.
  • FIG. 5 it shows a schematic structural diagram of an electronic device suitable for implementing the disclosed embodiments of the present invention.
  • Electronic devices in the disclosed embodiments of the present invention may include, but are not limited to, mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals ( Mobile terminals such as car navigation terminals) and stationary terminals such as digital TVs, desktop computers and the like.
  • the electronic device shown in FIG. 5 is only an example, and should not limit the functions and scope of use of the disclosed embodiments of the present invention.
  • an electronic device may include a processing device (such as a central processing unit, a graphics processing unit, etc. 501), which may be loaded into a random access memory ( The program in RAM) 503 executes various appropriate actions and processes. In RAM 503, various programs and data required for the operation of electronic equipment are also stored. Processing device 501, ROM 502 and RAM 503 are connected to each other by bus 504 An input/output (I/O) interface 505 is also connected to the bus 504 .
  • a processing device such as a central processing unit, a graphics processing unit, etc. 501
  • RAM 503 executes various appropriate actions and processes.
  • RAM 503 executes various appropriate actions and processes.
  • RAM 503 various programs and data required for the operation of electronic equipment are also stored.
  • Processing device 501, ROM 502 and RAM 503 are connected to each other by bus 504
  • An input/output (I/O) interface 505 is also connected to the bus 504 .
  • the following devices can be connected to the I/O interface 505: input devices 506 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, a liquid crystal display (LCD), speaker, vibration an output device 507 such as a computer; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509.
  • the communication means 509 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. While FIG. 5 shows an electronic device having various means, it should be understood that implementing or having all of the means shown is not a requirement. More or fewer means may alternatively be implemented or provided.
  • the processes described above with reference to the flowcharts can be implemented as computer software programs.
  • the disclosed embodiments of the present invention include a computer program product, which includes a computer program carried on a non-transitory computer readable medium, where the computer program includes program codes for executing the methods shown in the flowcharts.
  • the computer program may be downloaded and installed from a network via communication means 509, or from storage means 508, or from ROM 502.
  • the processing device 501 When the computer program is executed by the processing device 501, the above-mentioned functions defined in the methods of the disclosed embodiments of the present invention are performed.
  • the embodiment of the present invention also provides a computer-readable storage medium, in which computer-executable instructions are stored, and the computer-executable instructions are used to execute the testing method.
  • the above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device: responds to the Seed Job selection instruction, and determines the Seed Job indicated by the Seed Job selection instruction as the target Seed Job; Execute the target Seed Job, so that the target Seed Job generates a test execution job based on the configuration information, where the configuration information is pre-configured by the user according to the project requirements; Execute the test execution job, so that the test execution job obtains the corresponding Test script: Execute the test script to direct the test traffic to the service system under test indicated by the configuration information for testing until the service system under test completes the test, obtain corresponding test monitoring data, and generate a test report based on the test monitoring data.
  • a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device.
  • a machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium.
  • a machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing.
  • machine-readable storage media would include one or more wire-based electrical connections, portable computer discs, hard drives, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, compact disk read only memory (CD-ROM), optical storage, magnetic storage, or any suitable combination of the foregoing.
  • RAM random access memory
  • ROM read only memory
  • EPROM or flash memory erasable programmable read only memory
  • CD-ROM compact disk read only memory
  • magnetic storage or any suitable combination of the foregoing.
  • the above-mentioned computer-readable medium disclosed in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two.
  • a computer readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code therein. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • a computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can transmit, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device .
  • Program code embodied on a computer readable medium may be transmitted by any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
  • the above-mentioned computer-readable medium may be included in the above-mentioned electronic device, or may exist independently without being incorporated into the electronic device.

Abstract

The present invention provides a test method and apparatus, an electronic device, and a storage medium, applied to a distributed performance test platform. The method comprises: in response to a Seed Job selection instruction, determining a Seed Job indicated by the Seed Job selection instruction as a target Seed Job; executing the target Seed Job, such that the target Seed Job generates a test execution Job on the basis of configuration information; executing the test execution Job, such that the test execution Job acquires a corresponding test script according to the configuration information; and executing the test script to direct test traffic to a tested service system indicated by the configuration information to perform a test until the tested service system completes the test, acquiring corresponding test monitoring data by means of the test execution Job, and generating a test report on the basis of the test monitoring data. On the basis of the present invention, the problems in the prior art that the overall performance of the service system cannot be accurately reflected and it is also inconvenient to maintain the service system can be solved.

Description

一种测试方法、装置、电子设备及存储介质A test method, device, electronic equipment and storage medium
本申请要求于2021年6月30日提交中国专利局、申请号为202110739282.7、发明名称为“一种测试方法、装置、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202110739282.7 and the title of the invention "a test method, device, electronic equipment and storage medium" submitted to the China Patent Office on June 30, 2021, the entire contents of which are incorporated by reference incorporated in this application.
技术领域technical field
本发明涉及计算机技术领域,更具体地说,涉及一种测试方法、装置、电子设备及存储介质。The present invention relates to the field of computer technology, more specifically, to a test method, device, electronic equipment and storage medium.
背景技术Background technique
随着网络的发展,人们对网络的依赖越来越大,给提供网络服务的系统带来严重的系统负荷,服务系统性能的好坏将严重影响企业的利益,因此对于服务系统的性能测试越来越受业界的重视。With the development of the network, people rely more and more on the network, which brings serious system load to the system that provides network services. The performance of the service system will seriously affect the interests of the enterprise. Therefore, the performance test of the service system is more are gaining more and more attention from the industry.
在现有的测试过程中,各个项目的测试人员分别根据自己负责的项目,选择性能测试工具进行性能测试。但是现有的这种方式,不同的项目的测试人员可能会出现性能测试工具选型不同,以及性能测试的标准、脚本、执行过程、测试策略、测试报告等数据的不统一的情况,从而不能准确地反映出服务系统的整体性能,也不便于对服务系统进行维护。In the existing testing process, testers of each project select performance testing tools for performance testing according to the projects they are responsible for. However, in this existing method, testers of different projects may have different selections of performance testing tools, as well as inconsistencies in performance testing standards, scripts, execution processes, test strategies, and test reports. It accurately reflects the overall performance of the service system, and it is not convenient to maintain the service system.
发明内容Contents of the invention
有鉴于此,本发明提供一种测试方法、装置、电子设备及存储介质,以解决现有技术无法准确地反映出服务系统的整体性能,也不便于对服务系统进行维护的问题。In view of this, the present invention provides a testing method, device, electronic equipment and storage medium to solve the problem that the prior art cannot accurately reflect the overall performance of the service system and is not convenient for maintaining the service system.
本发明第一方面公开一种测试方法,应用于分布式性能测试平台,所述方法包括:The first aspect of the present invention discloses a test method applied to a distributed performance test platform, the method comprising:
响应Seed Job选取指令,将所述Seed Job选取指令指示的所述Seed Job确定为目标Seed Job;In response to the Seed Job selection instruction, the Seed Job indicated by the Seed Job selection instruction is determined as the target Seed Job;
执行所述目标Seed Job,以使所述目标Seed Job基于配置信息生成测试执行Job,其中,所述配置信息是用户根据项目需求预先配置的;Executing the target Seed Job so that the target Seed Job generates a test execution Job based on configuration information, wherein the configuration information is pre-configured by the user according to project requirements;
执行测试执行Job,使所述测试执行Job根据配置信息,获取相应的测试脚本;Execute the test execution Job, so that the test execution Job obtains a corresponding test script according to the configuration information;
执行所述测试脚本,以将测试流量指向配置信息指示的被测服务系统进行测试,直至所述被测服务系统完成测试,通过所述测试执行Job获取相应的测试监控数据,并基于所述测试监控数据生成测试报告。Execute the test script to direct the test traffic to the service system under test indicated by the configuration information for testing until the service system under test completes the test, obtain corresponding test monitoring data through the test execution Job, and based on the test Monitor data to generate test reports.
本发明第二方面公开一种测试装置,应用于分布式性能测试平台,所述装置包括:The second aspect of the present invention discloses a test device, which is applied to a distributed performance test platform, and the device includes:
第一确定单元,用于响应Seed Job选取指令,将所述Seed Job选取指令指示的所述Seed Job确定为目标Seed Job;The first determining unit is configured to respond to a Seed Job selection instruction, and determine the Seed Job indicated by the Seed Job selection instruction as a target Seed Job;
第一执行单元,用于执行所述目标Seed Job,以使所述目标Seed Job基于配置信息生成测试执行Job,其中,所述配置信息是用户根据项目需求预先配置的;A first execution unit, configured to execute the target Seed Job, so that the target Seed Job generates a test execution Job based on configuration information, wherein the configuration information is pre-configured by the user according to project requirements;
第二执行单元,用于执行测试执行Job,使所述测试执行Job根据配置信息,获取相应的测试脚本;The second execution unit is used to execute the test execution job, so that the test execution job obtains a corresponding test script according to the configuration information;
第三执行单元,用于执行所述测试脚本,以将测试流量指向配置信息指示的被测服务系统进行测试,直至所述被测服务系统完成测试,通过所述测试执行Job获取相应的测试监控数据,并基于所述测试监控数据生成测试报告。The third execution unit is configured to execute the test script to direct the test traffic to the service system under test indicated by the configuration information for testing until the service system under test completes the test, and obtain corresponding test monitoring through the test execution Job data, and generate a test report based on the test monitoring data.
本发明第三方面公开一种电子设备,包括:处理器以及存储器,处理器以及存储器通过通信总线相连;其中,处理器,用于调用并执行存储器中存储的程序;存储器,用于存储程序,程序用于实现如上述本发明第一方面公开的测试方法。The third aspect of the present invention discloses an electronic device, including: a processor and a memory, the processor and the memory are connected through a communication bus; wherein, the processor is used to call and execute the program stored in the memory; the memory is used to store the program, The program is used to implement the testing method disclosed in the first aspect of the present invention.
本发明第四方面公开一种计算机可读存储介质,计算机可读存储介质中存储有计算机可执行指令,计算机可执行指令用于执行如上述本发明第一方面公开的测试方法。The fourth aspect of the present invention discloses a computer-readable storage medium, wherein computer-executable instructions are stored in the computer-readable storage medium, and the computer-executable instructions are used to execute the testing method disclosed in the above-mentioned first aspect of the present invention.
本发明提供一种测试方法、装置、电子设备及存储介质,预先设置有多种Seed Job,用户可以根据项目需求从预先设置的多种Seed Job中选取相应的Seed Job,在用户确定选取的Seed Job后,响应Seed Job选取指令,将Seed Job选取指令指示的Seed Job确定为目标Seed Job,执行该目标Seed Job,以使目标Seed Job基于用户预先配置的配置信息生成相应测试执行Job,通过执行生成的测试执行,便可获取与该配置信息相应的测试脚本,最后通过执行所获取的测试脚 本,以将测试流量指向配置信息指示的被测服务系统进行测试,直至被测服务系统完成测试,通过测试执行Job获取相应的测试监控数据,并基于测试监控数据生成测试报告。本发明提供的技术方案,通过预先设置多种Seed Job以同时支持多种测试策略,用户可以以根据项目需求从预先设置的多种Seed Job中选取相应的Seed Job,无需根据不同的项目选择不同型号的性能测试工具,从而解决了现有技术中由于性能测试工具选型不同,以及性能测试的标准、脚本、执行过程、测试策略、测试报告等数据的不统一的情况,导致无法准确地反映出服务系统的整体性能,以及不便于对服务系统进行维护的问题。The present invention provides a test method, device, electronic equipment and storage medium. There are multiple Seed Jobs preset. Users can select corresponding Seed Jobs from the preset multiple Seed Jobs according to project requirements. After the user determines the selected Seed Job After Job, in response to the Seed Job selection instruction, determine the Seed Job indicated by the Seed Job selection instruction as the target Seed Job, and execute the target Seed Job so that the target Seed Job generates a corresponding test execution Job based on the configuration information pre-configured by the user. After the generated test is executed, the test script corresponding to the configuration information can be obtained. Finally, by executing the obtained test script, the test traffic is directed to the service system under test indicated by the configuration information for testing until the service system under test completes the test. Obtain the corresponding test monitoring data through the test execution Job, and generate a test report based on the test monitoring data. The technical solution provided by the present invention supports multiple testing strategies at the same time by pre-setting a variety of Seed Jobs, and the user can select a corresponding Seed Job from a variety of pre-set Seed Jobs according to the project requirements, without having to select different ones according to different projects. Model performance testing tools, thus solving the situation in the prior art that due to the different types of performance testing tools and the inconsistency of data such as performance testing standards, scripts, execution processes, test strategies, and test reports, it cannot accurately reflect The overall performance of the service system and the inconvenient maintenance of the service system.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only It is an embodiment of the present invention, and those skilled in the art can also obtain other drawings according to the provided drawings without creative work.
结合附图并参考以下具体实施方式,本发明公开各实施例的上述和其他特征、优点及方面将变得更加明显。贯穿附图中,相同或相似的附图标记表示相同或相似的元素。应当理解附图是示意性的,原件和元素不一定按照比例绘制。The above and other features, advantages and aspects of the disclosed embodiments of the present invention will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic and that elements and elements are not necessarily drawn to scale.
图1为本发明实施例提供的一种分布式性能测试平台的结构示意图;Fig. 1 is a schematic structural diagram of a distributed performance testing platform provided by an embodiment of the present invention;
图2为本发明实施例提供的一种测试方法的流程示意图;Fig. 2 is a schematic flow chart of a test method provided by an embodiment of the present invention;
图3为本发明实施例提供的另一种测试方法的流程示意图;Fig. 3 is a schematic flow chart of another testing method provided by the embodiment of the present invention;
图4为本发明实施例提供的一种测试装置的结构示意图;Fig. 4 is a schematic structural view of a test device provided by an embodiment of the present invention;
图5为本发明实施例提供的一种电子设备的结构示意图。FIG. 5 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention.
具体实施方式detailed description
下面将参照附图更详细地描述本发明公开的实施例。虽然附图中显示了本发明公开的某些实施例,然而应当理解的是,本发明公开可以通过各种形式来实现,而且不应该被解释为限于这里阐述的实施例,相反提供这些实施例是为了更加透彻和完整地理解本公开。应当理解的是,本发明公开的附图及实施例仅用于示例性作用,并非用于限制本发明公开的保护范围。Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein; It is for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments disclosed in the present invention are only for exemplary purposes, and are not intended to limit the scope of protection disclosed in the present invention.
本文使用的术语“包括”及其变形是开放性包括,即“包括但不限于”。术语“基于”是“至少部分地基于”。术语“一个实施例”表示“至少一个实施例”;术语“另一实施例”表示“至少一个另外的实施例”;术语“一些实施例”表示“至少一些实施例”。其他术语的相关定义将在下文描述中给出。As used herein, the term "comprise" and its variations are open-ended, ie "including but not limited to". The term "based on" is "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one further embodiment"; the term "some embodiments" means "at least some embodiments." Relevant definitions of other terms will be given in the description below.
需要注意,本发明公开中提及的“第一”、“第二”等概念仅用于对不同的装置、模块或单元进行区分,并非用于限定这些装置、模块或单元所执行的功能的顺序或者相互依存关系。It should be noted that concepts such as "first" and "second" mentioned in the disclosure of the present invention are only used to distinguish different devices, modules or units, and are not used to limit the functions performed by these devices, modules or units. sequence or interdependence.
需要注意,本发明公开中提及的“一个”、“多个”的修饰是示意性而非限制性的,本领域技术人员应当理解,除非在上下文另有明确指出,否则应该理解为“一个或多个”。It should be noted that the modifications of "one" and "multiple" mentioned in the disclosure of the present invention are illustrative and not restrictive, and those skilled in the art should understand that unless the context clearly indicates otherwise, it should be understood as "a or more".
参见图1,示出了本发明实施例提供的一种分布式性能测试平台的结构示意图,该分布式性能测试平台100包括配置服务模块101、Jenkins控制机102、测试脚本管理模块103、报告服务模块104、Jenkins节点机集群105、多个被测服务系统106和监控服务模块107。Referring to Fig. 1, it shows a schematic structural diagram of a distributed performance testing platform provided by an embodiment of the present invention, the distributed performance testing platform 100 includes a configuration service module 101, a Jenkins control machine 102, a test script management module 103, a report service Module 104, Jenkins node machine cluster 105, multiple tested service systems 106 and monitoring service module 107.
参见图2,示出了本发明实施例提供的一种测试方法的流程示意图,该测试方法应用于如图1所示的分布式性能测试平台,该测试方法具体包括以下步骤:Referring to FIG. 2, it shows a schematic flow chart of a test method provided by an embodiment of the present invention. The test method is applied to the distributed performance test platform shown in FIG. 1, and the test method specifically includes the following steps:
S201:响应Seed Job选取指令,将Seed Job选取指令指示的Seed Job确定为目标Seed Job。S201: In response to the Seed Job selection instruction, determine the Seed Job indicated by the Seed Job selection instruction as the target Seed Job.
在步骤S201中,测试技术人员可以在分布式性能测试平台的Jenkins控制机上搭建每个项目对应的多种测试执行Job的模板,即搭建每个项目对应的多种Seed Job。In step S201, test technicians can build templates of multiple test execution jobs corresponding to each project on the Jenkins control machine of the distributed performance testing platform, that is, build multiple seed jobs corresponding to each project.
需要说明的是,Seed Job可以为单接口测试执行Job模板、单场景测试执行Job模板、混合场景测试执行Job模板、混合场景RPS模式测试执行Job模板、负载测试执行Job模板、单接口最优QPS自动发现测试执行Job模板、负载点自动发现测试执行Job。It should be noted that Seed Job can execute job templates for single-interface tests, single-scenario tests, mixed-scenario tests, mixed-scenario RPS mode tests, load tests, and optimal QPS for single interfaces. Automatic discovery of test execution Job templates, load point automatic discovery of test execution jobs.
在具体执行步骤S201的过程中,用户可以根据项目需求从分布式性能测试平台的Jenkins控制机上预先设置的多种Seed Job中选取相应的Seed Job,在用户确定选取的Seed Job后,响应Seed Job选取指令,将该Seed Job选取指令指示的Seed Job确定为目标Seed Job。During the specific execution of step S201, the user can select the corresponding Seed Job from the various Seed Jobs preset on the Jenkins control machine of the distributed performance testing platform according to the project requirements, and after the user confirms the selected Seed Job, respond to the Seed Job Select an instruction, and determine the Seed Job indicated by the Seed Job selection instruction as the target Seed Job.
需要说明的是,这里的用户可以为一个测试人员,也可以为一个测试小组。It should be noted that the user here can be a tester or a test group.
S202:执行目标Seed Job,以使目标Seed Job基于配置信息生成测试执行Job,其中,配置信息是用户根据项目需求预先配置的。S202: Executing the target Seed Job, so that the target Seed Job generates a test execution Job based on configuration information, wherein the configuration information is pre-configured by the user according to project requirements.
在步骤S202中,用户可以在分布式性能测试平台的配置服务模块上根据项目需求配置相应的配置信息。In step S202, the user can configure corresponding configuration information according to project requirements on the configuration service module of the distributed performance testing platform.
需要说明的是,配置信息包括测试小组(用户)的相关信息、测试脚本所在git位置和分支、被测服务系统的访问入口地址,即性能测试流量入口、被测服务系统名称、版本及测试报告归档地址、依赖服务的应用名和版本信息、中间件的应用名和版本信息、监控服务地址及被监控的被测服务系统名、IP地址、测试节点机信息(如IP、登录账户信息)。It should be noted that the configuration information includes the relevant information of the test team (user), the git location and branch of the test script, the access entry address of the service system under test, that is, the performance test traffic entry, the name, version and test report of the service system under test Archive address, application name and version information of dependent services, application name and version information of middleware, monitoring service address and monitored service system name under test, IP address, test node machine information (such as IP, login account information).
需要说明的是,可以配置多个测试节点机信息,以便通过同时触发多个测试节点机,实现高并发处理。It should be noted that the information of multiple test node machines can be configured so as to achieve high concurrent processing by triggering multiple test node machines at the same time.
在具体执行步骤S202的过程中,在确定目标Seed Job后,用户可以在选取的Seed Job上输入配置地址信息,并点击执行按钮,执行目标Seed Job,以使目标Seed Job根据输入的配置地址信息,获取相应的配置信息,解析所获取的配置信息,确定待创建的测试执行Job名称,判断当前是否存在与待创建的测试执行Job名称对应的测试执行Job,若存在,则根据配置信息更新当前存在的与待创建的测试执行Job名称对应的测试执行Job,若未存在,根据配置信息创建新的测试执行Job。During the specific execution of step S202, after determining the target Seed Job, the user can input configuration address information on the selected Seed Job, and click the Execute button to execute the target Seed Job, so that the target Seed Job can be configured according to the input configuration address information , obtain the corresponding configuration information, analyze the obtained configuration information, determine the name of the test execution job to be created, and judge whether there is a test execution job corresponding to the name of the test execution job to be created. If it exists, update the current one according to the configuration information There is a test execution job corresponding to the name of the test execution job to be created. If it does not exist, create a new test execution job according to the configuration information.
进一步的,在本申请实施例中,在执行目标Seed Job,以使目标Seed Job基于配置信息生成测试执行Job的同时,还可以基于生成的测试执行Job相应的参数对引擎构建Job进行更新,利用更新后的引擎构建Job从测试引擎的Git中,获取引擎构建Job的代码,并运行所获取到的引擎构建Job的代码,得到测试引擎Bundle。Further, in the embodiment of the present application, while executing the target Seed Job so that the target Seed Job generates a test execution Job based on the configuration information, the engine construction Job can also be updated based on the corresponding parameters of the generated test execution Job, using The updated engine construction job obtains the code of the engine construction job from Git of the test engine, and runs the acquired code of the engine construction job to obtain the test engine Bundle.
S203:执行测试执行Job,使测试执行Job根据配置信息,获取相应的测试脚本。S203: Execute the test execution job, so that the test execution job acquires a corresponding test script according to the configuration information.
在具体执行步骤S203的过程中,在执行目标Seed Job,以使目标Seed Job基于配置信息生成测试执行Job后,可以通过执行生成的测试执行job,以使测试执行Job根据配置信息中的测试脚本所在git位置从测试脚本管理模块中获取相应的测试脚本。In the process of specifically executing step S203, after executing the target Seed Job so that the target Seed Job generates a test execution job based on the configuration information, the generated test execution job can be executed so that the test execution job can be executed according to the test script in the configuration information The git location where it is located obtains the corresponding test script from the test script management module.
S204:执行测试脚本,以将测试流量指向配置信息指示的被测服务系统进行测试,直至被测服务系统完成测试,通过测试执行Job获取相应的测试监控数据,并基于测试监控数据生成测试报告。S204: Execute the test script to direct the test traffic to the service system under test indicated by the configuration information for testing until the service system under test completes the test, obtain corresponding test monitoring data through the test execution Job, and generate a test report based on the test monitoring data.
在具体执行步骤S204的过程中,在执行测试执行Job,使测试执行Job根据配置信息,获取相应的测试脚本后,自动基于测试引擎Bundle执行测试脚本,以触发配置信息中的测试节点机信息指示的测试节点机,将测试流量指向测试节点机信息指示的被测服务系统进行测试,当监控服务模块监测到被测服务系统完成测试,触发测试执行Job根据被监控的被测服务系统名、IP地址、获取相应的测试监控数据,以便报告服务模块根据获取到的测试监控数据中的各类信息进行整合生成测试报告,并存储至数据库中。其中,测试监控数据包括测试模型数据、监控信息、测试场景数据、测试策略、Gatling结果信息和测试执行Job的执行过程中产生的执行信息。In the process of specifically executing step S204, after executing the test execution Job, the test execution Job is made to obtain the corresponding test script according to the configuration information, and automatically executes the test script based on the test engine Bundle to trigger the test node machine information indication in the configuration information The test node machine, direct the test traffic to the service system under test indicated by the information of the test node machine for testing. When the monitoring service module detects that the service system under test has completed the test, it triggers the test execution Job according to the name and IP of the service system under test being monitored. address, and obtain the corresponding test monitoring data, so that the report service module can integrate various information in the obtained test monitoring data to generate a test report and store it in the database. Wherein, the test monitoring data includes test model data, monitoring information, test scenario data, test strategy, Gatling result information and execution information generated during the execution of the test execution Job.
在本申请实施例中,在生成测试报告后,可以展示生成的测试报告以便用户查看,还可以根据进行多次测试得到的多个测试报告生成综合测试报告,生成的综合测试报告。其中,测试节点机预先设置于Jenkins节点机集群中。In the embodiment of the present application, after the test report is generated, the generated test report can be displayed for the user to view, and a comprehensive test report can also be generated according to multiple test reports obtained from multiple tests. Among them, the test node machine is pre-set in the Jenkins node machine cluster.
本发明提供一种测试方法,预先设置有多种Seed Job,用户可以根据项目需求从预先设置的多种Seed Job中选取相应的Seed Job,在用户确定选取的Seed Job后,响应Seed Job选取指令,将Seed Job选取指令指示的Seed Job确定为目标SeedJob,执行该目标Seed Job,以使目标Seed Job基于用户预先配置的配置信息生成相应测试执行Job,通过执行生成的测试执行,便可获取与该配置信息相应的测试脚本,最后通过执行所获取的测试脚本,以将测试流量指向配置信息指示的被测服务系统进行测试,直至被测服务系统完成测试,通过测试执行Job获取相应的测试监控数据,并基于测试监控数据生成测试报告。本发明提供的技术方案,通过预先设置多种Seed Job以同时支持多种测试策略,用户可以以根据项目需求从预先设置的多种Seed Job中选取相应的Seed Job,无需根据不同的项目而选择不同型号的性能测试工具,从而解决了现有技术中由于性能测试工具选型不同,以及性能测试的标准、脚本、执行过程、测试策略、测试报告等数据的不统一的情况,导致无法准确地反映出服务系统的整体性能,以及不便于对服务系统进行维护的问题。The present invention provides a testing method, in which a variety of Seed Jobs are pre-set, and the user can select a corresponding Seed Job from the various pre-set Seed Jobs according to project requirements, and respond to the Seed Job selection instruction after the user determines the selected Seed Job , determine the Seed Job indicated by the Seed Job selection command as the target SeedJob, execute the target Seed Job, so that the target Seed Job generates a corresponding test execution Job based on the configuration information pre-configured by the user, and by executing the generated test execution, you can obtain the same The test script corresponding to the configuration information, and finally execute the obtained test script to direct the test traffic to the service system under test indicated by the configuration information for testing, until the service system under test completes the test, and obtain the corresponding test monitoring through the test execution Job data, and generate test reports based on test monitoring data. The technical solution provided by the present invention supports multiple testing strategies at the same time by presetting a variety of Seed Jobs, and users can select the corresponding Seed Job from the various pre-set Seed Jobs according to project requirements, without having to choose according to different projects Different types of performance testing tools, thus solving the problem of different types of performance testing tools in the prior art, as well as the inconsistency of performance testing standards, scripts, execution processes, test strategies, test reports and other data, resulting in inability to accurately It reflects the overall performance of the service system and the inconvenient maintenance of the service system.
在本申请实施例中,若Seed Job选取指令指示的Seed Job为单接口最优QPS自动发现测试执行Job模板,参见图3,示出了本发明实施例提供的另一种测试方法的流程示意图,该测试方法具体包括以下步骤:In the embodiment of the present application, if the Seed Job indicated by the Seed Job selection instruction is a single-interface optimal QPS automatic discovery test execution Job template, see Figure 3, which shows a schematic flow chart of another test method provided by the embodiment of the present invention , the test method specifically includes the following steps:
S301:响应SeedJob选取指令,将SeedJob选取指令指示的Seed Job确定为目标Seed Job,其中,SeedJob选取指令指示的Seed Job为单接口最优QPS自动发现测试执行Job模板。S301: In response to the SeedJob selection instruction, determine the Seed Job indicated by the SeedJob selection instruction as the target Seed Job, wherein the Seed Job indicated by the SeedJob selection instruction is a single-interface optimal QPS automatic discovery test execution Job template.
在具体执行步骤S301的过程中,用户可以根据项目需求从分布式性能测试平台的Jenkins控制机上预先设置的多种Seed Job中选取相应的Seed Job,在用户确定选取的SeedJob后,响应Seed Job选取指令,将该Seed Job选取指令指示的Seed Job确定为目标Seed Job。其中,Seed Job选取指令指示的Seed Job为单接口最优QPS自动发现测试执行Job模板。During the specific execution of step S301, the user can select the corresponding Seed Job from the various Seed Jobs preset on the Jenkins control machine of the distributed performance testing platform according to the project requirements, and after the user determines the selected Seed Job, respond to the Seed Job selection Instruction, determine the Seed Job indicated by the Seed Job selection instruction as the target Seed Job. Among them, the Seed Job indicated by the Seed Job selection instruction is a single-interface optimal QPS automatic discovery test execution Job template.
S302:执行目标Seed Job,以使目标Seed Job基于配置信息生成单接口最优QPS发现测试执行job。S302: Execute the target Seed Job, so that the target Seed Job generates a single-interface optimal QPS discovery test execution job based on the configuration information.
在具体执行步骤S302的过程中,在确定目标Seed Job后,用户可以在选取的目标Seed Job输入配置地址信息,并点击执行按钮,执行目标Seed Job,以使目标SeedJob根据输入的配置地址信息,获取相应的配置信息,解析所获取的配置信息,确定待创建的测试执行Job名称,判断当前是否存在与待创建的测试执行Job名称对应的单接口最优QPS发现测试执行job,若存在,则根据配置信息更新当前存在的与待创建的测试执行Job名称对应的单接口最优QPS发现测试执行job,若未存在,根据配置信息创建新的单接口最优QPS发现测试执行job。In the process of specifically executing step S302, after determining the target Seed Job, the user can input configuration address information in the selected target Seed Job, and click the Execute button to execute the target Seed Job, so that the target SeedJob can, according to the input configuration address information, Obtain the corresponding configuration information, analyze the obtained configuration information, determine the name of the test execution job to be created, and determine whether there is currently a single-interface optimal QPS discovery test execution job corresponding to the name of the test execution job to be created. If it exists, then Update the currently existing single-interface optimal QPS discovery test execution job corresponding to the name of the test execution job to be created according to the configuration information. If it does not exist, create a new single-interface optimal QPS discovery test execution job according to the configuration information.
进一步的,在本申请实施例中,在执行目标Seed Job,以使目标Seed Job基于配置信息生成单接口最优QPS发现测试执行job的同时,还可以基于生成的单接口最优QPS发现测试执行job相应的参数对引擎构建Job进行更新,利用更新后的引擎构建Job从测试引擎的Git中,获取引擎构建Job的代码,并运行所获取到的引擎构建Job的代码,得到测试引擎Bundle。Further, in the embodiment of the present application, while executing the target Seed Job so that the target Seed Job generates a single-interface optimal QPS discovery test execution job based on the configuration information, it can also be based on the generated single-interface optimal QPS discovery test execution Update the engine construction job with the corresponding parameters of the job, use the updated engine construction job to obtain the code of the engine construction job from Git of the test engine, and run the acquired code of the engine construction job to obtain the test engine Bundle.
S303:执行单接口最优QPS发现测试执行job,以使单接口最优QPS发现测试执行job响应用户的接口选取指令,将接口选取指令指示的接口确定为目标接口,并根据配置信息获取目标接口对应的测试脚本,若目标接口需要准备数据脚本,获取与目标接口相关联的其他接口返回的准备数据脚本,并执行准备 数据脚本,得到数据文件。S303: Execute the single-interface optimal QPS discovery test execution job, so that the single-interface optimal QPS discovery test execution job responds to the user's interface selection instruction, determines the interface indicated by the interface selection instruction as the target interface, and obtains the target interface according to the configuration information. For the corresponding test script, if the target interface needs to prepare data scripts, obtain the data preparation scripts returned by other interfaces associated with the target interface, and execute the data preparation scripts to obtain data files.
在步骤S303中,执行目标Seed Job,以使目标Seed Job基于配置信息生成单接口最优QPS发现测试执行job后,展示生成的单接口最优QPS发现测试执行job,用户可以通过展示的单接口最优QPS发现测试执行job中选取相应的接口,以及配置相应的配置参数。其中,配置的配置参数至少包括预设响应时间阈值和预设错误率。In step S303, the target Seed Job is executed, so that the target Seed Job can generate the single-interface optimal QPS discovery test execution job based on the configuration information, and then display the generated single-interface optimal QPS discovery test execution job, and the user can use the displayed single interface Select the corresponding interface in the optimal QPS discovery test execution job, and configure the corresponding configuration parameters. Wherein, the configured configuration parameters include at least a preset response time threshold and a preset error rate.
在具体执行步骤S303的过程中,在执行目标Seed Job,以使目标Seed Job基于配置信息生成单接口最优QPS发现测试执行job后,执行单接口最优QPS发现测试执行job,以使单接口最优QPS发现测试执行job响应用户的接口选取指令,将接口选取指令指示的接口确定为目标接口,并配置信息中的测试脚本所在git位置从测试脚本管理模块获取目标接口对应的测试脚本,若目标接口需要准备数据脚本,获取与目标接口相关联的其他接口返回的准备数据脚本,并执行准备数据脚本,得到数据文件。In the process of specifically executing step S303, after executing the target Seed Job so that the target Seed Job generates a single-interface optimal QPS discovery test execution job based on the configuration information, execute the single-interface optimal QPS discovery test execution job to make the single-interface optimal QPS discovery test execution job. The optimal QPS finds that the test execution job responds to the user's interface selection instruction, determines the interface indicated by the interface selection instruction as the target interface, and obtains the test script corresponding to the target interface from the test script management module at the git location of the test script in the configuration information, if The target interface needs to prepare data scripts, obtain the data preparation scripts returned by other interfaces associated with the target interface, and execute the data preparation scripts to obtain data files.
需要说明的是,执行单接口最优QPS发现测试执行job,以使单接口最优QPS发现测试执行job响应用户的接口选取指令,将接口选取指令指示的接口确定为目标接口,并获取目标接口对应的测试脚本,若目标接口不需要准备数据脚本,自动执行获取到的测试脚本,以将测试流量指向配置信息指示的被测服务系统进行测试,当监控服务模块监测到被测服务系统完成测试,触发测试执行Job根据被监控的被测服务系统名、IP地址、获取相应的测试监控数据,并基于测试监控数据生成测试报告。It should be noted that the single-interface optimal QPS discovery test execution job is executed so that the single-interface optimal QPS discovery test execution job responds to the user's interface selection command, determines the interface indicated by the interface selection command as the target interface, and obtains the target interface Corresponding test scripts, if the target interface does not need to prepare data scripts, automatically execute the obtained test scripts to direct the test traffic to the service system under test indicated by the configuration information for testing, when the monitoring service module detects that the service system under test completes the test , trigger the test execution Job to obtain the corresponding test monitoring data according to the monitored service system name and IP address, and generate a test report based on the test monitoring data.
S304:基于数据文件执行测试脚本,以将测试流量指向配置信息指示的被测服务系统进行测试,直至被测服务系统完成测试,通过测试执行Job获取相应的测试监控数据,并基于测试监控数据生成测试报告。S304: Execute the test script based on the data file to direct the test traffic to the service system under test indicated by the configuration information for testing until the service system under test completes the test, obtain the corresponding test monitoring data through the test execution Job, and generate based on the test monitoring data testing report.
在具体执行步骤S304的过程中,基于数据文件执行测试脚本,以触发配置信息中的测试节点机信息指示的测试节点机,将测试流量指向测试节点机信息指示的被测服务系统进行测试,当监控服务模块监测到被测服务系统完成测试,触发测试执行Job根据被监控的被测服务系统名、IP地址、获取相应的测试监控数据,以便报告服务模块根据获取到的测试监控数据中的各类信息进行整合生成测试报告。In the process of specifically executing step S304, the test script is executed based on the data file to trigger the test node machine indicated by the test node machine information in the configuration information, and point the test flow to the tested service system indicated by the test node machine information for testing. The monitoring service module detects that the service system under test has completed the test, and triggers the test execution Job to obtain the corresponding test monitoring data according to the name and IP address of the service system under test being monitored, so that the reporting service module can obtain the corresponding test monitoring data according to the obtained test monitoring data. Class information is integrated to generate test reports.
需要说明的是,生成的测试报告中至少包括接口QPS,该接口QPS对应的 响应时间和错误率。It should be noted that the generated test report includes at least the interface QPS, the response time and error rate corresponding to the interface QPS.
S305:通过单接口最优QPS发现测试执行job根据测试报告和配置参数,判断是否发现接口最优QPS;若发现,执行步骤S306;若未发现,执行步骤S308。S305: Execute the job through the single-interface optimal QPS discovery test to determine whether the interface optimal QPS is found according to the test report and configuration parameters; if found, execute step S306; if not found, execute step S308.
在具体执行步骤S305的过程中,在生成测试报告后,通过单接口最优QPS发现测试执行job获取测试报告中的接口QPS、该接口QPS的响应时间和该接口QPS的错误率,判断该接口QPS的响应时间是否小于配置参数中的预设响应时间、该接口QPS的错误率是否小于配置参数中的预设错误率,以及该接口QPS与历史最近一次接口QPS的差值是否超过预设偏差阈值。During the specific execution of step S305, after the test report is generated, the interface QPS in the test report, the response time of the interface QPS and the error rate of the interface QPS are obtained through the single interface optimal QPS discovery test execution job, and the interface is judged. Whether the QPS response time is less than the preset response time in the configuration parameters, whether the error rate of the interface QPS is less than the preset error rate in the configuration parameters, and whether the difference between the interface QPS and the last historical interface QPS exceeds the preset deviation threshold.
若该接口QPS的响应时间小于配置参数中的预设响应时间、该接口QPS的错误率小于配置参数中的预设错误率,以及该接口QPS与历史最近一次接口QPS的差值未超过预设偏差阈值,则可以将本次测试报告中的接口QPS确定为接口最优QPS,执行步骤S306。If the response time of the interface QPS is less than the preset response time in the configuration parameters, the error rate of the interface QPS is less than the preset error rate in the configuration parameters, and the difference between the interface QPS and the last historical interface QPS does not exceed the preset deviation threshold, the interface QPS in this test report may be determined as the interface optimal QPS, and step S306 is executed.
若该接口QPS的响应时间不小于配置参数中的预设响应时间、该接口QPS的错误率不小于配置参数中的预设错误率,或者该接口QPS与历史最近一次接口QPS的差值超过预设偏差阈值,则可以确定本次测试报告中的接口QPS不为接口最优QPS,执行步骤S308。If the response time of the interface QPS is not less than the preset response time in the configuration parameters, the error rate of the interface QPS is not less than the preset error rate in the configuration parameters, or the difference between the interface QPS and the latest interface QPS in history exceeds the preset If the deviation threshold is set, it can be determined that the interface QPS in this test report is not the interface optimal QPS, and step S308 is executed.
S306:通过单接口最优QPS发现测试执行job,判断当前接口最优QPS和历史最近一次接口最优QPS的差,与历史最近一次接口最优QPS的比是否超过预设阈值。若超过,执行步骤S307。S306: Execute the job through a single interface optimal QPS discovery test, and determine whether the difference between the current interface optimal QPS and the last historical interface optimal QPS, and the ratio of the most recent historical interface optimal QPS exceeds a preset threshold. If it exceeds, execute step S307.
在具体执行步骤S306的过程中,在本次测试报告中发现接口最优QPS的情况下,通过单接口最优QPS发现测试执行job,计算当前接口最优QPS与历史最近一次接口最优QPS的差值,与历史最近一次接口最优QPS的比是否超过预设阈值,若超过,可以确定被测服务系统的性能较差,输出相应的报警信息;若未超高,可以确定被测服务系统的性能良好,结束本次测试。During the specific execution of step S306, if the optimal QPS of the interface is found in this test report, the optimal QPS of the single interface is found to execute the job, and the difference between the optimal QPS of the current interface and the most recent optimal QPS of the interface in history is calculated. Difference value, whether the ratio of the most recent interface optimal QPS in history exceeds the preset threshold, if it exceeds, it can be determined that the performance of the service system under test is poor, and the corresponding alarm information will be output; if it is not too high, it can be determined that the service system under test The performance is good, end this test.
在本申请实施例中,在通过单接口最优QPS发现测试执行job根据测试报告和配置参数,发现接口最优QPS,将发现的接口最优QPS,以及与发现该接口最优QPS的过程中相关的数据一起保存至数据库中。In the embodiment of this application, in the process of discovering the optimal QPS of a single interface and executing the job according to the test report and configuration parameters, the optimal QPS of the interface is discovered, the optimal QPS of the interface to be discovered, and the process of discovering the optimal QPS of the interface Related data are stored together in the database.
S307:通过单接口最优QPS发现测试执行job,输出相应的报警信息。S307: Execute a job by discovering and testing the optimal QPS of a single interface, and output corresponding alarm information.
在具体执行步骤S307的过程中,在确定当前接口最优QPS和历史最近一次接口最优QPS的差,与历史最近一次接口最优QPS的比超过预设阈值的情况 下,可以确定被测服务系统的性能较差,通过单接口最优QPS发现测试执行job,以邮件的形式输出相应的报警信息。During the specific execution of step S307, when it is determined that the difference between the current optimal QPS of the interface and the optimal QPS of the most recent interface in history, and the ratio of the optimal QPS of the most recent interface in history exceeds a preset threshold, it can be determined that the service under test The performance of the system is poor. The optimal QPS of the single interface is used to find the test execution job and output the corresponding alarm information in the form of email.
S308:通过单接口最优QPS发现测试执行job,判断当前接口QPS对应的错误率是否超过预设错误率;若当前接口QPS对应的错误率小于预设错误率,执行步骤S309;若当前接口QPS对应的错误率不小于预设错误率,执行步骤S310。S308: Execute the job through the discovery test of the optimal QPS of a single interface, and judge whether the error rate corresponding to the current interface QPS exceeds the preset error rate; if the error rate corresponding to the current interface QPS is less than the preset error rate, perform step S309; if the current interface QPS The corresponding error rate is not less than the preset error rate, and step S310 is executed.
在具体执行步骤S308的过程中,在本次测试报告中未发现接口最优QPS的情况下,通过单接口最优QPS发现测试执行job,判断当前接口QPS对应的错误率是否超过预设错误率,若当前接口QPS对应的错误率小于预设错误率,执行步骤S309;若当前接口QPS对应的错误率不小于预设错误率,执行步骤S310。During the specific execution of step S308, if the optimal QPS of the interface is not found in this test report, the optimal QPS of the single interface is found to test and execute the job to determine whether the error rate corresponding to the current interface QPS exceeds the preset error rate , if the error rate corresponding to the current interface QPS is less than the preset error rate, perform step S309; if the error rate corresponding to the current interface QPS is not less than the preset error rate, perform step S310.
S309:增加被测服务系统的访问数据。S309: Increase the access data of the service system under test.
在具体执行步骤S309的过程中,在确定当前接口QPS对应的错误率小于预设错误率的情况下,增加被测服务系统的访问数据,并返回执行接口最优QPS发现测试执行job,直至发现接口最优QPS为止。During the specific execution of step S309, when it is determined that the error rate corresponding to the current interface QPS is less than the preset error rate, increase the access data of the service system under test, and return to execute the interface optimal QPS discovery test execution job until it is found Up to the optimal QPS of the interface.
在本申请实施例中,在发现接口最优QPS后,可以将发现的接口最优QPS,以及与发现该接口最优QPS的过程中产生的数据存储至数据库中,还可以根据发现的接口最优QPS的过程中产生各个接口QPS生成最优QPS趋势图,并将生成的最优QPS趋势图进行展示。In this embodiment of the application, after the optimal QPS of the interface is discovered, the discovered optimal QPS of the interface and the data generated during the process of discovering the optimal QPS of the interface can be stored in the database, and the optimal QPS of the interface can also be found In the process of optimizing QPS, the QPS of each interface is generated to generate the optimal QPS trend graph, and the generated optimal QPS trend graph is displayed.
S310:减小被测服务系统的访问数据。S310: Reduce the access data of the service system under test.
在具体执行步骤S310的过程中,在确定当前接口QPS对应的错误率不小于预设错误率的情况下,减小被测服务系统的访问数据,并返回执行接口最优QPS发现测试执行job,直至发现接口最优QPS为止。During the specific execution of step S310, when it is determined that the error rate corresponding to the current interface QPS is not less than the preset error rate, reduce the access data of the service system under test, and return to execute the interface optimal QPS discovery test execution job, Until the optimal QPS of the interface is found.
在本申请实施例中,在Seed Job选取指令指示的Seed Job为单接口最优QPS自动发现测试执行Job模板,即目标Seed Job为单接口最优QPS自动发现测试执行Job模板的情况下,执行目标Seed Job,以使目标Seed Job基于配置信息生成单接口最优QPS发现测试执行job,并执行单接口最优QPS发现测试执行job,使单接口最优QPS发现测试执行job根据配置信息,获取相应的测试脚本后,自动执行测试脚本,以将测试流量指向配置信息指示的被测服务系统进行测试,直至被测服务系统完成测试,通过测试执行Job获取相应的测试监控数据,并基于测试监控数据生成测试报告,进而通过单接口最优QPS发现测试执行job根据测试报告和配置参数,判断是否发现接口最优QPS,以便基于发现的接口 最优QPS,判断被测服务系统的性能情况,在确定被测服务系统的性能较差的情况下,输出相应的报警信息,以便运维人员根据输出的报警信息对被测服务系统进行维护。In the embodiment of the present application, when the Seed Job indicated by the Seed Job selection instruction is a single-interface optimal QPS automatic discovery test execution Job template, that is, when the target Seed Job is a single-interface optimal QPS automatic discovery test execution Job template, execute Target Seed Job, so that the target Seed Job generates a single-interface optimal QPS discovery test execution job based on the configuration information, and executes the single-interface optimal QPS discovery test execution job, so that the single-interface optimal QPS discovery test execution job obtains according to the configuration information After the corresponding test script is executed, the test script is automatically executed to direct the test traffic to the service system under test indicated by the configuration information for testing until the service system under test completes the test, and obtains the corresponding test monitoring data through the test execution Job, and based on the test monitoring The test report is generated from the data, and then the test execution job is found through the optimal QPS of the single interface. According to the test report and configuration parameters, it is judged whether the optimal QPS of the interface is found, so as to judge the performance of the service system under test based on the optimal QPS of the interface found. When it is determined that the performance of the service system under test is poor, corresponding alarm information is output, so that the operation and maintenance personnel can maintain the service system under test according to the output alarm information.
附图中的流程图和框图,图示了按照本发明公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。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 disclosure. In this regard, each block in a flowchart or block diagram may represent a module, program segment, or portion of code that contains one or more logical functions for implementing specified executable instructions. 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 they may sometimes be executed in the reverse order, depending upon the functionality involved. It should also be noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by a dedicated hardware-based system that performs the specified functions or operations , or may be implemented by a combination of dedicated hardware and computer instructions.
在一些实施方式中,客户端、服务器可以利用诸如HTTP(HyperText Transfer Protocol,超文本传输协议)之类的任何当前已知或未来研发的网络协议进行通信,并且可以与任意形式或介质的数字数据通信(例如,通信网络)互连。通信网络的示例包括局域网(“LAN”),广域网(“WAN”),网际网(例如,互联网)以及端对端网络(例如,ad hoc端对端网络),以及任何当前已知或未来研发的网络。In some embodiments, the client and the server can communicate using any currently known or future network protocols such as HTTP (HyperText Transfer Protocol, Hypertext Transfer Protocol), and can communicate with digital data in any form or medium The communication (eg, communication network) interconnections. Examples of communication networks include local area networks ("LANs"), wide area networks ("WANs"), internetworks (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network of.
本发明公开实施方式中的多个装置之间所交互的消息或者信息的名称仅用于说明性的目的,而并不是用于对这些消息或信息的范围进行限制。The names of messages or information exchanged between multiple devices in the embodiments disclosed in the present invention are for illustrative purposes only, and are not used to limit the scope of these messages or information.
虽然采用特定次序描绘了各操作,但是这不应当理解为要求这些操作以所示出的特定次序或以顺序次序执行来执行。在一定环境下,多任务和并行处理可能是有利的。Although operations are depicted in a particular order, this should not be understood as requiring that the operations be performed in the particular order shown or to be performed in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous.
应当理解,本发明公开的方法实施方式中记载的各个步骤可以按照不同的顺序执行,和/或并行执行。此外,方法实施方式可以包括附加的步骤和/或省略执行示出的步骤。本发明公开的范围在此方面不受限制。It should be understood that the various steps described in the method implementations disclosed in the present invention may be executed in different orders, and/or executed in parallel. Additionally, method embodiments may include additional steps and/or omit performing illustrated steps. The scope of the present disclosure is not limited in this respect.
可以以一种或多种程序设计语言或其组合来编写用于执行本发明公开的操作的计算机程序代码,上述程序设计语言包括但不限于面向对象的程序设计 语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。Computer program code for performing the operations disclosed in the present invention may be written in one or more programming languages, or combinations thereof, including but not limited to object-oriented programming languages—such as Java, Smalltalk, C++, Also included are conventional procedural programming languages - such as the "C" language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In cases involving a remote computer, the remote computer can be connected to the user computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (such as through an Internet service provider). Internet connection).
与上述本发明实施例公开的一种测试方法相对应,参考图4,本发明实施例还提供了一种测试装置的结构示意图,该测试装置包括:Corresponding to a test method disclosed in the above-mentioned embodiment of the present invention, referring to FIG. 4 , the embodiment of the present invention also provides a schematic structural diagram of a test device, which includes:
第一确定单元41,用于响应Seed Job选取指令,将Seed Job选取指令指示的SeedJob确定为目标Seed Job;The first determination unit 41 is used to respond to the Seed Job selection instruction, and determine the SeedJob indicated by the Seed Job selection instruction as the target Seed Job;
第一执行单元42,用于执行目标Seed Job,以使目标Seed Job基于配置信息生成测试执行Job,其中,配置信息是用户根据项目需求预先配置的;The first execution unit 42 is used to execute the target Seed Job, so that the target Seed Job generates a test execution Job based on configuration information, wherein the configuration information is pre-configured by the user according to project requirements;
第二执行单元43,用于执行测试执行Job,使测试执行Job根据配置信息,获取相应的测试脚本;The second execution unit 43 is configured to execute the test execution Job, so that the test execution Job obtains a corresponding test script according to the configuration information;
第三执行单元44,用于执行测试脚本,以将测试流量指向配置信息指示的被测服务系统进行测试,直至被测服务系统完成测试,通过测试执行Job获取相应的测试监控数据,并基于测试监控数据生成测试报告。The third execution unit 44 is used to execute the test script to direct the test traffic to the service system under test indicated by the configuration information for testing until the service system under test completes the test, obtain the corresponding test monitoring data through the test execution Job, and based on the test Monitor data to generate test reports.
上述本发明实施例公开的测试装置中各个单元具体的原理和执行过程,与上述本发明实施例公开的测试方法相同,可参见上述本发明实施例公开的测试方法中相应的部分,这里不再进行赘述。The specific principle and execution process of each unit in the test device disclosed in the above-mentioned embodiments of the present invention are the same as the test methods disclosed in the above-mentioned embodiments of the present invention. Please refer to the corresponding parts in the test methods disclosed in the above-mentioned embodiments of the present invention, which will not be repeated here to repeat.
本发明提供一种测试装置,预先设置有多种Seed Job,用户可以根据项目需求从预先设置的多种Seed Job中选取相应的Seed Job,在用户确定选取的Seed Job后,响应Seed Job选取指令,将Seed Job选取指令指示的Seed Job确定为目标SeedJob,执行该目标Seed Job,以使目标Seed Job基于用户预先配置的配置信息生成相应测试执行Job,通过执行生成的测试执行,便可获取与该配置信息相应的测试脚本,最后通过执行所获取的测试脚本,以将测试流量指向配置信息指示的被测服务系统进行测试,直至被测服务系统完成测试,通过测试执行Job获取相应的测试监控数据,并基于测试监控数据生成测试报告。本发明 提供的技术方案,通过预先设置多种Seed Job以同时支持多种测试策略,用户可以以根据项目需求从预先设置的多种Seed Job中选取相应的Seed Job,无需根据不同的项目而选择不同型号的性能测试工具,从而解决了现有技术中由于性能测试工具选型不同,以及性能测试的标准、脚本、执行过程、测试策略、测试报告等数据的不统一的情况,导致无法准确地反映出服务系统的整体性能,以及不便于对服务系统进行维护的问题。The present invention provides a test device, which is preset with multiple Seed Jobs, and the user can select the corresponding Seed Job from the preset multiple Seed Jobs according to the project requirements, and respond to the Seed Job selection instruction after the user determines the selected Seed Job , determine the Seed Job indicated by the Seed Job selection command as the target SeedJob, execute the target Seed Job, so that the target Seed Job generates a corresponding test execution Job based on the configuration information pre-configured by the user, and by executing the generated test execution, you can obtain the same The test script corresponding to the configuration information, and finally execute the obtained test script to direct the test traffic to the service system under test indicated by the configuration information for testing, until the service system under test completes the test, and obtain the corresponding test monitoring through the test execution Job data, and generate test reports based on test monitoring data. The technical solution provided by the present invention supports multiple testing strategies at the same time by presetting a variety of Seed Jobs, and users can select the corresponding Seed Job from the various pre-set Seed Jobs according to project requirements, without having to choose according to different projects Different types of performance testing tools, thus solving the problem of different types of performance testing tools in the prior art, as well as the inconsistency of performance testing standards, scripts, execution processes, test strategies, test reports and other data, resulting in inability to accurately It reflects the overall performance of the service system and the inconvenient maintenance of the service system.
进一步的,本发明提供的测试装置,还包括:Further, the test device provided by the present invention also includes:
更新单元,用于基于测试执行Job对引擎构建Job进行更新。The update unit is used to update the engine construction job based on the test execution job.
可选的,第三执行单元,具体用于基于测试引擎Bundle执行测试脚本,以触发配置信息指示的测试节点机,将测试流量指向配置信息指示的被测服务系统进行测试,直至被测服务系统完成测试,通过测试执行Job获取相应的测试监控数据,并基于测试监控数据生成测试报告;Optionally, the third execution unit is specifically used to execute the test script based on the test engine Bundle, to trigger the test node machine indicated by the configuration information, and direct the test traffic to the service system under test indicated by the configuration information for testing until the service system under test Complete the test, obtain the corresponding test monitoring data through the test execution Job, and generate a test report based on the test monitoring data;
其中,测试引擎Bundle,是利用更新后的引擎构建Job从测试引擎的Git中,获取并运行引擎构建Job的代码得到的。Among them, the test engine Bundle is obtained by using the updated engine construction job to obtain and run the code of the engine construction job from Git of the test engine.
可选的,第一执行单元,具体用于执行目标Seed Job,以使目标Seed Job根据输入的配置地址信息,获取并解析配置信息,确定待创建的测试执行Job名称,若未存在与待创建的测试执行Job名称对应的测试执行Job,根据配置信息创建测试执行Job;Optionally, the first execution unit is specifically used to execute the target Seed Job, so that the target Seed Job obtains and parses the configuration information according to the input configuration address information, and determines the name of the test execution Job to be created. If it does not exist and to be created Create the test execution Job corresponding to the test execution Job name of the test execution job according to the configuration information;
其中,配置信息是用户预先配置的,配置地址信息是用户输入的。Wherein, the configuration information is pre-configured by the user, and the configuration address information is input by the user.
可选的,若测试执行job为单接口最优QPS发现测试执行job,第二执行单元,具体用于执行单接口最优QPS发现测试执行job,以使单接口最优QPS发现测试执行job响应用户的接口选取指令,将接口选取指令指示的接口确定为目标接口,并根据配置信息获取目标接口对应的测试脚本,若目标接口需要准备数据脚本,获取与目标接口相关联的其他接口返回的准备数据脚本,并执行准备数据脚本,得到数据文件;Optionally, if the test execution job is a single-interface optimal QPS discovery test execution job, the second execution unit is specifically used to execute the single-interface optimal QPS discovery test execution job, so that the single-interface optimal QPS discovery test execution job responds The user's interface selection command determines the interface indicated by the interface selection command as the target interface, and obtains the test script corresponding to the target interface according to the configuration information. If the target interface needs to prepare data scripts, obtain the preparation returned by other interfaces associated with the target interface Data script, and execute the prepare data script to get the data file;
相应的,第三执行单元,还用于基于数据文件执行测试脚本。Correspondingly, the third execution unit is also used to execute the test script based on the data file.
进一步的,本发明提供的测试装置,还包括:Further, the test device provided by the present invention also includes:
输出单元,用于当通过单接口最优QPS发现测试执行job根据测试报告和配置参数,发现接口最优QPS,且当前接口最优QPS和历史最近一次接口最优QPS的差,与历史最近一次接口最优QPS的比超过预设阈值时,输出相应的报警信息;The output unit is used to find the optimal QPS of the interface through the single interface optimal QPS discovery test execution job according to the test report and configuration parameters, and the difference between the current optimal QPS of the interface and the last optimal QPS of the interface in history is the same as the latest historical one When the ratio of the optimal QPS of the interface exceeds the preset threshold, the corresponding alarm information is output;
访问数据调整单元,用于当通过单接口最优QPS发现测试执行job根据测试报告和配置参数,未发现接口最优QPS,且当前接口QPS对应的错误率是否小于预设错误率阈值,增加被测服务系统的访问数据后,返回执行单接口最优QPS发现测试执行job,直至发现接口最优QPS;或者,通过单接口最优QPS发现测试执行job根据测试报告和配置参数,未发现接口最优QPS,且当前接口QPS对应的错误率不小于预设错误率时,减小被测服务系统的访问数据后,返回执行单接口最优QPS发现测试执行job,直至发现接口最优QPS;The access data adjustment unit is used for when the optimal QPS of a single interface is found for the test execution job. According to the test report and configuration parameters, the optimal QPS of the interface is not found, and the error rate corresponding to the current interface QPS is less than the preset error rate threshold, and the added value is added. After testing the access data of the service system, return to execute the single-interface optimal QPS discovery test execution job until the interface optimal QPS is found; or, through the single-interface optimal QPS discovery test execution job according to the test report and configuration parameters, no interface optimal QPS is found Excellent QPS, and the error rate corresponding to the current interface QPS is not less than the preset error rate, after reducing the access data of the service system under test, return to execute the single interface optimal QPS discovery test execution job until the interface optimal QPS is found;
其中,配置参数为用户基于单接口最优QPS发现测试执行job上传的,配置参数至少包括预设错误率,测试报告包括当前接口QPS对应的错误率。Among them, the configuration parameters are uploaded by the user based on the single-interface optimal QPS discovery test to execute the job upload, the configuration parameters include at least the preset error rate, and the test report includes the error rate corresponding to the current interface QPS.
描述于本发明公开实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,单元的名称在某种情况下并不构成对该单元本身的限定,例如,第一获取单元还可以被描述为“获取至少两个网际协议地址的单元”。The units involved in the disclosed embodiments of the present invention may be implemented by means of software or hardware. Wherein, the name of the unit does not constitute a limitation of the unit itself under certain circumstances, for example, the first obtaining unit may also be described as "a unit for obtaining at least two Internet Protocol addresses".
本申请以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。The functions described above in this application may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), System on Chips (SOCs), Complex Programmable Logical device (CPLD) and so on.
本申请实施例还提供一种电子设备,该电子设备包括:处理器以及存储器,处理器以及存储器通过通信总线相连;其中,处理器,用于调用并执行存储器中存储的程序;存储器,用于存储程序,该程序用于实现测试方法。The embodiment of the present application also provides an electronic device, the electronic device includes: a processor and a memory, the processor and the memory are connected through a communication bus; wherein, the processor is used to call and execute the program stored in the memory; the memory is used to Stores the program used to implement the test method.
下面参考图5,其示出了适于用来实现本发明公开实施例的电子设备的结构示意图。本发明公开实施例中的电子设备可以包括但不限于诸如移动电话、 笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。图5示出的电子设备仅仅是一个示例,不应对本发明公开实施例的功能和使用范围带来任何限制。Referring now to FIG. 5 , it shows a schematic structural diagram of an electronic device suitable for implementing the disclosed embodiments of the present invention. Electronic devices in the disclosed embodiments of the present invention may include, but are not limited to, mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals ( Mobile terminals such as car navigation terminals) and stationary terminals such as digital TVs, desktop computers and the like. The electronic device shown in FIG. 5 is only an example, and should not limit the functions and scope of use of the disclosed embodiments of the present invention.
如图5所示,电子设备可以包括处理装置(例如中央处理器、图形处理器等501,其可以根据存储在只读存储器(ROM)502中的程序或者从存储装置506加载到随机访问存储器(RAM)503中的程序而执行各种适当的动作和处理。在RAM 503中,还存储有电子设备操作所需的各种程序和数据。处理装置501、ROM 502以及RAM 503通过总线504彼此相连。输入/输出(I/O)接口505也连接至总线504。As shown in FIG. 5 , an electronic device may include a processing device (such as a central processing unit, a graphics processing unit, etc. 501), which may be loaded into a random access memory ( The program in RAM) 503 executes various appropriate actions and processes. In RAM 503, various programs and data required for the operation of electronic equipment are also stored. Processing device 501, ROM 502 and RAM 503 are connected to each other by bus 504 An input/output (I/O) interface 505 is also connected to the bus 504 .
通常,以下装置可以连接至I/O接口505:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置506;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置507;包括例如磁带、硬盘等的存储装置508;以及通信装置509。通信装置509可以允许电子设备与其他设备进行无线或有线通信以交换数据。虽然图5示出了具有各种装置的电子设备,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。Typically, the following devices can be connected to the I/O interface 505: input devices 506 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, a liquid crystal display (LCD), speaker, vibration an output device 507 such as a computer; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509. The communication means 509 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. While FIG. 5 shows an electronic device having various means, it should be understood that implementing or having all of the means shown is not a requirement. More or fewer means may alternatively be implemented or provided.
特别地,根据本发明公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本发明公开的实施例包括一种计算机程序产品,其包括承载在非暂态计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置509从网络上被下载和安装,或者从存储装置508被安装,或者从ROM 502被安装。在该计算机程序被处理装置501执行时,执行本发明公开实施例的方法中限定的上述功能。In particular, according to the disclosed embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the disclosed embodiments of the present invention include a computer program product, which includes a computer program carried on a non-transitory computer readable medium, where the computer program includes program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via communication means 509, or from storage means 508, or from ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the methods of the disclosed embodiments of the present invention are performed.
更进一步的,本发明实施例还提供一种计算机可读存储介质,计算机可读存储介质中存储有计算机可执行指令,计算机可执行指令用于执行测试方法。Furthermore, the embodiment of the present invention also provides a computer-readable storage medium, in which computer-executable instructions are stored, and the computer-executable instructions are used to execute the testing method.
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:响应Seed Job选取指令,将Seed Job选取指令指示的Seed Job确定为目标Seed Job;执行目标Seed Job,以使目标 Seed Job基于配置信息生成测试执行Job,其中,配置信息是用户根据项目需求预先配置的;执行测试执行Job,使测试执行Job根据配置信息,获取相应的测试脚本;执行测试脚本,以将测试流量指向配置信息指示的被测服务系统进行测试,直至被测服务系统完成测试,获取相应的测试监控数据,并基于测试监控数据生成测试报告。The above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device: responds to the Seed Job selection instruction, and determines the Seed Job indicated by the Seed Job selection instruction as the target Seed Job; Execute the target Seed Job, so that the target Seed Job generates a test execution job based on the configuration information, where the configuration information is pre-configured by the user according to the project requirements; Execute the test execution job, so that the test execution job obtains the corresponding Test script: Execute the test script to direct the test traffic to the service system under test indicated by the configuration information for testing until the service system under test completes the test, obtain corresponding test monitoring data, and generate a test report based on the test monitoring data.
在本发明公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media would include one or more wire-based electrical connections, portable computer discs, hard drives, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, compact disk read only memory (CD-ROM), optical storage, magnetic storage, or any suitable combination of the foregoing.
需要说明的是,本发明公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本发明公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本发明公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于: 电线、光缆、RF(射频)等等,或者上述的任意合适的组合。It should be noted that the above-mentioned computer-readable medium disclosed in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. A computer readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present disclosure, however, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code therein. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can transmit, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device . Program code embodied on a computer readable medium may be transmitted by any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。The above-mentioned computer-readable medium may be included in the above-mentioned electronic device, or may exist independently without being incorporated into the electronic device.

Claims (10)

  1. 一种测试方法,其特征在于,应用于分布式性能测试平台,所述方法包括:A testing method is characterized in that being applied to a distributed performance testing platform, the method comprises:
    响应Seed Job选取指令,将所述Seed Job选取指令指示的所述Seed Job确定为目标Seed Job;In response to the Seed Job selection instruction, the Seed Job indicated by the Seed Job selection instruction is determined as the target Seed Job;
    执行所述目标Seed Job,以使所述目标Seed Job基于配置信息生成测试执行Job,其中,所述配置信息是用户根据项目需求预先配置的;Executing the target Seed Job so that the target Seed Job generates a test execution Job based on configuration information, wherein the configuration information is pre-configured by the user according to project requirements;
    执行测试执行Job,使所述测试执行Job根据配置信息,获取相应的测试脚本;Execute the test execution Job, so that the test execution Job obtains a corresponding test script according to the configuration information;
    执行所述测试脚本,以将测试流量指向配置信息指示的被测服务系统进行测试,直至所述被测服务系统完成测试,通过所述测试执行Job获取相应的测试监控数据,并基于所述测试监控数据生成测试报告。Execute the test script to direct the test traffic to the service system under test indicated by the configuration information for testing until the service system under test completes the test, obtain corresponding test monitoring data through the test execution Job, and based on the test Monitor data to generate test reports.
  2. 根据权利要求1的方法,其特征在于,执行所述目标Seed Job,以使所述目标Seed Job基于配置信息生成测试执行Job之后,还包括:The method according to claim 1, wherein, after executing the target Seed Job so that the target Seed Job generates a test based on configuration information and executes the Job, it also includes:
    基于所述测试执行Job对引擎构建Job进行更新。The engine construction job is updated based on the test execution job.
  3. 根据权利要求2的方法,其特征在于,所述执行测试脚本,以将测试流量指向配置信息指示的被测服务系统进行测试,直至所述被测服务系统完成测试,通过所述测试执行Job获取相应的测试监控数据,并所述基于测试监控数据生成测试报告,包括:The method according to claim 2, characterized in that the test script is executed to direct the test traffic to the service system under test indicated by the configuration information for testing until the service system under test completes the test, and the test execution Job obtains Corresponding test monitoring data, and generating a test report based on the test monitoring data, including:
    基于测试引擎Bundle执行所述测试脚本,以触发配置信息指示的测试节点机,将测试流量指向配置信息指示的被测服务系统进行测试,直至所述被测服务系统完成测试,通过所述测试执行Job获取相应的测试监控数据,并基于所述测试监控数据生成测试报告;Execute the test script based on the test engine Bundle to trigger the test node machine indicated by the configuration information, point the test traffic to the service system under test indicated by the configuration information for testing, until the service system under test completes the test, and execute through the test Job obtains corresponding test monitoring data, and generates a test report based on the test monitoring data;
    其中,所述测试引擎Bundle,是利用更新后的引擎构建Job从测试引擎的Git中,获取并运行所述引擎构建Job的代码得到的。Wherein, the test engine Bundle is obtained by using the updated engine construction Job to obtain and run the code of the engine construction job from Git of the test engine.
  4. 根据权利要求1的方法,其特征在于,所述执行目标Seed Job,以使所述目标Seed Job基于配置信息生成测试执行Job,包括:The method according to claim 1, wherein said executing the target Seed Job, so that said target Seed Job generates a test execution Job based on configuration information, comprising:
    执行所述目标Seed Job,以使所述目标Seed Job根据输入的配置地址信息,获取并解析配置信息,确定待创建的测试执行Job名称,若未存在与所述待创建的测试执行Job名称对应的测试执行Job,根据配置信息创建所述测试执行Job;Execute the target Seed Job so that the target Seed Job obtains and parses the configuration information according to the input configuration address information, and determines the name of the test execution Job to be created, if there is no corresponding to the name of the test execution Job to be created The test executes the Job, and creates the test execution Job according to the configuration information;
    其中,所述配置信息是用户预先配置的,所述配置地址信息是用户输入的。Wherein, the configuration information is pre-configured by the user, and the configuration address information is input by the user.
  5. 根据权利要求1的方法,其特征在于,若所述测试执行job为单接口最优QPS发现测试执行job,执行所述测试执行Job,使所述测试执行Job根据配置信息,获取相应的测试脚本,包括:The method according to claim 1, characterized in that, if the test execution job is a single-interface optimal QPS discovery test execution job, execute the test execution job, so that the test execution job obtains the corresponding test script according to the configuration information ,include:
    执行所述单接口最优QPS发现测试执行job,以使所述单接口最优QPS发现测试执行job响应用户的接口选取指令,将所述接口选取指令指示的接口确定为目标接口,并根据所述配置信息获取所述目标接口对应的测试脚本,若所述目标接口需要准备数据脚本,获取与所述目标接口相关联的其他接口返回的所述准备数据脚本,并执行所述准备数据脚本,得到数据文件;Execute the single-interface optimal QPS discovery test execution job, so that the single-interface optimal QPS discovery test execution job responds to the user's interface selection instruction, and the interface indicated by the interface selection instruction is determined as the target interface, and according to the selected The configuration information obtains the test script corresponding to the target interface, if the target interface needs to prepare a data script, obtains the prepared data script returned by other interfaces associated with the target interface, and executes the prepared data script, get the data file;
    相应的,所述执行测试脚本,包括:Correspondingly, the execution of the test script includes:
    基于所述数据文件所述执行测试脚本。A test script is executed based on the data file.
  6. 根据权利要求5的方法,其特征在于,所述生成所述测试报告之后,方法还包括:The method according to claim 5, characterized in that, after said generating said test report, the method further comprises:
    当通过所述单接口最优QPS发现测试执行job根据所述测试报告和配置参数,发现接口最优QPS,且当前所述接口最优QPS和历史最近一次接口最优QPS的差,与所述历史最近一次接口最优QPS的比超过预设阈值时,输出相应的报警信息;When the optimal QPS of the single interface is found to be tested and executed according to the test report and configuration parameters, the optimal QPS of the interface is found, and the difference between the optimal QPS of the current interface and the optimal QPS of the last interface in history is the same as that of the When the ratio of the optimal QPS of the interface in the last time in history exceeds the preset threshold, the corresponding alarm information will be output;
    当通过所述单接口最优QPS发现测试执行job根据所述测试报告和所述配置参数,未发现所述接口最优QPS,且当前接口QPS对应的错误率是否小于预设错误率阈值,增加所述被测服务系统的访问数据后,返回执行所述单接口最优QPS发现测试执行job,直至发现所述接口最优QPS;When the optimal QPS of the single interface is found through the test execution job according to the test report and the configuration parameters, the optimal QPS of the interface is not found, and whether the error rate corresponding to the current interface QPS is less than the preset error rate threshold, increase After the access data of the service system under test, return to execute the single interface optimal QPS discovery test execution job until the optimal QPS of the interface is found;
    或者,通过所述单接口最优QPS发现测试执行job根据所述测试报告和所述配置参数,未发现所述接口最优QPS,且当前所述接口QPS对应的错误率 不小于所述预设错误率时,减小所述被测服务系统的访问数据后,返回执行所述单接口最优QPS发现测试执行job,直至发现所述接口最优QPS;Or, according to the test report and the configuration parameters through the single interface optimal QPS discovery test execution job, the optimal QPS of the interface is not found, and the error rate corresponding to the current interface QPS is not less than the preset When the error rate is lower, after reducing the access data of the service system under test, return to execute the single interface optimal QPS discovery test execution job until the optimal QPS of the interface is found;
    其中,所述配置参数为用户基于所述单接口最优QPS发现测试执行job上传的,所述配置参数至少包括所述预设错误率,所述测试报告至少包括当前所述接口QPS对应的错误率。Wherein, the configuration parameters are uploaded by the user based on the single interface optimal QPS discovery test execution job, the configuration parameters include at least the preset error rate, and the test report includes at least the error rate corresponding to the current interface QPS Rate.
  7. 一种测试装置,其特征在于,应用于分布式性能测试平台,所述装置包括:A test device, characterized in that it is applied to a distributed performance test platform, said device comprising:
    第一确定单元,用于响应Seed Job选取指令,将所述Seed Job选取指令指示的所述SeedJob确定为目标SeedJob;The first determination unit is configured to respond to a Seed Job selection instruction, and determine the SeedJob indicated by the Seed Job selection instruction as a target SeedJob;
    第一执行单元,用于执行所述目标SeedJob,以使所述目标Seed Job基于配置信息生成测试执行Job,其中,所述配置信息是用户根据项目需求预先配置的;A first execution unit, configured to execute the target SeedJob, so that the target Seed Job generates a test execution Job based on configuration information, wherein the configuration information is pre-configured by the user according to project requirements;
    第二执行单元,用于执行测试执行Job,使所述测试执行Job根据配置信息,获取相应的测试脚本;The second execution unit is used to execute the test execution job, so that the test execution job obtains a corresponding test script according to the configuration information;
    第三执行单元,用于执行所述测试脚本,以将测试流量指向配置信息指示的被测服务系统进行测试,直至所述被测服务系统完成测试,通过所述测试执行Job获取相应的测试监控数据,并基于所述测试监控数据生成测试报告。The third execution unit is configured to execute the test script to direct the test traffic to the service system under test indicated by the configuration information for testing until the service system under test completes the test, and obtain corresponding test monitoring through the test execution Job data, and generate a test report based on the test monitoring data.
  8. 根据权利要求7的装置,其特征在于,装置还包括:The device according to claim 7, characterized in that the device further comprises:
    更新单元,用于基于所述测试执行Job对引擎构建Job进行更新。An update unit, configured to update the engine construction job based on the test execution job.
  9. 一种电子设备,其特征在于,包括:处理器以及存储器,处理器以及存储器通过通信总线相连;其中,处理器,用于调用并执行存储器中存储的程序;存储器,用于存储程序,程序用于实现如权利要求1-6任意一项的所述的测试方法。An electronic device, characterized in that it includes: a processor and a memory, the processor and the memory are connected through a communication bus; wherein, the processor is used to call and execute the program stored in the memory; the memory is used to store the program, and the program uses To realize the testing method described in any one of claims 1-6.
  10. 一种计算机可读存储介质,其特征在于,计算机可读存储介质中存储有计算机可执行指令,计算机可执行指令用于执行权利要求1-6任意一项的所述的测试方法。A computer-readable storage medium, characterized in that computer-executable instructions are stored in the computer-readable storage medium, and the computer-executable instructions are used to execute the testing method described in any one of claims 1-6.
PCT/CN2022/088910 2021-06-30 2022-04-25 Test method and apparatus, electronic device, and storage medium WO2023273561A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110739282.7A CN113485918A (en) 2021-06-30 2021-06-30 Test method, test device, electronic equipment and storage medium
CN202110739282.7 2021-06-30

Publications (1)

Publication Number Publication Date
WO2023273561A1 true WO2023273561A1 (en) 2023-01-05

Family

ID=77937120

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/088910 WO2023273561A1 (en) 2021-06-30 2022-04-25 Test method and apparatus, electronic device, and storage medium

Country Status (2)

Country Link
CN (1) CN113485918A (en)
WO (1) WO2023273561A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115934575A (en) * 2023-03-10 2023-04-07 北京全路通信信号研究设计院集团有限公司 Product testing method, device, equipment and storage medium
CN116028377A (en) * 2023-03-28 2023-04-28 之江实验室 Automatic test method, device and medium based on jenkins
CN116431523A (en) * 2023-06-12 2023-07-14 建信金融科技有限责任公司 Test data management method, device, equipment, storage medium and product

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113485918A (en) * 2021-06-30 2021-10-08 中国民航信息网络股份有限公司 Test method, test device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9052941B1 (en) * 2011-05-27 2015-06-09 Amazon Technologies, Inc. Automated testing of online functionality providers
CN111209205A (en) * 2020-01-08 2020-05-29 北京字节跳动网络技术有限公司 Configuration method and device and electronic equipment
CN111767208A (en) * 2020-06-02 2020-10-13 北京金堤科技有限公司 Automatic test method and device
CN112527686A (en) * 2020-12-29 2021-03-19 平安普惠企业管理有限公司 Interface performance test method, device, equipment and storage medium
CN112597047A (en) * 2020-12-29 2021-04-02 上海瑞家信息技术有限公司 Test method, test device, electronic equipment and computer readable medium
CN113485918A (en) * 2021-06-30 2021-10-08 中国民航信息网络股份有限公司 Test method, test device, electronic equipment and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10162735B2 (en) * 2015-09-30 2018-12-25 Red Hat, Inc. Distributed system test automation framework
CN109284229B (en) * 2018-10-17 2022-02-22 武汉斗鱼网络科技有限公司 Dynamic adjustment method based on QPS and related equipment
US10515005B1 (en) * 2018-12-20 2019-12-24 Atlassian Pty Ltd Systems and methods for testing source code
CN111651351B (en) * 2020-05-29 2022-11-18 成都新潮传媒集团有限公司 Jenkins-based software performance testing method and computer main equipment
CN112527642A (en) * 2020-12-07 2021-03-19 中国平安人寿保险股份有限公司 Performance test index data display method, device, equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9052941B1 (en) * 2011-05-27 2015-06-09 Amazon Technologies, Inc. Automated testing of online functionality providers
CN111209205A (en) * 2020-01-08 2020-05-29 北京字节跳动网络技术有限公司 Configuration method and device and electronic equipment
CN111767208A (en) * 2020-06-02 2020-10-13 北京金堤科技有限公司 Automatic test method and device
CN112527686A (en) * 2020-12-29 2021-03-19 平安普惠企业管理有限公司 Interface performance test method, device, equipment and storage medium
CN112597047A (en) * 2020-12-29 2021-04-02 上海瑞家信息技术有限公司 Test method, test device, electronic equipment and computer readable medium
CN113485918A (en) * 2021-06-30 2021-10-08 中国民航信息网络股份有限公司 Test method, test device, electronic equipment and storage medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115934575A (en) * 2023-03-10 2023-04-07 北京全路通信信号研究设计院集团有限公司 Product testing method, device, equipment and storage medium
CN116028377A (en) * 2023-03-28 2023-04-28 之江实验室 Automatic test method, device and medium based on jenkins
CN116028377B (en) * 2023-03-28 2023-08-11 之江实验室 Automatic test method, device and medium based on jenkins
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

Also Published As

Publication number Publication date
CN113485918A (en) 2021-10-08

Similar Documents

Publication Publication Date Title
WO2023273561A1 (en) Test method and apparatus, electronic device, and storage medium
CN111625473B (en) Interface test case generation method and device, storage medium and electronic equipment
US20160127201A1 (en) Service Assurance Platform as a User-Defined Service
CN111209202A (en) Terminal application testing method and device
KR20150132155A (en) Diagnostics storage within a multi-tenant data center
CN112988494A (en) Abnormity testing method and device and electronic device
WO2021139379A1 (en) Activity configuration method and apparatus, readable medium and electronic device
CN112015654A (en) Method and apparatus for testing
WO2021120544A1 (en) Method and apparatus for debugging device
US8893091B2 (en) Running an executable during a debug session
CN113765733A (en) Bus network testing method and device
CN116662193A (en) Page testing method and device
CN116450511A (en) Information updating method, device, electronic equipment and computer readable medium
CN114443480A (en) Test method, test system, readable medium and electronic device
CN110750424B (en) Resource inspection method and device
CN114116480A (en) Method, device, medium and equipment for determining application program test coverage rate
CN113434382A (en) Database performance monitoring method and device, electronic equipment and computer readable medium
CN111930446A (en) Information processing method, device, terminal equipment and medium
CN110022244B (en) Method and apparatus for transmitting information
CN115237816B (en) System function verification method and device, electronic equipment and readable storage medium
CN115562959A (en) Method and device for verifying branch prediction function, electronic equipment and storage medium
CN116306409B (en) Chip verification method, device, equipment and storage medium
CN116795727B (en) Reproduction method and device of test process, electronic equipment and storage medium
US9769173B1 (en) System, method, and computer program for allowing users access to information from a plurality of external systems utilizing a user interface
CN114968693A (en) Performance test method and device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22831390

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE