CN112765038A - Distributed cluster software testing method, device, equipment and storage medium - Google Patents

Distributed cluster software testing method, device, equipment and storage medium Download PDF

Info

Publication number
CN112765038A
CN112765038A CN202110128367.1A CN202110128367A CN112765038A CN 112765038 A CN112765038 A CN 112765038A CN 202110128367 A CN202110128367 A CN 202110128367A CN 112765038 A CN112765038 A CN 112765038A
Authority
CN
China
Prior art keywords
software
test
document
jenkins
testing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110128367.1A
Other languages
Chinese (zh)
Other versions
CN112765038B (en
Inventor
郭彦辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Udsafe Technology Co ltd
Original Assignee
Beijing Udsafe Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Udsafe Technology Co ltd filed Critical Beijing Udsafe Technology Co ltd
Priority to CN202110128367.1A priority Critical patent/CN112765038B/en
Publication of CN112765038A publication Critical patent/CN112765038A/en
Application granted granted Critical
Publication of CN112765038B publication Critical patent/CN112765038B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/3696Methods or tools to render software testable

Landscapes

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

Abstract

The invention discloses a method, a device, equipment and a storage medium for testing distributed cluster software. The method comprises the following steps: carrying out user identity authentication according to an authentication token in an interface test document, and triggering a test function of the distributed cluster software through a trigger constructed in a configuration file of a continuous integration tool Jenkins after the user identity authentication is passed; installing software to be tested on a distributed system by calling commands in a target command line on Jenkins, and determining a test document required by testing the software to be tested; and testing the software to be tested installed and deployed in the distributed system according to the determined test document. By using the method, the software to be tested is installed on the distributed system by calling the command in the target command line on Jenkins, so that the automatic installation and deployment of the software can be realized, the test function of the distributed cluster software is triggered by the trigger, the manual trigger can be avoided, the manpower is greatly saved, and the test efficiency is greatly improved.

Description

Distributed cluster software testing method, device, equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of distributed clusters, in particular to a method, a device, equipment and a storage medium for testing distributed cluster software.
Background
As distributed clusters become more widely used, continuous integration testing of distributed clusters is more and more demanding when performing software testing. Most of the existing continuous integration technologies are only single interface testing, testing can be started only after manual triggering is needed, environment deployment before testing can be completed only after manual intervention is needed, and in addition, testing results can be only displayed singly after testing is completed.
Therefore, how to effectively improve the testing efficiency of the distributed cluster software is a technical problem to be solved urgently at present.
Disclosure of Invention
The embodiment of the invention provides a method, a device, equipment and a storage medium for testing distributed cluster software.
In a first aspect, an embodiment of the present invention provides a method for testing distributed cluster software, including:
carrying out user identity authentication according to an authentication token in the interface test case, and triggering a test function of the distributed cluster software through a trigger constructed in a configuration file of a continuous integration tool Jenkins after the user identity authentication is passed;
installing software to be tested on a distributed system by calling commands in a target command line on Jenkins, and determining a test document required by testing the software to be tested;
and testing the software to be tested installed and deployed in the distributed system according to the determined test document.
In a second aspect, an embodiment of the present invention further provides a device for testing distributed cluster software, including:
the trigger module is used for carrying out user identity authentication according to an authentication token in the interface test case, and triggering the test function of the distributed cluster software through a trigger constructed in a configuration file of a continuous integration tool Jenkins after the user identity authentication is passed;
the determining module is used for installing software to be tested on a distributed system by calling the command in the target command line on Jenkins and determining a test document required by testing the software to be tested;
and the test module is used for testing the software to be tested which is installed and deployed in the distributed system according to the determined test document.
In a third aspect, an embodiment of the present invention further provides a computer device, including:
one or more processors;
storage means for storing one or more programs;
the one or more programs are executed by the one or more processors, so that the one or more processors are used for executing the testing method of the distributed cluster software in any embodiment of the invention.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the testing method for distributed cluster software provided in any embodiment of the present invention.
The embodiment of the invention provides a testing method, a testing device and a testing storage medium of distributed cluster software, wherein user identity verification is firstly carried out according to a verification token in an interface test case, and after the user identity verification is passed, a testing function of the distributed cluster software is triggered through a trigger constructed in a configuration file of a continuous integration tool Jenkins; then, by calling the command in the target command line on Jenkins, installing software to be tested on a distributed system, and determining a test document required by testing the software to be tested; and finally, testing the software to be tested installed and deployed in the distributed system according to the determined test document. According to the technical scheme, the software to be tested is installed on the distributed system by calling the command in the target command line on Jenkins, automatic installation and deployment of the software can be achieved, manual triggering can be avoided by triggering the testing function of the distributed cluster software through the trigger, manpower is greatly saved, and testing efficiency is improved.
Drawings
Fig. 1 is a schematic flowchart of a testing method for distributed cluster software according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating an implementation of test configuration in a distributed cluster software testing method according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of a testing method for distributed cluster software according to a second embodiment of the present invention;
fig. 4 is a schematic structural diagram of a testing apparatus for distributed cluster software according to a third embodiment of the present invention;
fig. 5 is a schematic structural diagram of a computer device according to a fourth embodiment of the present invention.
Detailed Description
Embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present invention are shown in the drawings, it should be understood that the present invention may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and the embodiments of the present invention are illustrative only and are not intended to limit the scope of the present invention.
It should be understood that the various steps recited in the method embodiments of the present invention may be performed in a different order and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the invention is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "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 additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present invention are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in the present invention are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that reference to "one or more" unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present invention are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
Example one
In general, most of the use scenes of continuous integration are that the construction of the continuous integration is triggered after a new version is developed, and a corresponding product installation package is generated after the continuous integration. Developers need to perform internal testing on newly released products before they are used by the user. Before internal testing, a product needs to be installed and deployed on a computer of a developer to complete subsequent internal testing, but in the prior art, automatic installation and deployment of a software installation package are lacked, and corresponding interface testing is also lacked. At present, when a tester performs interface testing, a testing tool such as a jmeter and a postman is usually used for performing interface testing, and the testing method can only start to perform interface testing in a manual triggering mode. Based on the above problems, the invention provides a testing method of distributed cluster software, which can effectively improve the testing efficiency.
Fig. 1 is a flowchart of a testing method for distributed cluster software, which is applicable to internal testing of a new version of a distributed integrated software product and can be executed by a testing apparatus for distributed cluster software, where the apparatus can be implemented by software and/or hardware and is generally integrated on a computer device. It should be noted that the computer device may be a computer device of a developer.
As shown in fig. 1, a method for testing distributed cluster software provided in an embodiment of the present invention includes the following steps:
s110, user identity authentication is carried out according to an authentication token in the interface test case, and after the user identity authentication is passed, a test function of the distributed cluster software is triggered through a trigger constructed in a configuration file of a continuous integration tool Jenkins.
In this embodiment, the interface test case may be written in advance on the webpage request simulation tool postman according to an interface document, the interface test case may be used to test an interface of the distributed cluster software, and the interface test document may include a plurality of interface test cases.
The verification token can be understood as a verification password used for verifying the identity information of the user, and can be a verification token which is filled in the Headers of the postman in advance according to the interface document; jenkins can be a continuous integration tool used for monitoring continuous and repeated work; the trigger can be a trigger constructed in a configuration file of Jenkins, the trigger can be used for triggering a test function of the distributed cluster software, and the trigger automatically triggers the test function to test an interface of the distributed cluster software according to trigger time on a schedule filled in the configuration file of Jenkins in advance.
For example, when testing the distributed cluster software, a user needs to perform authentication, that is, user authentication may be performed through an authentication token, and authentication is performed if the user name and the password are consistent. After the verification is successful, the trigger can trigger the test function of the distributed cluster software according to the trigger time in the schedule.
And S120, installing software to be tested on a distributed system by calling the command in the target command line on Jenkins, and determining a test document required by testing the software to be tested.
In this embodiment, the target command line may be a shell command line, and the software to be tested may be automatically installed and deployed in each node of the distributed system according to the software installation and deployment command in the target command line. The software to be tested can be distributed cluster software to be tested.
The test document may include an interface test case document and an environment variable document, the environment variable document may include a plurality of environment variables, and the environment variables may be variables characterizing the current test environment. It can be understood that the interface test case document and the environment variable document need to be used together to test the file to be tested.
The mode for determining the test document required by the software to be tested can be that the interface test case document required by the current test can be determined according to the test interface document calling command in the target command line; and determining the environment variable document required to be used by the current test according to the call environment variable document command in the target command line.
And S130, testing the software to be tested installed and deployed in the distributed system according to the determined test document.
In this embodiment, after determining the test document required for the test of the software to be tested, the software to be tested may be further tested according to the interface test case document and the environment variable document in the test document.
Specifically, the determined test document may include an interface test case document and an environment variable document, the interface test case document may include a plurality of interface test cases, and different interfaces may be tested according to different interface test cases. The interface test case needs to call the corresponding environment variable to execute the interface test.
The embodiment of the invention provides a testing method of distributed cluster software, which comprises the steps of firstly carrying out user identity verification according to a verification token in an interface test case, and triggering a testing function of the distributed cluster software through a trigger constructed in a configuration file of a continuous integration tool Jenkins after the user identity verification is passed; then, by calling the command in the target command line on Jenkins, installing software to be tested on a distributed system, and determining a test document required by testing the software to be tested; and finally testing the software to be tested installed and deployed in the distributed system according to the determined test document. By using the method, the software products to be tested can be automatically installed and deployed in each server of the distributed system within the set time, and the interface test of the software to be tested is automatically triggered, so that the efficiency of continuous integration is effectively improved, the labor is saved, and the test efficiency is improved.
Further, the step of configuring the test configuration on Jenkins includes: configuring a trigger to construct and obtain the trigger time of the interface test; configuring an execution command to construct a target command line; configuring a notifier to construct a message notifier; configuring corresponding description content; based on the trigger time, the target command line, the message notifier, and the description content, an integrated configuration file is integrated on the Jenkins.
The configuration trigger construction can be to fill a schedule on Jenkins, the schedule can record the time when a test needs to be triggered and the time when a test report is sent to the message notifier, and the configuration trigger construction can be to trigger the test three times a week, perform the test at 10 points every day, send the test report to the message notifier every week, and the like. The schedule can be filled in according to specific needs, and is not limited herein.
The configuration execution command can be a command for filling and writing software installation and deployment, a command for calling interface test case documents, a command for calling environment variable documents and a command for testing report output format in a target command line of Jenkins.
The configuration notifier can be a message notifier added on Jenkins, a Jenkins URL configured, a notifier verification token access token and the like.
The configuring of the corresponding description content may include filling out a collection name of the interface test case, a message notifier name, and the like on Jenkins.
For example, fig. 2 is a flowchart illustrating implementation of test configuration in a distributed cluster software testing method according to an embodiment of the present invention, before testing software to be tested, the test configuration may be performed according to the following steps, and after the configuration is completed, the software to be tested may be tested.
S1, firstly, writing interface test cases on postman according to the interface documents.
When writing an interface test case, a precondition needs to be filled in the Pre-request Script, request verification is filled in the Tests, and verification Token such as Token is filled in the Headers. It should be noted that, when the interface test case is written, the corresponding environment variable is also written.
And S2, exporting the interface test case document and the environment variable document.
The interface test case document comprises a plurality of interface test cases, and the environment variable document comprises a plurality of environment variables. The interface test case document and the environment variable document are exported to a storage position, and the interface test case in the interface test case document and the environment variable in the environment variable document can be called through a storage path Jenkins.
And S3, configuring the description information in the configuration file of Jenkins.
The configuration description information may include a name of a test case filled in the configuration file, a name of a message notifier, and the like.
S4, configuring the construction trigger in the configuration file of Jenkins.
Configuring the building trigger may include filling a calendar in a configuration file of Jenkins, where the time for triggering the test and the time for sending the test report are recorded in the calendar.
S5, configuring a construction execution command in the configuration file of Jenkins.
The configuration, construction and execution command may include a shell command line, that is, a target command line, which may include a software installation and deployment command, an interface test case document command, an environment variable document calling command, a test report output format command, and the like.
S6, configuring the construction notifier in the configuration file of Jenkins.
The configuration construction notifier can comprise the addition of the notifier in a configuration file of Jenkins, and the configuration content can comprise Jenkins URLs and access tokens of notifier nails, namely notifier verification tokens.
Example two
Fig. 3 is a schematic flowchart of a testing method for distributed cluster software according to a second embodiment of the present invention, where the second embodiment performs optimization based on the foregoing embodiments. In this embodiment, a software to be tested is installed on a distributed system by calling a command in a target command line on Jenkins, and a test document required for testing the software to be tested is determined, which is further embodied as: installing and deploying the software to be tested in each server of the distributed system by calling a software installation and deployment command of a target command line on Jenkins; exporting an interface test case document corresponding to the software to be tested through a test interface document calling command in a target command line on Jenkins, wherein the interface test case document is a document which is compiled on a webpage request simulation tool postman and comprises at least one interface test case; exporting an environment variable document corresponding to the software to be tested through a call environment variable document command in a target command line on Jenkins, wherein the environment variable document is a document composed of at least one environment variable compiled on postman; and determining the interface test case document and the environment variable document as the test document of the software to be tested.
Further, this embodiment further optimizes the test method of the distributed cluster software, specifically: after the testing the software to be tested installed and deployed in the distributed system according to the determined test document, the method further includes: outputting a test result to the message notifier through a target format according to the test report output format command; and the message notifier sends the test result to an administrator so that the administrator positions a problem interface according to the problem link included in the test result.
As shown in fig. 2, a method for testing distributed cluster software provided in the second embodiment of the present invention includes the following steps:
s210, user identity authentication is carried out according to an authentication token in the interface test case, and after the user identity authentication is passed, a test function of the distributed cluster software is triggered through a trigger constructed in a configuration file of a continuous integration tool Jenkins.
And S220, installing and deploying the software to be tested in each server of the distributed system by calling a software installation and deployment command of the target command line on Jenkins.
The software to be tested can be automatically installed in each server of the distributed system according to the software installation and deployment command filled in the shell command line on the Jenkins configuration file.
And S230, exporting an interface test case document corresponding to the software to be tested through a test interface document calling command in a target command line on Jenkins, wherein the interface test case document is a document which is compiled on a webpage request simulation tool postman and comprises at least one interface test case.
Specifically, the stored interface test cases can be exported according to the storage path of the interface test case document in the call test interface document command filled in the shell command line on the Jenkins configuration file.
Further, the step of forming the interface test case includes: obtaining the verification token filled in the request Headers of postman; acquiring preconditions filled in a pre-request code of postman; acquiring request verification filled in test sections Tests of postman; and generating an interface test case based on the verification token, the precondition and the request verification.
In this embodiment, writing an interface test case on postman requires filling a verification Token, i.e., verification Token, in request Headers of postman, filling preconditions in Pre-request code Pre-request Script of postman, and filling request verification in test segments of postman. The authentication token may be a string of characters, and the preconditions may include creating a new user, deleting all users, editing a specific user, and the like.
S240, exporting an environment variable document corresponding to the software to be tested through a call environment variable document command in a target command line on Jenkins, wherein the environment variable document is a document composed of at least one environment variable written on postman.
Specifically, the stored environment variable document can be exported according to the storage path of the environment variable document in the call environment variable document command filled in the shell command line on the Jenkins configuration file.
The environment variable document can comprise a plurality of environment variables, the environment variables correspond to the test case interfaces, and the environment variables can be written on postman in advance to form the environment variable document.
S250, determining the interface test case document and the environment variable document as the test document of the software to be tested.
And S260, testing the software to be tested installed and deployed in the distributed system according to the determined test document.
The interface test case included in the interface test case document derived according to the steps can test the software to be tested by calling the environment variable included in the derived environment variable document.
For example, the process of testing according to an interface test case of a creating user may include: verifying the user identity according to the verification token filled in the heads, wherein the filled precondition can be that all users are deleted, a request for creating the user can be sent after a pre-request code is executed, a response with successful creation is returned, and whether the request verification in Tests is consistent with the response or not is finally determined. For example, if the status code in Tests is 200 and the status code of response is 100, the token is not verified.
And S270, outputting the test report to the message notifier in a target format according to the test report output format command.
Specifically, the test result can be formed into a test report with a target format according to a test report output format command filled in a shell command line on the Jenkins configuration file, and the test report is output to the message notifier.
The message notifier can be any tool with a message notification function, and can be, for example, a nail, a WeChat and a mailbox. The test results may be sent to a nail cluster, a WeChat cluster, a user mailbox, and the like. It should be noted that the test result needs to be sent to the corresponding message notifier according to the name of the nail group, the name of the WeChat group or the name of the user mailbox.
In this embodiment, the test report may be sent to the message notifier according to the time timing recorded in the schedule in the trigger.
Further, configuring the notifier to construct the message notifier may include: acquiring Jenkins URL configured in the configuration file of Jenkins; acquiring a notifier verification token added in the configuration file of Jenkins; and constructing a message notifier based on the notifier verification token and the jenkins URL.
The notifier can be verified according to the notifier verification token added in the configuration file of Jenkins, and the construction of the message notifier can be triggered according to Jenkins URL configured in the configuration file of Jenkins after verification is passed.
S280, the message notifier sends the test report to a tester so that the tester can position a problem interface according to the problem link included in the test report.
In this embodiment, the test result is formed into a test report, and the test report is sent to the tester through the message notifier, so that the tester can directly position the problem interface according to the problem link in the test report.
Further, configuring the execution command to construct the target command line includes: acquiring a software installation and deployment command filled in a command line of the Jenkins configuration file; acquiring a call interface test case document command filled in the command line; acquiring a call environment variable document command filled in the command line; acquiring a test report output format command filled in the command line; and forming a target command line based on the software installation and deployment command, the call interface test case document command, the call environment variable document command and the test report output format command.
The second testing method for distributed cluster software provided by the embodiment of the invention can automatically install and deploy the software to be tested on each node of the distributed system; after the interface sends the change, the interface can be tested according to the updated interface test case document only by updating and submitting the interface test case document when the interface is tested next time; after the interface test is finished, a test report can be automatically generated, and a problem interface can be found visually according to the test report, so that a tester can track and feed back the problem interface in time; and sending a test report to the message notifier at regular time according to the trigger time of the trigger, and monitoring the test condition according to the test report.
EXAMPLE III
Fig. 4 is a schematic structural diagram of a testing apparatus for distributed cluster software according to a third embodiment of the present invention, which may be suitable for performing internal testing on a new version of distributed integrated software product, where the apparatus may be implemented by software and/or hardware and is generally integrated on a computer device.
As shown in fig. 4, the apparatus includes: a triggering module 410, a determining module 420, and a testing module 430.
The trigger module 410 is used for performing user identity authentication according to an authentication token in the interface test case, and after the user identity authentication passes, triggering a test function of the distributed cluster software through a trigger constructed in a configuration file of a continuous integration tool Jenkins;
a determining module 420, configured to install software to be tested on a distributed system by calling a command in a target command line on Jenkins, and determine a test document required for performing a test on the software to be tested;
and the test module 430 is configured to test the software to be tested installed and deployed in the distributed system according to the determined test document.
In this embodiment, the device firstly performs user identity authentication according to an authentication token in an interface test case through a trigger module, and after the user identity authentication passes, triggers a test function of distributed cluster software through a trigger constructed in a configuration file of a continuous integration tool Jenkins; then, a determining module is used for calling a command in a target command line on Jenkins, installing software to be tested on a distributed system, and determining a test document required by testing the software to be tested; and finally, testing the software to be tested installed and deployed in the distributed system through the testing module according to the determined testing document.
The embodiment provides a testing device for distributed cluster software, the device installs software to be tested on a distributed system by calling commands in a target command line on Jenkins, automatic installation and deployment of the software can be realized, manual triggering can be avoided by triggering a testing function of the distributed cluster software through a trigger, manpower is greatly saved, and testing efficiency is improved.
Further, the determining module 420 is specifically configured to: installing and deploying the software to be tested in each server of the distributed system by calling a software installation and deployment command of a target command line on Jenkins; exporting an interface test case document corresponding to the software to be tested through a test interface document calling command in a target command line on Jenkins, wherein the interface test case document is a document which is compiled on a webpage request simulation tool postman and comprises at least one interface test case; exporting an environment variable document corresponding to the software to be tested through a call environment variable document command in a target command line on Jenkins, wherein the environment variable document is a document composed of at least one environment variable compiled on postman; and determining the interface test case document and the environment variable document as the test document of the software to be tested.
Further, the step of forming the interface test case includes: obtaining an authentication token filled in request Headers of the postman; obtaining preconditions filled in the pre-request code of postman; acquiring request verification filled in test sections of the postman; and generating an interface test case based on the verification token, the precondition and the request verification.
Further, the configuration module is configured to: configuring a trigger to construct and obtain the trigger time of the interface test; configuring an execution command to construct a target command line; configuring a notifier to construct a message notifier; configuring corresponding description content; based on the trigger time, the target command line, the message notifier, and the description content, an integrated configuration file is integrated on the Jenkins.
Further, the configuration module comprises a target command line construction unit, wherein the target command line construction unit is used for acquiring a software installation and deployment command filled in a command line of the Jenkins configuration file; acquiring a call interface test case document command filled in the command line; acquiring a call environment variable document command filled in the command line; acquiring a test report output format command filled in the command line; and forming a target command line based on the software installation and deployment command, the call interface test case document command, the call environment variable document command and the test report output format command.
Further, the configuration module comprises a construction message notifier unit, and the construction message notifier unit is used for acquiring Jenkins URL configured in the Jenkins configuration file; acquiring a notifier verification token added in the configuration file of Jenkins; and constructing a message notifier based on the notifier verification token and the jenkins URL.
Further, the test report output module is used for outputting the test report to the message notifier in a target format according to the test report output format command; and the message notifier sends the test report to a tester so that the tester positions a problem interface according to the problem link included in the test report.
The testing device of the distributed cluster software can execute the testing device method of the distributed cluster software provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
Example four
Fig. 5 is a schematic structural diagram of a computer device according to a fourth embodiment of the present invention. As shown in fig. 5, a computer device provided in the fourth embodiment of the present invention includes: one or more processors 51 and storage 52; the processor 51 in the computer device may be one or more, and fig. 5 illustrates one processor 51 as an example; storage 52 is used to store one or more programs; the one or more programs are executed by the one or more processors 51, so that the one or more processors 51 implement the method for testing distributed cluster software according to any one of the embodiments of the present invention.
The computer device may further include: an input device 53 and an output device 54.
The processor 51, the storage means 52, the input means 53 and the output means 54 in the computer apparatus may be connected by a bus or other means, which is exemplified in fig. 5.
The storage device 52 in the computer apparatus is used as a computer-readable storage medium for storing one or more programs, which may be software programs, computer-executable programs, and modules, and the program instructions/modules corresponding to the testing method of the distributed cluster software according to one or two embodiments of the present invention (for example, the modules in the testing device of the distributed cluster software shown in fig. 4 include the triggering module 410, the determining module 420, and the testing module 430). The processor 51 executes various functional applications and data processing of the computer device by running software programs, instructions and modules stored in the storage device 52, that is, implements the testing method of the distributed cluster software in the above method embodiment.
The storage device 52 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to use of the computer device, and the like. Further, the storage 52 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, the storage 52 may further include memory located remotely from the processor 51, which may be connected to the device over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 53 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function controls of the computer apparatus. The output device 54 may include a display device such as a display screen.
And, when one or more programs included in the above-mentioned computer apparatus are executed by the one or more processors 51, the programs perform the following operations:
carrying out user identity authentication according to an authentication token in the interface test case, and triggering a test function of the distributed cluster software through a trigger constructed in a configuration file of a continuous integration tool Jenkins after the user identity authentication is passed;
installing software to be tested on a distributed system by calling commands in a target command line on Jenkins, and determining a test document required by testing the software to be tested;
and testing the software to be tested installed and deployed in the distributed system according to the determined test document.
EXAMPLE five
An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program is used, when executed by a processor, to execute a method for testing distributed cluster software, and the method includes:
carrying out user identity authentication according to an authentication token in the interface test case, and triggering a test function of the distributed cluster software through a trigger constructed in a configuration file of a continuous integration tool Jenkins after the user identity authentication is passed;
installing software to be tested on a distributed system by calling commands in a target command line on Jenkins, and determining a test document required by testing the software to be tested;
and testing the software to be tested installed and deployed in the distributed system according to the determined test document.
Optionally, the program, when executed by the processor, may be further configured to execute a method for testing distributed cluster software provided in any embodiment of the present invention.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a Read Only Memory (ROM), an Erasable Programmable Read Only Memory (EPROM), a flash Memory, an optical fiber, a portable CD-ROM, an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. A computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take a variety of forms, including, but not limited to: an electromagnetic signal, an optical signal, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, Radio Frequency (RF), etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming 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 the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A testing method of distributed cluster software is characterized by comprising the following steps:
carrying out user identity authentication according to an authentication token in the interface test case, and triggering a test function of the distributed cluster software through a trigger constructed in a configuration file of a continuous integration tool Jenkins after the user identity authentication is passed;
installing software to be tested on a distributed system by calling commands in a target command line on Jenkins, and determining a test document required by testing the software to be tested;
and testing the software to be tested installed and deployed in the distributed system according to the determined test document.
2. The method of claim 1, wherein the installing software under test on a distributed system by invoking commands in a target command line on the Jenkins and determining test documents required for testing the software under test comprises:
installing and deploying the software to be tested in each server of the distributed system by calling a software installation and deployment command of a target command line on Jenkins;
exporting an interface test case document corresponding to the software to be tested through a test interface document calling command in a target command line on Jenkins, wherein the interface test case document is a document which is compiled on a webpage request simulation tool postman and comprises at least one interface test case;
exporting an environment variable document corresponding to the software to be tested through a call environment variable document command in a target command line on Jenkins, wherein the environment variable document is a document composed of at least one environment variable compiled on postman;
and determining the interface test case document and the environment variable document as the test document of the software to be tested.
3. The method of claim 1, wherein the step of forming the interface test case comprises:
obtaining an authentication token filled in request Headers of the postman;
obtaining preconditions filled in the pre-request code of postman;
acquiring request verification filled in test sections of the postman;
and generating an interface test case based on the verification token, the precondition and the request verification.
4. The method of claim 1, wherein the step of configuring the test configuration on the Jenkins comprises:
configuring a trigger to construct and obtain the trigger time of the interface test;
configuring an execution command to construct a target command line;
configuring a notifier to construct a message notifier;
configuring corresponding description content;
based on the trigger time, the target command line, the message notifier, and the description content, an integrated configuration file is integrated on the Jenkins.
5. The method of claim 4, wherein configuring the execution command to construct the target command line comprises:
acquiring a software installation and deployment command filled in a command line of the Jenkins configuration file;
acquiring a call interface test case document command filled in the command line;
acquiring a call environment variable document command filled in the command line;
acquiring a test report output format command filled in the command line;
and forming a target command line based on the software installation and deployment command, the call interface test case document command, the call environment variable document command and the test report output format command.
6. The method of claim 4, wherein the configuration notifier constructs a message notifier comprising:
acquiring Jenkins URL configured in the configuration file of Jenkins;
acquiring a notifier verification token added in the configuration file of Jenkins;
and constructing a message notifier based on the notifier verification token and the jenkins URL.
7. The method of claim 1, after the testing the installation of the software under test deployed in the distributed system according to the determined test document, further comprising:
outputting a test report to the message notifier in a target format according to the test report output format command;
and the message notifier sends the test report to a tester so that the tester positions a problem interface according to the problem link included in the test report.
8. A testing device for distributed cluster software is characterized by comprising:
the trigger module is used for carrying out user identity authentication according to an authentication token in the interface test case, and triggering the test function of the distributed cluster software through a trigger constructed in a configuration file of a continuous integration tool Jenkins after the user identity authentication is passed;
the determining module is used for installing software to be tested on a distributed system by calling the command in the target command line on Jenkins and determining a test document required by testing the software to be tested;
and the test module is used for testing the software to be tested which is installed and deployed in the distributed system according to the determined test document.
9. A computer device, comprising:
one or more processors;
storage means for storing one or more programs;
the one or more programs being executable by the one or more processors to cause the one or more processors to perform a method of testing distributed cluster software according to any one of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out a method for testing distributed cluster software according to any one of claims 1 to 7.
CN202110128367.1A 2021-01-29 2021-01-29 Distributed cluster software testing method, device, equipment and storage medium Active CN112765038B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110128367.1A CN112765038B (en) 2021-01-29 2021-01-29 Distributed cluster software testing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110128367.1A CN112765038B (en) 2021-01-29 2021-01-29 Distributed cluster software testing method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112765038A true CN112765038A (en) 2021-05-07
CN112765038B CN112765038B (en) 2024-02-02

Family

ID=75703916

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110128367.1A Active CN112765038B (en) 2021-01-29 2021-01-29 Distributed cluster software testing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112765038B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115438805A (en) * 2022-11-08 2022-12-06 江苏智云天工科技有限公司 Product defect detection method based on machine learning model in industrial quality inspection field

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10534701B1 (en) * 2019-06-17 2020-01-14 Capital One Services, Llc API driven continuous testing systems for testing disparate software
CN111240989A (en) * 2020-01-17 2020-06-05 众能联合数字技术有限公司 Interface automation test framework and method
CN111897721A (en) * 2020-07-14 2020-11-06 重庆长安汽车股份有限公司 Automatic test method of API interface and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10534701B1 (en) * 2019-06-17 2020-01-14 Capital One Services, Llc API driven continuous testing systems for testing disparate software
CN111240989A (en) * 2020-01-17 2020-06-05 众能联合数字技术有限公司 Interface automation test framework and method
CN111897721A (en) * 2020-07-14 2020-11-06 重庆长安汽车股份有限公司 Automatic test method of API interface and storage medium

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
ABHINAV ASTHANA: "How to write automated tests for APIs using Postman – Part 1", HTTPS://BLOG.POSTMAN.COM/WRITING-AUTOMATED-TESTS-FOR-APIS-USING-POSTMAN/ *
CHANGYIXUE: "用postman做接口测试实例", HTTPS://BLOG.CSDN.NET/CHANGYIXUE/ARTICLE/DETAILS/89496518 *
ERDONG: "使用jenkins自动化打包部署Vue项目。详细教程。", HTTPS://JUEJIN.CN/POST/6844903870313791501, pages 1 - 9 *
WUST_LH: "Postman+Newman+jenkins实现自动化测试", HTTPS://BLOG.CSDN.NET/WUST_LH/ARTICLE/DETAILS/86512058, pages 1 - 8 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115438805A (en) * 2022-11-08 2022-12-06 江苏智云天工科技有限公司 Product defect detection method based on machine learning model in industrial quality inspection field

Also Published As

Publication number Publication date
CN112765038B (en) 2024-02-02

Similar Documents

Publication Publication Date Title
CN108108297B (en) Method and device for automatic testing
CN111159049B (en) Automatic interface testing method and system
CN107896244B (en) Version file distribution method, client and server
CN109871499A (en) Page loading method and client
CN109683892B (en) Page display method and device, computer equipment and storage medium
CN109391673A (en) A kind of method, system and the terminal device of management update file
CN107276842B (en) Interface test method and device and electronic equipment
CN110750415B (en) Interface service configuration method, device, medium and computer equipment
CN111400125A (en) Memory overflow monitoring method, device, equipment and storage medium of JAVA process
CN112631919A (en) Comparison test method and device, computer equipment and storage medium
CN112306471A (en) Task scheduling method and device
CN116257438A (en) Updating method of interface test case and related equipment
CN112765038B (en) Distributed cluster software testing method, device, equipment and storage medium
CN110795353A (en) Debugging method, device and equipment for fast application and storage medium
CN115996179A (en) Service node testing method and device, readable medium and electronic equipment
CN114546837A (en) Interface test method, device, equipment and storage medium
CN109388420A (en) Application upgrade test method, device, computer equipment and storage medium
CN115129574A (en) Code testing method and device
CN111104331A (en) Software management method, terminal device and computer-readable storage medium
CN105302731A (en) Testing system and method for upgrading website configuration
CN110874316B (en) Method, device and system for scanning codes
CN112433938A (en) Method and device for testing application of mobile terminal
CN115914055A (en) Distributed network testing method, device, medium and equipment
CN111767230A (en) Web performance testing method and device, electronic equipment and storage medium
CN116302045A (en) Information application system online method and device, storage medium and configuration server

Legal Events

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