CN112765038B - 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
CN112765038B
CN112765038B CN202110128367.1A CN202110128367A CN112765038B CN 112765038 B CN112765038 B CN 112765038B CN 202110128367 A CN202110128367 A CN 202110128367A CN 112765038 B CN112765038 B CN 112765038B
Authority
CN
China
Prior art keywords
software
test
document
jenkins
command
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110128367.1A
Other languages
Chinese (zh)
Other versions
CN112765038A (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 LIANCHUANG XINAN TECHNOLOGY CO LTD
Original Assignee
BEIJING LIANCHUANG XINAN 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 LIANCHUANG XINAN TECHNOLOGY CO LTD filed Critical BEIJING LIANCHUANG XINAN 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

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: user identity verification is carried out according to a verification token in an interface test document, and after the user identity verification is passed, a trigger constructed in a configuration file of a continuous integration tool Jenkins triggers a test function of distributed cluster software; installing software to be tested on a distributed system by calling a command in a target command line on the 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 manual triggering can be avoided by triggering the test function of the distributed cluster software through the trigger, the manpower is greatly saved, and the test efficiency is 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
With the wider and wider use of distributed clusters, the continuous integration test requirements on the distributed clusters are higher and higher when software testing is performed. The existing continuous integration technology is mostly only used for single interface test, and the test can be started only after manual triggering, the environmental deployment before the test can be completed only through human intervention, and in addition, the test result can only be displayed singly after the test is completed.
Therefore, how to effectively improve the testing efficiency of the distributed cluster software is a technical problem to be solved currently.
Disclosure of Invention
The embodiment of the invention provides a method, a device, equipment and a storage medium for testing distributed cluster software, which can install software to be tested on a distributed system by calling a command in a target command line on Jenkins, can realize automatic installation and deployment of the software, can avoid manual triggering by triggering a testing function of the distributed cluster software through a trigger, and greatly saves manpower and improves testing efficiency.
In a first aspect, an embodiment of the present invention provides a method for testing distributed cluster software, including:
user identity verification is carried out according to a verification token in the interface test case, and after the user identity verification is passed, a trigger constructed in a configuration file of a continuous integration tool Jenkins triggers a test function of distributed cluster software;
installing software to be tested on a distributed system by calling a command in a target command line on the 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 testing device for distributed cluster software, including:
the triggering module is used for carrying out user identity verification according to the verification token in the interface test case, and triggering the test function of the distributed cluster software through a trigger constructed in the configuration file of the continuous integration tool Jenkins after the user identity verification is passed;
the determining module is used for installing software to be tested on the distributed system by calling the command in the target command line on the 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 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 apparatus, including:
one or more processors;
a storage means for storing one or more programs;
the one or more programs are executed by the one or more processors to cause the one or more processors to perform a method of testing distributed cluster software as described in any of the embodiments of the present invention.
In a fourth aspect, an embodiment of the present invention further provides a computer readable storage medium, where a computer program is stored, where the program when executed by a processor implements a method for testing distributed cluster software as provided in any embodiment of the present invention.
The embodiment of the invention provides a testing method, a device, equipment and a storage medium of distributed cluster software, which are characterized in that firstly, user identity verification is 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 by a trigger constructed in a configuration file of a continuous integration tool Jenkins; then, installing software to be tested on a distributed system by calling a command in a target command line on the Jenkins, 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 the Jenkins, so that automatic installation and deployment of the software can be realized, the manual triggering can be avoided by triggering the testing function of the distributed cluster software through the trigger, and the manpower is greatly saved, and the testing efficiency is improved.
Drawings
Fig. 1 is a flow chart of a testing method of distributed cluster software according to an embodiment of the invention;
FIG. 2 is a flowchart illustrating a test configuration in a distributed cluster software testing method according to an embodiment of the present invention;
fig. 3 is a flow chart of a testing method of distributed cluster software according to a second embodiment of the present invention;
fig. 4 is a schematic structural diagram of a testing device 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 the invention is susceptible of embodiment in the drawings, it is to be understood that the invention may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the invention are for illustration purposes 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. Furthermore, 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 "including" and variations thereof as used herein are intended to be 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. Related definitions of other terms will be given in the description below.
It should be noted that the terms "first," "second," and the like herein are merely used for distinguishing between different devices, modules, or units and not for limiting the order or interdependence of the functions performed by such devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those skilled in the art will appreciate that "one or more" is intended to be construed as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the devices in the embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of such messages or information.
Example 1
The use of continuous integration is mostly that the construction of continuous integration is triggered after new versions are developed, and corresponding product installation packages are generated after continuous integration. Before a product can be used by a user, a developer needs to perform internal testing on a newly released product. The product needs to be installed and deployed on the computer of the developer before the internal test is performed to complete the subsequent internal test, but the prior art lacks automatic installation and deployment of the software installation package and also lacks corresponding interface test. Currently, a tester usually uses a test tool such as jmeter, postman to perform interface test when performing interface test, and the above test method can only start to perform interface test in a manual triggering manner. Based on the problems, the invention provides a testing method of distributed cluster software, which can effectively improve the testing efficiency.
Fig. 1 is a flow chart of a testing method of distributed cluster software according to an embodiment of the present invention, where the method may be suitable for internal testing of a new version of distributed integrated software product, and the method may be performed by a testing device of distributed cluster software, where the device may 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 according to an embodiment of the present invention includes the following steps:
s110, user identity verification is carried out according to the verification token in the interface test case, and after the user identity verification is passed, a trigger constructed in a configuration file of the continuous integration tool Jenkins triggers a test function of the distributed cluster software.
In this embodiment, the interface test case may be written according to an interface document on a web page request simulation tool postman in advance, where 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 authentication token can be understood as an authentication password used for authenticating the identity information of the user, and can be filled in the request header Headers of postman in advance according to the interface document; jenkins may be a continuous integration tool for monitoring continuous 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 the interfaces of the distributed cluster software according to the triggering time on the schedule which is filled in the configuration file of Jenkins in advance.
The test user needs to perform identity verification when testing the distributed cluster software, namely user identity verification can be performed through the verification token, and if the user name and the password are consistent, the user identity verification is performed. After verification is successful, the trigger can trigger the test function of the distributed cluster software according to the trigger time in the schedule.
S120, installing software to be tested on the distributed system by calling a command in a target command line on the Jenkins, and determining a test document required for testing the software to be tested.
In this embodiment, the target command line may be a shell command line, and according to a software installation and deployment command in the target command line, the software to be tested may be automatically installed and deployed on each node of the distributed system. The software to be tested may be distributed cluster software to be tested.
The test document can comprise an interface test case document and an environment variable document, the environment variable document can comprise a plurality of environment variables, and the environment variables can be variables representing the current test environment. It can be appreciated that the interface test case document and the environment variable document need to be matched for use to test the file to be tested.
The mode of determining the test document required by the software to be tested can be that the interface test case document required to be used in the current test can be determined according to the call test interface document command in the target command line; the environment variable document required to be used for the current test can be determined according to the call environment variable document command in the target command line.
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 testing 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 environment variable corresponding to the interface test case to execute the interface test.
According to the testing method of the distributed cluster software provided by the embodiment of the invention, firstly, user identity verification is carried out according to the verification token in the interface test case, and after the user identity verification is passed, the testing function of the distributed cluster software is triggered by a trigger constructed in the configuration file of the continuous integration tool Jenkins; then, installing software to be tested on a distributed system by calling a command in a target command line on the Jenkins, 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 installation and deployment of the software product to be tested can be automatically carried out in each server of the distributed system within a specified time, the interface test of the software to be tested is automatically triggered, the continuous integration efficiency is effectively improved, the manpower is saved, and the test efficiency is improved.
Further, the configuring step of performing test configuration on the Jenkins includes: configuring a trigger to construct the triggering 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 descriptive contents; based on the trigger time, target command line, message notifier, and description content, the configuration file is regarded as being integrated on the Jenkins.
The configuration trigger may be constructed by filling a calendar on Jenkins, where the calendar may record the time required to trigger a test and the time to send a test report to the message notifier, and may, for example, trigger three times a week, perform a test at 10 points a day, send a test report to the message notifier every week, and so on. The calendar may be filled in according to specific needs, without limitation.
The configuration execution command may be a software installation and deployment command, an interface test case document calling command, an environment variable document calling command and a test report output format command filled in a Jenkins target command line.
The configuration notifier may be adding a message notifier to Jenkins, configuring Jenkins URL, verifying a token by the notifier, and the like.
The configuration corresponding description content can include filling in the set name of the interface test case, the name of the message notifier and the like on Jenkins.
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, where before testing a 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 an interface test case on postman according to an interface document.
When the interface test case is written, the preconditions are required to be filled in the Pre-request Script, the requests for verification are filled in the test, and the verification 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.
S2, exporting an interface test case document and an 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. And exporting the interface test case document and the environment variable document to a storage position, and calling the interface test case in the interface test case document and the environment variable in the environment variable document through a storage path Jenkins.
S3, configuring description information in the configuration file of Jenkins.
The configuration description information may include, among other things, the name of the test case, the name of the message notifier, etc. filled in the configuration file.
S4, configuring a construction trigger in the configuration file of Jenkins.
Wherein configuring the build trigger may include filling a calendar in a configuration file of Jenkins, the calendar having recorded therein a time to trigger the test and a time to send the test report.
S5, configuring and constructing an execution command in the configuration file of Jenkins.
The configuration building execution command may include a fill shell command line, that is, a target command line, and the shell command line may include a software installation deployment command, an interface test case document command, a call environment variable document command, a test report output format command, and the like.
S6, configuring and constructing a notifier in the configuration file of the Jenkins.
Wherein configuring the notifier may include adding the notifier in a configuration file of Jenkins, and configuration content may include a Jenkins URL and a notifier pinned access token, i.e., a notifier authentication token.
Example two
Fig. 3 is a flow chart of a testing method of distributed cluster software according to a second embodiment of the present invention, where the second embodiment optimizes the testing method based on the above embodiments. In this embodiment, the method includes installing the software to be tested on the distributed system by calling the command in the target command line on Jenkins, and determining the test document required for testing the software to be tested, which is further specified as: installing and deploying the software to be tested in each server of a distributed system by calling a software installation and deployment command of a target command line on the Jenkins; the interface test case document corresponding to the software to be tested is derived through a call test interface document command in a target command line on the Jenkins, wherein the interface test case document is written on a webpage request simulation tool postman and comprises at least one interface test case; the environment variable document corresponding to the software to be tested is derived through the call environment variable document command in the target command line on the Jenkins, wherein the environment variable document is a document composed of at least one environment variable written on the postman; and determining the interface test case document and the environment variable document as the test document of the software to be tested.
Furthermore, the method for testing the distributed cluster software is further optimized, and specifically: after the software to be tested installed and deployed in the distributed system is tested according to the determined test document, the method further comprises the following steps: 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 links and locates the problem interface according to the problems included in the test result.
As shown in fig. 2, a method for testing distributed cluster software according to a second embodiment of the present invention includes the following steps:
and S210, carrying out user authentication according to the authentication token in the interface test case, and triggering the test function of the distributed cluster software through a trigger constructed in the configuration file of the continuous integration tool Jenkins after the user authentication is passed.
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 a target command line on the 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.
S230, through a call test interface document command in a target command line on the Jenkins, an interface test case document corresponding to the software to be tested is derived, wherein the interface test case document is a document written 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 forming step of the interface test case includes: acquiring an authentication token filled in request header Headers of postman; acquiring preconditions filled in pre-request codes of postman; acquiring request verification filled in test section Tests of postman; and generating an interface test case based on the verification token, the preconditions and the request verification.
In this embodiment, an interface test case is written on the postman, the request header Headers of the postman needs to be filled with a verification Token, that is, a verification Token, the Pre-request code Pre-request Script of the postman needs to be filled with a precondition, and the test section test of the postman needs to be filled with a request verification, etc. Wherein the authentication token may be a string of characters and the preconditions may include creating new users, deleting all users, editing a particular user, etc.
S240, an environment variable document corresponding to the software to be tested is derived through an environment variable document calling command in a target command line on the Jenkins, wherein the environment variable document is a document composed of at least one environment variable written on the 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.
S260, testing the software to be tested installed and deployed in the distributed system according to the determined test document.
The interface test cases included in the interface test case document derived according to the above steps can test the software to be tested by calling the environment variables included in the derived environment variable document.
Illustratively, the process of testing according to a created user's interface test case may include: and verifying the identity of the user according to the verification token filled in the Headers, wherein the filled precondition can be that all users are deleted, a request for creating the user can be sent after the pre-request code is executed, a response for successful creation is returned, finally whether the request verification in the test is consistent with the response is determined, if so, the interface test of the user is successful, and the interface is available. Illustratively, if the status code in the test is 200 and the status code of the response is 100, the characterization is not verified.
S270, outputting the test report to the message notifier in a target format according to the test report output format command.
Specifically, according to the test report output format command filled in the shell command line on the Jenkins configuration file, the test result can be formed into a test report with a target format, and the test report is output to the message notifier.
The message notifier may be any tool with a message notification function, and exemplary, the message notifier may be a nail, a letter, and a mailbox. The test results may be sent to a spike group, a micro-letter group, 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 nail group name, the micro-letter group name or the user mailbox name.
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, the configuring the notifier to build the message notifier may include: obtaining Jenkins URL configured in the configuration file of the Jenkins; acquiring a notifier verification token added in the configuration file of the Jenkins; a message notifier is constructed based on the notifier authentication token and the jenkins URL.
The notifier verification token added in the configuration file of Jenkins can verify the notifier, and after verification, the notifier can be triggered to construct the message notifier according to the Jenkins URL configured in the configuration file of Jenkins.
And S280, the message notifier sends the test report to a tester so that the tester links and locates a problem interface according to the problem included in the test report.
In this embodiment, the test result is formed into a test report, and the test report is sent to a tester through a message notifier, and the tester can directly locate 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 configuration file of the Jenkins; 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.
According to the method for testing distributed cluster software, which is provided by the embodiment of the invention, software to be tested can be automatically installed and deployed on each node of a distributed system; after the interface is changed, the interface can be tested according to the updated interface test case document when the interface is tested next time only by updating and submitting the interface test case document; after the interface test is finished, a test report can be automatically generated, and the problem interface can be intuitively found according to the test report, so that a tester can conveniently track and feed back the problem interface in time; the test report can be sent to the message notifier at regular time according to the triggering time of the trigger, and the test condition can be monitored 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, where the apparatus may be adapted to perform internal testing on a new version of distributed integrated software product, and 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: trigger module 410, determination module 420, and test module 430.
The triggering module 410 is configured to perform user authentication according to the authentication token in the interface test case, and trigger a testing function of the distributed cluster software through a trigger built in a configuration file of the continuous integration tool Jenkins after the user authentication is passed;
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 the Jenkins, and determine a test document required for testing the software to be tested;
and the test module 430 is used for testing the software to be tested installed and deployed in the distributed system according to the determined test document.
In the embodiment, the device firstly performs user identity verification according to a verification token in an interface test case through a trigger module, and after the user identity verification is passed, a test function of distributed cluster software is triggered through a trigger constructed in a configuration file of a continuous integration tool Jenkins; then, installing software to be tested on a distributed system by a determining module through calling a command in a target command line on the Jenkins, 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 a test module.
The embodiment provides a testing device for distributed cluster software, which installs software to be tested on a distributed system by calling a command in a target command line on Jenkins, can realize automatic installation and deployment of the software, and can avoid manual triggering by triggering a testing function of the distributed cluster software through a trigger, thereby greatly saving manpower and improving testing efficiency.
Further, the determining module 420 is specifically configured to: installing and deploying the software to be tested in each server of a distributed system by calling a software installation and deployment command of a target command line on the Jenkins; the interface test case document corresponding to the software to be tested is derived through a call test interface document command in a target command line on the Jenkins, wherein the interface test case document is written on a webpage request simulation tool postman and comprises at least one interface test case; the environment variable document corresponding to the software to be tested is derived through the call environment variable document command in the target command line on the Jenkins, wherein the environment variable document is a document composed of at least one environment variable written on the 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 forming step of the interface test case includes: acquiring a verification token filled in request header Headers of the postman; acquiring preconditions filled in the pre-request codes of the postman; acquiring request verification filled in test sections Tests of the postman; and generating an interface test case based on the verification token, the preconditions and the request verification.
Further, the configuration module is configured to: configuring a trigger to construct the triggering 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 descriptive contents; based on the trigger time, target command line, message notifier, and description content, the configuration file is regarded as being 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 configuration file of the Jenkins; 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, wherein the construction message notifier unit is used for acquiring Jenkins URLs configured in the configuration file of the Jenkins; acquiring a notifier verification token added in the configuration file of the Jenkins; a message notifier is constructed based on the notifier authentication token and the jenkins URL.
Further, a test report output module, configured to output a test report to the message notifier in a target format according to the test report output format command; the message notifier sends the test report to a tester to enable the tester to link and locate a problem interface according to the problems 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 the corresponding functional modules and beneficial effects of the execution method.
Example IV
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 a fourth embodiment of the present invention includes: one or more processors 51 and storage 52; the number of processors 51 in the computer device may be one or more, one processor 51 being taken as an example in fig. 5; the storage device 52 is used for storing 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 a 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 device may be connected by a bus or by other means, in fig. 5 by way of example.
The storage device 52 in the computer apparatus is used as a computer readable storage medium, and may be used to store one or more programs, which may be a software program, a computer executable program, and a module, for example, a program instruction/module corresponding to a testing method of distributed cluster software provided in one or two embodiments of the present invention (for example, a module in a testing device of distributed cluster software shown in fig. 4 includes a triggering module 410, a determining module 420, and a testing module 430). The processor 51 executes various functional applications of the computer device and data processing by running software programs, instructions and modules stored in the storage means 52, i.e. a test method of distributed cluster software implementing one of the above-described method embodiments.
Storage device 52 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, at least one application program required for functionality; the storage data area may store data created according to the use of the computer device, etc. In addition, 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, storage 52 may further include memory located remotely from processor 51, which may be connected to the device via 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 means 53 may be used to receive entered numeric or character information and to generate key signal inputs related to user settings and function control of the computer device. 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 device are executed by the one or more processors 51, the programs perform the following operations:
user identity verification is carried out according to a verification token in the interface test case, and after the user identity verification is passed, a trigger constructed in a configuration file of a continuous integration tool Jenkins triggers a test function of distributed cluster software;
installing software to be tested on a distributed system by calling a command in a target command line on the 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
A fifth embodiment of the present invention provides a computer-readable storage medium having stored thereon a computer program for executing a test method of distributed cluster software when executed by a processor, the method comprising:
user identity verification is carried out according to a verification token in the interface test case, and after the user identity verification is passed, a trigger constructed in a configuration file of a continuous integration tool Jenkins triggers a test function of distributed cluster software;
installing software to be tested on a distributed system by calling a command in a target command line on the 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 may be further configured to perform the testing method of the distributed cluster software provided by any embodiment of the present invention when the program is executed by the processor.
The computer storage media of embodiments of the invention may take the form of 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. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any 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 (Random Access Memory, RAM), a Read-Only Memory (ROM), an erasable programmable Read-Only Memory (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.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to: electromagnetic signals, optical signals, or any suitable combination of the preceding. 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), and the like, or any suitable combination of the foregoing.
Computer program code for carrying out operations of the present invention may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ 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 kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. 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, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.

Claims (9)

1. A method for testing distributed cluster software, comprising:
user identity verification is carried out according to a verification token in the interface test case, and after the user identity verification is passed, a trigger constructed in a configuration file of a continuous integration tool Jenkins triggers a test function of distributed cluster software;
installing software to be tested on a distributed system by calling a command in a target command line on the Jenkins, and determining a test document required by testing the software to be tested;
testing the software to be tested installed and deployed in the distributed system according to the determined test document;
the forming step of the interface test case comprises the following steps:
acquiring an authentication token filled in request header Headers of postman;
acquiring preconditions filled in the pre-request codes of the postman;
acquiring request verification filled in test sections Tests of the postman;
and generating an interface test case based on the verification token, the preconditions and the request verification.
2. The method of claim 1, wherein said installing software under test on the distributed system by invoking commands in the target command line on Jenkins and determining test documents required for performing said software under test comprises:
installing and deploying the software to be tested in each server of a distributed system by calling a software installation and deployment command of a target command line on the Jenkins;
the interface test case document corresponding to the software to be tested is derived through a call test interface document command in a target command line on the Jenkins, wherein the interface test case document is written on a webpage request simulation tool postman and comprises at least one interface test case;
the environment variable document corresponding to the software to be tested is derived through the call environment variable document command in the target command line on the Jenkins, wherein the environment variable document is a document composed of at least one environment variable written on the 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 configuring step of performing test configuration on the Jenkins comprises:
configuring a trigger to construct the triggering 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 descriptive contents;
based on the trigger time, target command line, message notifier, and description content, the configuration file is regarded as being integrated on the Jenkins.
4. A method according to claim 3, wherein configuring the execution command build to result in the target command line comprises:
acquiring a software installation and deployment command filled in a command line of the configuration file of the Jenkins;
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.
5. A method according to claim 3, wherein the configuration notifier is structured to obtain a message notifier, comprising:
obtaining Jenkins URL configured in the configuration file of the Jenkins;
acquiring a notifier verification token added in the configuration file of the Jenkins;
a message notifier is constructed based on the notifier authentication token and the jenkins URL.
6. The method of claim 1, further comprising, after the testing of the software under test installed and deployed in the distributed system according to the determined test document:
outputting the test report to the message notifier in a target format according to the test report output format command;
the message notifier sends the test report to a tester to enable the tester to link and locate a problem interface according to the problems included in the test report.
7. A testing apparatus for distributed cluster software, comprising:
the triggering module is used for carrying out user identity verification according to the verification token in the interface test case, and triggering the test function of the distributed cluster software through a trigger constructed in the configuration file of the continuous integration tool Jenkins after the user identity verification is passed;
the determining module is used for installing software to be tested on the distributed system by calling the command in the target command line on the Jenkins and determining a test document required by testing the software to be tested;
the testing module is used for testing the software to be tested installed and deployed in the distributed system according to the determined testing document;
the determining module is also used for acquiring the verification token filled in the request header Headers of postman; acquiring preconditions filled in the pre-request codes of the postman; acquiring request verification filled in test sections Tests of the postman; and generating an interface test case based on the verification token, the preconditions and the request verification.
8. A computer device, comprising:
one or more processors;
a storage means for storing one or more programs;
the one or more programs are executed by the one or more processors to cause the one or more processors to perform the method of testing distributed cluster software of any of claims 1-6.
9. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements a method of testing distributed cluster software according to any of claims 1-6.
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 CN112765038A (en) 2021-05-07
CN112765038B true 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)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115438805B (en) * 2022-11-08 2023-01-24 江苏智云天工科技有限公司 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
How to write automated tests for APIs using Postman – Part 1;Abhinav Asthana;https://blog.postman.com/writing-automated-tests-for-apis-using-postman/;全文 *
Postman+Newman+jenkins实现自动化测试;wust_lh;https://blog.csdn.net/wust_lh/article/details/86512058;1-8 *
使用jenkins自动化打包部署Vue项目。详细教程。;ErDong;https://juejin.cn/post/6844903870313791501;1-9页 *
用postman做接口测试实例;changyixue;https://blog.csdn.net/changyixue/article/details/89496518;全文 *

Also Published As

Publication number Publication date
CN112765038A (en) 2021-05-07

Similar Documents

Publication Publication Date Title
CN108108297B (en) Method and device for automatic testing
CN110442524B (en) Method and device for testing web service interface with authentication authorization
CN110147240B (en) Cloud storage-based application program installation method, system and storage medium
CN109871499A (en) Page loading method and client
CN109391673A (en) A kind of method, system and the terminal device of management update file
CN107450899B (en) Method and device for generating terminal control script
CN109683892B (en) Page display method and device, computer equipment and storage medium
CN110750415B (en) Interface service configuration method, device, medium and computer equipment
CN110365724B (en) Task processing method and device and electronic equipment
CN110399159A (en) Dispositions method, device, computer equipment and the storage medium of operating system
CN111400125A (en) Memory overflow monitoring method, device, equipment and storage medium of JAVA process
CN113360301B (en) Message transmission system and method
CN112015654A (en) Method and apparatus for testing
CN105786636B (en) A kind of system repair and device
CN112631919A (en) Comparison test method and device, computer equipment and storage medium
CN112765038B (en) Distributed cluster software testing method, device, equipment and storage medium
CN111770174A (en) Cloud platform deployment method, device, equipment and readable storage medium
CN116257438A (en) Updating method of interface test case and related equipment
CN108600377A (en) A kind of pause method of file download, device, terminal and storage medium
CN114546837A (en) Interface test method, device, equipment and storage medium
CN115996179A (en) Service node testing method and device, readable medium and electronic equipment
CN115129574A (en) Code testing method and device
JP4696744B2 (en) Program test apparatus, method, and program
CN111404897A (en) Message distribution method and device, storage medium and electronic equipment
CN110874316B (en) Method, device and system for scanning codes

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