CN112395195A - Method, device and equipment for processing automatic test data and storage medium - Google Patents

Method, device and equipment for processing automatic test data and storage medium Download PDF

Info

Publication number
CN112395195A
CN112395195A CN202011298683.5A CN202011298683A CN112395195A CN 112395195 A CN112395195 A CN 112395195A CN 202011298683 A CN202011298683 A CN 202011298683A CN 112395195 A CN112395195 A CN 112395195A
Authority
CN
China
Prior art keywords
file
target
log
preset
server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011298683.5A
Other languages
Chinese (zh)
Inventor
王娜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Life Insurance Company of China Ltd
Original Assignee
Ping An Life Insurance Company of China 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 Ping An Life Insurance Company of China Ltd filed Critical Ping An Life Insurance Company of China Ltd
Priority to CN202011298683.5A priority Critical patent/CN112395195A/en
Publication of CN112395195A publication Critical patent/CN112395195A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis

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 relates to the technical field of automatic testing, and provides a method, a device, equipment and a storage medium for processing automatic testing data, which are used for improving the monitoring efficiency of abnormity and performance problems of a server. The processing method of the automatic test data comprises the following steps: automatically testing the interface test case in the interface test case file through the main thread to obtain an execution result; connecting the preset servers corresponding to the sub threads through the pre-created sub threads, and reading the server log information of the preset servers after the connection is successful; performing abnormity detection on the server log information through the sub-thread to obtain target abnormal log information; acquiring resource data of a preset server; and according to a preset sending mode, sending the target automatic execution result file written with the execution result, the target abnormal log file written with the target abnormal log information and the target server resource file written with the resource data to a preset feedback end.

Description

Method, device and equipment for processing automatic test data and storage medium
Technical Field
The present invention relates to the field of automated testing technologies, and in particular, to a method, an apparatus, a device, and a storage medium for processing automated test data.
Background
In the age of rapid development of the software industry at present, the software quality is an important factor for measuring whether software meets the requirements of users, and the software test is an important guarantee means of the software quality. Under the condition of rapid periodic iteration of software, the traditional manual test can not meet the fast-paced iteration mode gradually, and the automatic test is particularly important at the moment.
Most of the existing automatic test tools read the state code from the excel through a table excel management interface and parameters, obtain a response result of the interface according to a corresponding request mode, and verify the state code and the response result, so as to obtain an execution result of the test case.
However, in the above-mentioned manner, in the interface request process, it cannot be identified in time whether the server has log information of error reporting and abnormal situations, and during the execution of the automated test, a situation that the server has error reporting or an abnormal leak cannot be found in time due to the missing or imperfect interface verification rule may also occur, and the resource occupation situations of the server CPU, the memory, and the like cannot be found directly according to the execution result of the automated test, so that the performance problem of the server is easily ignored, thereby resulting in the low efficiency of monitoring the abnormal and performance problems of the server in the existing automated test method.
Disclosure of Invention
The invention provides a method, a device, equipment and a storage medium for processing automatic test data, which are used for improving the monitoring efficiency of abnormity and performance problems of a server.
The first aspect of the present invention provides a method for processing automated test data, including:
reading an interface test case file through a pre-established main thread, carrying out automatic test on an interface test case in the interface test case file through the main thread to obtain an execution result, and writing the execution result into a preset result file to obtain a target automatic execution result file;
connecting the preset servers corresponding to the sub-threads through the pre-established sub-threads, and reading the server log information of the preset servers after the connection is successful;
performing anomaly detection on the server log information through the sub-thread to obtain target anomaly log information, and writing the target anomaly log information into a preset anomaly log file to obtain a target anomaly log file;
acquiring resource data of the preset server, and writing the resource data into a preset server resource file to obtain a target server resource file, wherein the resource data comprises information of a process occupying central processing unit and information of a process occupying memory;
and sending the target automatic execution result file, the target abnormal log file and the target server resource file to a preset feedback end according to a preset sending mode.
Optionally, in a first implementation manner of the first aspect of the present invention, the reading an interface test case file by a pre-created main thread, performing an automated test on an interface test case in the interface test case file by the main thread to obtain an execution result, and writing the execution result into a preset result file to obtain a target automated execution result file includes:
reading an interface test case file through a pre-established main thread, and judging whether the file content of the interface test case file is empty or not;
if the file content of the interface test case file is not empty, calling a preset function to obtain parameter information of each interface test case in the interface test case file, wherein the parameter information comprises parameters, values corresponding to each parameter and index values corresponding to each parameter;
calling a corresponding interface request mode according to the parameter information, and triggering an interface request through the interface request mode to obtain an interface response result;
verifying the interface response result to obtain a case execution result of the interface test case, and writing the case execution result into a preset result file to obtain an execution result file;
and judging whether the content of the last line of the execution result file is empty or not, and if the content of the last line of the execution result file is empty, determining the execution result file as a target automatic execution result file.
Optionally, in a second implementation manner of the first aspect of the present invention, the connecting, through a pre-created sub thread, the preset server corresponding to the sub thread, and reading server log information of the preset server after the connection is successful includes:
acquiring a configuration file through a pre-created sub-thread, and reading configuration information in the configuration file, wherein the configuration information comprises server connection information and log abnormal keyword information;
connecting the preset servers corresponding to the sub-threads through preset safe shell protocol commands and the server connection information to obtain connection results;
and if the connection result is that the connection is successful, reading the server log information of the preset server after the connection is successful.
Optionally, in a third implementation manner of the first aspect of the present invention, the performing, by the child thread, an anomaly detection on the server log information to obtain target anomaly log information, and writing the target anomaly log information into a preset anomaly log file to obtain a target anomaly log file includes:
circularly matching the server log information through the sub-thread and the log abnormal keyword information until the execution of the interface test case in the interface test case file is completed to obtain target abnormal log information;
and comparing and analyzing the target abnormal log information with the content in a preset abnormal log file, and writing the compared and analyzed target abnormal log information into the preset abnormal log file to obtain a target abnormal log file.
Optionally, in a fourth implementation manner of the first aspect of the present invention, the circularly matching the server log information through the sub-thread and the log abnormal keyword information until the execution of the interface test case in the interface test case file is completed to obtain the target abnormal log information includes:
extracting keywords from the server log information through the sub-thread to obtain initial log keywords, and matching corresponding target log keywords from the initial log keywords according to log abnormal keywords in the log abnormal keyword information, wherein the log abnormal keyword information comprises the log abnormal keywords, and an abnormal keyword sequence and an abnormal log template corresponding to the log abnormal keywords;
generating an initial keyword sequence of the target log keywords, and comparing the initial keyword sequence with the abnormal keyword sequence to obtain a target keyword sequence corresponding to the abnormal keyword sequence;
extracting initial abnormal log information corresponding to the target keyword sequence from the server log information, and comparing and analyzing the initial abnormal log information and the abnormal log template until the execution of the interface test case in the interface test case file is completed to obtain the target abnormal log information corresponding to the abnormal log template.
Optionally, in a fifth implementation manner of the first aspect of the present invention, the comparing and analyzing the target abnormal log information with contents in a preset abnormal log file, and writing the target abnormal log information after the comparing and analyzing into the preset abnormal log file to obtain a target abnormal log file includes:
acquiring context information of target log keywords from the target abnormal log information;
judging whether the content in the preset abnormal log file has the same information as the context information;
and if the content of the preset abnormal log file does not have the information which is the same as the context information, writing the target abnormal log information into the preset abnormal log file to obtain a target abnormal log file.
Optionally, in a sixth implementation manner of the first aspect of the present invention, the sending the target automatic execution result file, the target abnormal log file, and the target server resource file to a preset feedback end according to a preset sending manner includes:
performing statistical analysis on the target automatic execution result file and the target abnormal log file to obtain an abnormal rate, an abnormal duration and an abnormal range;
generating a visual chart according to the abnormal rate, the abnormal duration and the abnormal range, and retrieving a preset server performance grade table according to resource data in the target server resource file to obtain a corresponding target server performance grade;
acquiring a preset mail template and a mailbox address corresponding to a preset feedback end, generating a feedback mail of the target automatic execution result file, the target abnormal log file, the target server resource file, the visual chart and the target server performance level according to the mail template and the mailbox address, and sending the feedback mail to the preset feedback end.
The second aspect of the present invention provides an apparatus for processing automated test data, comprising:
the execution writing-in module is used for reading an interface test case file through a pre-established main thread, carrying out automatic test on an interface test case in the interface test case file through the main thread to obtain an execution result, and writing the execution result into a preset result file to obtain a target automatic execution result file;
the connection reading module is used for connecting the preset server corresponding to the sub thread through the pre-established sub thread and reading the server log information of the preset server after the connection is successful;
the detection writing module is used for carrying out abnormity detection on the server log information through the sub-thread to obtain target abnormity log information, and writing the target abnormity log information into a preset abnormity log file to obtain a target abnormity log file;
the acquisition writing module is used for acquiring resource data of the preset server and writing the resource data into a preset server resource file to obtain a target server resource file, wherein the resource data comprises information of a process occupying central processing unit and information of a process occupying memory;
and the sending module is used for sending the target automatic execution result file, the target abnormal log file and the target server resource file to a preset feedback end according to a preset sending mode.
Optionally, in a first implementation manner of the second aspect of the present invention, the execution writing module is specifically configured to:
reading an interface test case file through a pre-established main thread, and judging whether the file content of the interface test case file is empty or not;
if the file content of the interface test case file is not empty, calling a preset function to obtain parameter information of each interface test case in the interface test case file, wherein the parameter information comprises parameters, values corresponding to each parameter and index values corresponding to each parameter;
calling a corresponding interface request mode according to the parameter information, and triggering an interface request through the interface request mode to obtain an interface response result;
verifying the interface response result to obtain a case execution result of the interface test case, and writing the case execution result into a preset result file to obtain an execution result file;
and judging whether the content of the last line of the execution result file is empty or not, and if the content of the last line of the execution result file is empty, determining the execution result file as a target automatic execution result file.
Optionally, in a second implementation manner of the second aspect of the present invention, the connection reading module is specifically configured to:
acquiring a configuration file through a pre-created sub-thread, and reading configuration information in the configuration file, wherein the configuration information comprises server connection information and log abnormal keyword information;
connecting the preset servers corresponding to the sub-threads through preset safe shell protocol commands and the server connection information to obtain connection results;
and if the connection result is that the connection is successful, reading the server log information of the preset server after the connection is successful.
Optionally, in a third implementation manner of the second aspect of the present invention, the detection writing module includes:
the matching unit is used for circularly matching the server log information through the sub thread and the log abnormal keyword information until the execution of the interface test case in the interface test case file is completed to obtain target abnormal log information;
and the comparison and analysis unit is used for comparing and analyzing the target abnormal log information with the content in a preset abnormal log file, and writing the target abnormal log information after comparison and analysis into the preset abnormal log file to obtain a target abnormal log file.
Optionally, in a fourth implementation manner of the second aspect of the present invention, the matching unit is specifically configured to:
extracting keywords from the server log information through the sub-thread to obtain initial log keywords, and matching corresponding target log keywords from the initial log keywords according to log abnormal keywords in the log abnormal keyword information, wherein the log abnormal keyword information comprises the log abnormal keywords, and an abnormal keyword sequence and an abnormal log template corresponding to the log abnormal keywords;
generating an initial keyword sequence of the target log keywords, and comparing the initial keyword sequence with the abnormal keyword sequence to obtain a target keyword sequence corresponding to the abnormal keyword sequence;
extracting initial abnormal log information corresponding to the target keyword sequence from the server log information, and comparing and analyzing the initial abnormal log information and the abnormal log template until the execution of the interface test case in the interface test case file is completed to obtain the target abnormal log information corresponding to the abnormal log template.
Optionally, in a fifth implementation manner of the second aspect of the present invention, the comparative analysis unit is specifically configured to:
acquiring context information of target log keywords from the target abnormal log information;
judging whether the content in the preset abnormal log file has the same information as the context information;
and if the content of the preset abnormal log file does not have the information which is the same as the context information, writing the target abnormal log information into the preset abnormal log file to obtain a target abnormal log file.
Optionally, in a sixth implementation manner of the second aspect of the present invention, the sending module is specifically configured to:
performing statistical analysis on the target automatic execution result file and the target abnormal log file to obtain an abnormal rate, an abnormal duration and an abnormal range;
generating a visual chart according to the abnormal rate, the abnormal duration and the abnormal range, and retrieving a preset server performance grade table according to resource data in the target server resource file to obtain a corresponding target server performance grade;
acquiring a preset mail template and a mailbox address corresponding to a preset feedback end, generating a feedback mail of the target automatic execution result file, the target abnormal log file, the target server resource file, the visual chart and the target server performance level according to the mail template and the mailbox address, and sending the feedback mail to the preset feedback end.
A third aspect of the present invention provides an automated test data processing apparatus, including: a memory and at least one processor, the memory having instructions stored therein; the at least one processor invokes the instructions in the memory to cause the automated test data processing apparatus to perform the automated test data processing method described above.
A fourth aspect of the present invention provides a computer-readable storage medium having stored therein instructions, which, when run on a computer, cause the computer to execute the above-described automated test data processing method.
In the technical scheme provided by the invention, the interface test case file is read through a pre-established main thread, the interface test cases in the interface test case file are automatically tested through the main thread to obtain an execution result, and the execution result is written into a preset result file to obtain a target automatic execution result file; connecting the preset servers corresponding to the sub threads through the pre-created sub threads, and reading the server log information of the preset servers after the connection is successful; performing abnormity detection on the server log information through the sub-thread to obtain target abnormity log information, and writing the target abnormity log information into a preset abnormity log file to obtain a target abnormity log file; acquiring resource data of a preset server, writing the resource data into a preset server resource file to obtain a target server resource file, wherein the resource data comprises information of a process occupying central processing unit and information of a process occupying memory; and according to a preset sending mode, sending the target automatic execution result file, the target abnormal log file and the target server resource file to a preset feedback end. In the embodiment of the invention, the interface test case in the interface test case file is automatically tested through the main thread, the preset server is connected through the sub-thread, the server log information of the preset server is monitored in real time, and the resource data of the preset server is read, so that the multi-process monitoring of a plurality of servers, the real-time capturing of the server log information in the interface request process, the abnormal detection of the server log information and the real-time monitoring and reading of the resource data of the preset server are realized, and the monitoring efficiency of the abnormal and performance problems of the servers is improved.
Drawings
FIG. 1 is a diagram illustrating an exemplary method for processing automated test data according to an embodiment of the present invention;
FIG. 2 is another schematic diagram of step 101-105 in the embodiment of the present invention;
FIG. 3 is a schematic diagram of another embodiment of a method for processing automated test data according to an embodiment of the present invention;
FIG. 4 is another schematic diagram of step 301 in an embodiment of the present invention;
FIG. 5 is another schematic diagram of step 302-305 in the embodiment of the present invention;
FIG. 6 is a schematic diagram of an embodiment of an apparatus for processing automated test data according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of another embodiment of an apparatus for processing automated test data according to an embodiment of the present invention;
FIG. 8 is a diagram of an embodiment of a device for processing automated test data according to an embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a method, a device, equipment and a storage medium for processing automatic test data, which improve the monitoring efficiency of abnormity and performance problems of a server.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises," "comprising," or "having," and any variations thereof, are intended to cover non-exclusive inclusions, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
For ease of understanding, a detailed flow of an embodiment of the present invention is described below, and referring to fig. 1, an embodiment of a method for processing automated test data according to an embodiment of the present invention includes:
101. reading the interface test case file through a pre-established main thread, carrying out automatic test on the interface test cases in the interface test case file through the main thread to obtain an execution result, and writing the execution result into a preset result file to obtain a target automatic execution result file.
It is to be understood that the execution subject of the present invention may be a processing device for automated test data, and may also be a terminal or a server, which is not limited herein. The embodiment of the present invention is described by taking a server as an execution subject.
The server builds a test environment of the server and the database in advance, generates a configuration file of configuration information, wherein the configuration information comprises but is not limited to server connection information (supporting a plurality of server connection information) and log abnormal keywords, and generates a corresponding interface test case file (a form Excel file) according to the designed interface test information. After a test environment is built and an interface test case file is generated, a main thread and a sub thread of a test process are created by a server, and the pre-created main thread and the pre-created sub thread are obtained. The server calls a pre-created main thread, reads the interface test case through the main thread, analyzes the interface test case file to obtain test parameters, executes the automatic test of the interface test case according to the test parameters through a preset automatic script to obtain a test case execution result, verifies the test case execution result according to a preset verification strategy to obtain an execution result which passes the verification, and writes the execution result into a preset result file to obtain a target automatic execution result file.
It should be noted that the interface test case file includes a plurality of interface test cases. The test parameters include, but are not limited to, a step name parameter, an input parameter, an interface method name parameter, an expected output parameter, an actual output parameter, an interface name parameter, an interface request parameter, and the like. The number of interface test cases includes one or more than one, that is, includes a plurality of test case cases. The preset verification policy is used for verifying whether the execution result can achieve the effect achieved by the interface corresponding to the interface test case, and the preset verification policy includes a plurality of verification rules, for example: and in the execution result, judging whether the interface test case passes execution or not according to whether the value of the preset field of the database changes or not, whether the preset memory value changes or not and whether the preset module is not downloaded or not.
102. And connecting the preset servers corresponding to the sub threads through the pre-created sub threads, and reading the server log information of the preset servers after the connection is successful.
The number of the pre-created sub-threads is one or more, the number of the preset servers is one or more, one preset server corresponds to one sub-thread, for example, the preset server 1 corresponds to the sub-thread 1, the preset server 2 corresponds to the sub-thread 2, a plurality of sub-threads are executed in parallel, and a plurality of sub-threads are executed in parallel with the main thread. The server acquires a pre-generated configuration file, analyzes the configuration file to obtain analysis information, extracts server connection information of the preset server from the analysis information, connects the preset server according to the server connection information, inputs a user name and a password, successfully authorizes login through the user name and the password to realize successful connection of the preset server, and reads server log information of the preset server after successful connection.
103. And performing abnormity detection on the server log information through the sub-thread to obtain target abnormity log information, and writing the target abnormity log information into a preset abnormity log file to obtain a target abnormity log file.
After obtaining the server log information, the server obtains a corresponding configuration file through a sub-thread, analyzes the configuration file to obtain analysis information, extracts a preset log abnormal keyword or a regular expression list corresponding to the preset log abnormal keyword from the analysis information, the server can traverse the server log information through the preset log abnormal keyword to obtain a target log abnormal keyword corresponding to the log abnormal keyword, uses the context information corresponding to the target log abnormal keyword as the target abnormal log information, or the server can search the server log information through the regular expression list corresponding to the log abnormal keyword to obtain the target log abnormal keyword, generates a keyword sequence of the target log abnormal keyword through a preset window, and calculates the similarity between the keyword sequence and the regular expression list, and taking the context information corresponding to the keyword sequence with the similarity larger than the preset threshold value as target abnormal log information, and writing the target abnormal log information into a preset abnormal log file to obtain the target abnormal log file.
104. And acquiring resource data of the preset server, and writing the resource data into a preset server resource file to obtain a target server resource file, wherein the resource data comprises information of a process occupying central processing unit and information of a process occupying memory.
After the server obtains the target abnormal log file, a resource storage path of a preset server is obtained through a sub-thread, a resource reading command is called, information of a process occupying Central Processing Unit (CPU) of the preset server and information of a process occupying memory, namely resource data, are read according to the resource storage path, and the information of the process occupying Central Processing Unit (CPU) and the information of the process occupying memory are written into the preset server resource file to obtain a target server resource file. And after the sub-thread obtains the resource file of the target server and indicates that the sub-thread is executed completely, returning to the main thread, and executing the automated test on the next interface test case by the main thread, wherein the automated test is sequentially executed in a circulating way until all the interface test cases are executed and the automated test is completed.
105. And according to a preset sending mode, sending the target automatic execution result file, the target abnormal log file and the target server resource file to a preset feedback end.
After the server obtains the resource file of the target server, the execution condition of the interface test case of the main thread is detected, judging whether the execution condition of the test case is the completion of the execution of all the interface test cases, if not, acquiring the interface test case which is not executed, executing the interface test case which is not executed according to the execution process of the step 101-104 until the execution is completed, if so, acquiring the label of the preset feedback end, matching the corresponding mailbox address and mail template according to the identification number, generating a feedback mail of a target automatic execution result file, a target abnormal log file and a target server resource file according to the mailbox address and the mail template, sending the feedback mail to a preset feedback end, therefore, related responsible persons with preset feedback ends can check, feed back and repair in time, and the project quality corresponding to the interface test case file is ensured.
In another embodiment, the execution process of step 101-105 may be as shown in fig. 2, where there are multiple sub-threads, for example, the sub-thread 1 and the sub-thread 2, the main thread, the sub-thread 1 and the sub-thread 2 execute in parallel, the main thread reads the interface test case file and parses the interface test case file, performs an automated test on the interface test case in the interface test case file to obtain an execution result, writes the execution result into a preset result file to obtain a target automated execution result file, and feeds back the target automated execution result file to a preset feedback end according to an email format, where when the interface test case in the interface test case file is automatically tested to obtain an execution result, the execution result is written into the preset result file to obtain the target automated execution result file, if it is detected that the target automated execution result file is not the last line, analyzing the interface test case file; connecting the preset server 1 corresponding to the sub-thread 1 through the sub-thread 1, monitoring log information of the server 1, reading the server log information of the preset server 1 after the connection is successful, obtaining resource data of the preset server 1, wherein the resource data comprises information that a process occupies a central processing unit and information that the process occupies a memory, writing the resource data into a preset server resource file to obtain a target server resource file, and feeding the target server resource file back to a preset feedback end according to a mail format; and carrying out abnormity detection on the server log information, judging whether target abnormity log information exists in the server log information, if so, obtaining the target abnormity log information, writing the target abnormity log information into a preset abnormity log file, carrying out deduplication processing on the written preset abnormity log file to obtain a target abnormity log file, feeding the target abnormity log file back to a preset feedback end according to a mail format, if not, monitoring the log information of the server 1, reading the server log information of the preset server 1 after successful connection, wherein the execution process of the sub-thread 2 is similar to that of the sub-thread 1, and the description is omitted.
In the embodiment of the invention, the interface test case in the interface test case file is automatically tested through the main thread, the preset server is connected through the sub-thread, the server log information of the preset server is monitored in real time, and the resource data of the preset server is read, so that the multi-process monitoring of a plurality of servers, the real-time capturing of the server log information in the interface request process, the abnormal detection of the server log information and the real-time monitoring and reading of the resource data of the preset server are realized, and the monitoring efficiency of the abnormal and performance problems of the servers is improved.
Referring to fig. 3, another embodiment of the method for processing automated test data according to the embodiment of the present invention includes:
301. reading the interface test case file through a pre-established main thread, carrying out automatic test on the interface test cases in the interface test case file through the main thread to obtain an execution result, and writing the execution result into a preset result file to obtain a target automatic execution result file.
Specifically, the server reads the interface test case file through a pre-created main thread and judges whether the file content of the interface test case file is empty; if the file content of the interface test case file is not empty, calling a preset function to obtain parameter information of each interface test case in the interface test case file, wherein the parameter information comprises parameters, values corresponding to each parameter and index values corresponding to each parameter; calling a corresponding interface request mode according to the parameter information, and triggering an interface request through the interface request mode to obtain an interface response result; verifying the interface response result to obtain a case execution result of the interface test case, and writing the case execution result into a preset result file to obtain an execution result file; and judging whether the content of the last line of the execution result file is empty or not, and if the content of the last line of the execution result file is empty, determining the execution result file as a target automatic execution result file.
The specific execution process may be as shown in fig. 4, where the preset function for obtaining the index value index corresponding to each parameter of each interface test case in the interface test case file is getColumnin dex (), and the preset functions for obtaining the value corresponding to each parameter of each interface test case in the interface test case file are row _ value () and cell _ value (). The interface request is triggered in an interface request mode, and before an interface response result is obtained, the interface test case file is triggered. If the file content of the interface test case file is empty, the execution is finished; and if the content of the last line of the execution result file is not empty, ending the execution.
In another embodiment, for example, the interface test case file is a spreadsheet excel file, and each row in the interface test case file is an interface test case. The method comprises the steps that a server obtains a worksheet name of an interface test case file through a pre-established main thread, reads the interface test case file according to the worksheet name, analyzes the interface test case file to obtain interface case parameters, judges whether the interface case parameters are empty through unit test assertion junit ASser function analysis to judge whether the file contents of the interface test case file are empty, if yes, execution is finished, if not, an index obtaining function getColumnindex () in a preset xlrd module is called to obtain index values corresponding to the interface case parameters in a header of the analyzed interface test case, and preset values are called to obtain functions row _ value () and cell _ value () to obtain each line of data to obtain the value of each line of interface case parameters, for example: using case name, URL, request mode, request parameter, expected result and the like, thereby obtaining parameter information;
triggering the execution of an interface test case according to the parameter information, calling a corresponding interface request mode through an interface request mode parameter in the parameter information, wherein the interface request mode can be a get request mode or a POST request mode, triggering the interface request through the interface request mode, obtaining an interface response result based on the execution of the interface test case through the interface request, matching a corresponding verification strategy according to the interface test case, verifying the interface response result through the verification strategy to obtain a case execution result passing the verification, writing the case execution result into a preset result file to obtain an execution result file, wherein the preset result file is a table excel file, the preset result file can include but is not limited to an execution state value, a parameter name, a character (success character, failure character) and/or a field value, and the case execution result can include but is not limited to the execution state value, for example: the state value is 1,1 indicates that the test is successful, and the case execution result may include, but is not limited to, a parameter name and an execution state value, for example: setup |1, the use case execution result may include, but is not limited to, parameter names, characters (success and/or failure characters), such as: and 30| OK, judging whether the content of the last line of the execution result file is empty, if so, ending the execution of the interface test case, otherwise, circularly executing the step 1012 and 1014 until the content of the last line of the execution result file is empty.
302. And connecting the preset servers corresponding to the sub threads through the pre-created sub threads, and reading the server log information of the preset servers after the connection is successful.
Specifically, the server acquires a configuration file through a pre-created sub-thread, and reads configuration information in the configuration file, wherein the configuration information comprises server connection information and log abnormal keyword information; connecting the preset servers corresponding to the sub threads through preset safety shell protocol commands and server connection information to obtain connection results; and if the connection result is successful, reading the server log information of the preset server after the connection is successful.
For example, the server searches a preset database according to the parameter information of the interface test case file through a pre-created sub-thread to obtain a corresponding configuration file, analyzes the configuration file to obtain analyzed configuration information, reads corresponding server connection information from the analyzed configuration information, calls a preset Secure Shell (SSH) command, executes the server connection information through the SSH command, connects the preset server corresponding to the sub-thread to obtain a user name and a password of the preset server, performs authorized login through the user name and the password, obtains a connection result after the authorized login is successful, judges whether the content in the connection result is "connection successful", and if so, searches all operation logs in the preset server after connection is successful to obtain corresponding server log information when the interface test case is executed, and extracting the server log information, or sending a tail-f command to a preset server which is successfully connected through a preset subpacess.Popen () method so as to obtain the server log in real time, and if not, determining that the execution of the corresponding sub-thread is finished.
303. And circularly matching the server log information through the sub-thread and the log abnormal keyword information until the execution of the interface test case in the interface test case file is completed to obtain the target abnormal log information.
Specifically, the server extracts keywords from the server log information through a sub-thread to obtain an initial log keyword, and matches a corresponding target log keyword from the initial log keyword according to the log abnormal keyword in the log abnormal keyword information, wherein the log abnormal keyword information comprises the log abnormal keyword, and an abnormal keyword sequence and an abnormal log template corresponding to the log abnormal keyword; generating an initial keyword sequence of the target log keywords, and comparing the initial keyword sequence with the abnormal keyword sequence to obtain a target keyword sequence corresponding to the abnormal keyword sequence; and extracting initial abnormal log information corresponding to the target keyword sequence from the server log information, and comparing and analyzing the initial abnormal log information and the abnormal log template until the execution of the interface test case in the interface test case file is completed to obtain the target abnormal log information corresponding to the abnormal log template.
For example, the server converts the server log information into character string information through a sub-thread, performs word segmentation, word segmentation splicing and splicing filtering on the character string information in sequence to obtain an initial log keyword, calculates the text similarity between the initial log keyword and the log abnormal keyword in the log abnormal keyword information, judges whether all the text similarities are greater than a preset target threshold value, if not, re-reads the target server log information of the preset server, re-reads the target server log information of which the operation time is later than that of the previously read server log information, performs log abnormal keyword matching on the target server log information, if or partially greater, determines the initial log key corresponding to the text similarity greater than the target threshold value as the target log keyword, and passes through a preset window according to a time sequence, generating an initial keyword sequence of a target log keyword, calculating cosine similarity between the initial keyword sequence and an abnormal keyword sequence in log abnormal keyword information, judging whether the cosine similarity is within a preset similarity range, if not, not conforming to the abnormal keyword sequence, continuing to compare the next initial keyword sequence with the abnormal keyword sequence, if so, conforming to the abnormal keyword sequence, taking the corresponding initial keyword sequence as the target keyword sequence, and comparing the initial abnormal log information corresponding to the target keyword sequence with an abnormal log template to obtain the target abnormal log information which is the same as the abnormal log template or has the similarity larger than a preset threshold value.
After comparing and analyzing the initial abnormal log information and the abnormal log template, the server judges whether the abnormal log information corresponding to the abnormal log template exists in the initial abnormal log information or not; if the initial abnormal log information contains abnormal log information corresponding to the abnormal log template, determining the abnormal log information corresponding to the abnormal log template as target abnormal log information; and if the initial abnormal log information does not have the abnormal log information corresponding to the abnormal log template, circularly matching the server log information until the execution of the interface test case in the interface test case file is completed to obtain the target abnormal log information.
Optionally, the server may also compare and analyze the initial abnormal log information with the abnormal log template to obtain candidate abnormal log information, compare and analyze sequence information in the candidate abnormal log information with the target keyword sequence, and determine candidate abnormal log information, in which the sequence information is the same as the target keyword sequence or the similarity of the sequence information and the target keyword sequence is greater than a preset target threshold, as the target abnormal log information; when the corresponding abnormal keyword (i.e. the target log keyword) is not matched from the initial log keywords, generating a corresponding field value, thereby obtaining the target log keyword, for example: '0', the corresponding target keyword sequence is a corresponding plurality of field values, for example: '0000', the corresponding target abnormal log information is a preset field name indicating no.
304. And comparing and analyzing the target abnormal log information with the content in the preset abnormal log file, and writing the compared and analyzed target abnormal log information into the preset abnormal log file to obtain the target abnormal log file.
Specifically, the server acquires context information of a target log keyword from target abnormal log information; judging whether the content in the preset abnormal log file has the information the same as the context information; and if the content of the preset abnormal log file does not have the information same as the context information, writing the target abnormal log information into the preset abnormal log file to obtain the target abnormal log file.
After obtaining the target abnormal log information, the server obtains the context information of the target log keyword from the target abnormal log information, compares and analyzes the context information with the log information in a preset abnormal log file, calculates the information similarity, judges whether the information similarity is larger than a preset information similarity threshold value, if so, judging that the target automation execution result file has the same information as the context information, not writing the target abnormal log information into a preset abnormal log file, or the log information of the abnormal mark and the log information in the preset abnormal log file are subjected to duplication removal and fusion processing to obtain a target abnormal log file, if not, and if the target automatic execution result file is judged to have the same information as the context information, writing the abnormal log file into a preset abnormal log file to obtain a target abnormal log file.
305. And acquiring resource data of the preset server, and writing the resource data into a preset server resource file to obtain a target server resource file, wherein the resource data comprises information of a process occupying central processing unit and information of a process occupying memory.
After the server obtains the target abnormal log file, a resource storage path of a preset server is obtained through a sub-thread, a resource reading command is called, information of a process occupying Central Processing Unit (CPU) of the preset server and information of a process occupying memory, namely resource data, are read according to the resource storage path, and the information of the process occupying Central Processing Unit (CPU) and the information of the process occupying memory are written into the preset server resource file to obtain a target server resource file. And after the sub-thread obtains the resource file of the target server and indicates that the sub-thread is executed completely, returning to the main thread, and executing the automated test on the next interface test case by the main thread, wherein the automated test is sequentially executed in a circulating way until all the interface test cases are executed and the automated test is completed.
In another embodiment, as shown in fig. 5, the execution process of step 302 and step 305 may be that, the server obtains the configuration file through the pre-created sub-thread, reads the configuration information in the configuration file, where the configuration information includes server connection information and log exception keyword information, and through a preset Secure Shell (SSH) command and server connection information, connecting the preset servers corresponding to the sub-threads to obtain a connection result, judging whether the connection result is successful or not, if not, if yes, executing top command to obtain preset server resource data including process occupied CPU information and process occupied memory information, writing resource data into preset server resource file, the file is named as ip _ resource _ used _ current time, a target server resource file is obtained, and a tail-f command is executed to read the server log information of the preset server after successful connection in real time;
performing abnormal keyword matching on server log information through log abnormal keyword information and a character string matching algorithm (or regular expression), judging whether a target log keyword is matched or not, if not, executing a top command to obtain resource data of a preset server, wherein the resource data comprises process occupation central processing unit information and process occupation memory information, if so, obtaining target abnormal log information, performing comparative analysis on the target abnormal log information and the content in a preset abnormal log file, writing the target abnormal log information after the comparative analysis into a preset abnormal log file, naming the file as ip _ exception _ log _ current time to obtain a target abnormal log file, judging whether the test case in an interface test case file is executed or not, if so, finishing the execution, if not, executing the top command to obtain the resource data of the preset server, the resource data comprises information that the process occupies the central processing unit and information that the process occupies the memory.
306. And according to a preset sending mode, sending the target automatic execution result file, the target abnormal log file and the target server resource file to a preset feedback end.
Specifically, the server performs statistical analysis on a target automatic execution result file and a target abnormal log file to obtain an abnormal rate, an abnormal duration and an abnormal range; generating a visual chart according to the abnormal rate, the abnormal duration and the abnormal range, and retrieving a preset server performance grade table according to the resource data in the target server resource file to obtain a corresponding target server performance grade; the method comprises the steps of obtaining a preset mail template and a mailbox address corresponding to a preset feedback end, generating a feedback mail of a target automatic execution result file, a target abnormal log file, a target server resource file, a visual chart and a target server performance grade according to the mail template and the mailbox address, and sending the feedback mail to the preset feedback end.
The abnormal rate can be obtained by calculating the ratio of the abnormal interface test cases to all the interface test cases, for example, if the number of all the interface test cases is 20, and the number of the abnormal interface test cases is 5, the abnormal rate is 25%. The abnormal time length is the time length of each abnormal operation time interval of each interface test case in the process of executing the automatic test, the target abnormal log information can be slid through a preset abnormal window to obtain the abnormal operation time interval, and the difference value between the initial time and the tail end time of the abnormal operation time interval is calculated to obtain the abnormal time length. The exception range refers to the automatic test items of the interface test case corresponding to the target exception log information and the content corresponding to the automatic test items. The server searches a preset server performance grade table according to the resource data in the target server resource file, and the specific operation when the target server performance grade is obtained is as follows: and generating a hash value of the resource data, and retrieving a preset server performance grade table through a preset index and the hash value to obtain a target server performance grade which can be excellent, good, poor and the like. And respectively filling the target automatic execution result file, the target abnormal log file, the target server resource file, the visual chart and the target server performance grade into corresponding positions in a preset mail template to obtain a feedback mail, and sending the feedback mail to a preset feedback end.
In the embodiment of the invention, the interface test case in the interface test case file is automatically tested through the main thread, the preset server is connected through the sub-thread, the server log information of the preset server is monitored in real time, and the resource data of the preset server is read, so that the multi-process monitoring of a plurality of servers, the real-time capturing of the server log information in the interface request process, the abnormal detection of the server log information and the real-time monitoring and reading of the resource data of the preset server are realized, and the monitoring efficiency of the abnormal and performance problems of the servers is improved.
With reference to fig. 6, the method for processing the automated test data according to the embodiment of the present invention is described above, and a processing apparatus for the automated test data according to the embodiment of the present invention is described below, where an embodiment of the processing apparatus for the automated test data according to the embodiment of the present invention includes:
the execution writing module 601 is configured to read the interface test case file through a pre-created main thread, perform an automated test on the interface test case in the interface test case file through the main thread to obtain an execution result, and write the execution result into a preset result file to obtain a target automated execution result file;
the connection reading module 602 is configured to connect the preset server corresponding to the sub thread through the pre-created sub thread, and read server log information of the preset server after successful connection;
the detection writing module 603 is configured to perform anomaly detection on the server log information through the sub-thread to obtain target anomaly log information, and write the target anomaly log information into a preset anomaly log file to obtain a target anomaly log file;
an obtaining and writing module 604, configured to obtain resource data of a preset server, and write the resource data into a preset server resource file to obtain a target server resource file, where the resource data includes information that a process occupies a central processing unit and information that the process occupies a memory;
the sending module 605 is configured to send the target automation execution result file, the target abnormal log file, and the target server resource file to the preset feedback end according to a preset sending manner.
The function implementation of each module in the processing apparatus for automated test data corresponds to each step in the processing method embodiment for automated test data, and the function and implementation process thereof are not described in detail herein.
In the embodiment of the invention, the interface test case in the interface test case file is automatically tested through the main thread, the preset server is connected through the sub-thread, the server log information of the preset server is monitored in real time, and the resource data of the preset server is read, so that the multi-process monitoring of a plurality of servers, the real-time capturing of the server log information in the interface request process, the abnormal detection of the server log information and the real-time monitoring and reading of the resource data of the preset server are realized, and the monitoring efficiency of the abnormal and performance problems of the servers is improved.
Referring to fig. 7, another embodiment of the apparatus for processing automated test data according to the embodiment of the present invention includes:
the execution writing module 601 is configured to read the interface test case file through a pre-created main thread, perform an automated test on the interface test case in the interface test case file through the main thread to obtain an execution result, and write the execution result into a preset result file to obtain a target automated execution result file;
the connection reading module 602 is configured to connect the preset server corresponding to the sub thread through the pre-created sub thread, and read server log information of the preset server after successful connection;
the detection writing module 603 is configured to perform anomaly detection on the server log information through the sub-thread to obtain target anomaly log information, and write the target anomaly log information into a preset anomaly log file to obtain a target anomaly log file;
the detection writing module 603 specifically includes:
a matching unit 6031, configured to perform cyclic matching on the server log information through the sub-thread and the log abnormal keyword information until the execution of the interface test case in the interface test case file is completed, so as to obtain target abnormal log information;
a comparison and analysis unit 6032, configured to compare and analyze the target abnormal log information with content in a preset abnormal log file, and write the target abnormal log information after the comparison and analysis into the preset abnormal log file to obtain a target abnormal log file;
an obtaining and writing module 604, configured to obtain resource data of a preset server, and write the resource data into a preset server resource file to obtain a target server resource file, where the resource data includes information that a process occupies a central processing unit and information that the process occupies a memory;
the sending module 605 is configured to send the target automation execution result file, the target abnormal log file, and the target server resource file to the preset feedback end according to a preset sending manner.
Optionally, the executing writing module 601 may be further specifically configured to:
reading the interface test case file through a pre-established main thread, and judging whether the file content of the interface test case file is empty or not;
if the file content of the interface test case file is not empty, calling a preset function to obtain parameter information of each interface test case in the interface test case file, wherein the parameter information comprises parameters, values corresponding to each parameter and index values corresponding to each parameter;
calling a corresponding interface request mode according to the parameter information, and triggering an interface request through the interface request mode to obtain an interface response result;
verifying the interface response result to obtain a case execution result of the interface test case, and writing the case execution result into a preset result file to obtain an execution result file;
and judging whether the content of the last line of the execution result file is empty or not, and if the content of the last line of the execution result file is empty, determining the execution result file as a target automatic execution result file.
Optionally, the connection reading module 602 may further be specifically configured to:
acquiring a configuration file through a pre-created sub-thread, and reading configuration information in the configuration file, wherein the configuration information comprises server connection information and log abnormal keyword information;
connecting the preset servers corresponding to the sub threads through preset safety shell protocol commands and server connection information to obtain connection results;
and if the connection result is successful, reading the server log information of the preset server after the connection is successful.
Optionally, the matching unit 6031 may further be specifically configured to:
extracting keywords from server log information through a sub-thread to obtain initial log keywords, and matching corresponding target log keywords from the initial log keywords according to log abnormal keywords in the log abnormal keyword information, wherein the log abnormal keyword information comprises log abnormal keywords, abnormal keyword sequences corresponding to the log abnormal keywords and an abnormal log template;
generating an initial keyword sequence of the target log keywords, and comparing the initial keyword sequence with the abnormal keyword sequence to obtain a target keyword sequence corresponding to the abnormal keyword sequence;
and extracting initial abnormal log information corresponding to the target keyword sequence from the server log information, and comparing and analyzing the initial abnormal log information and the abnormal log template until the execution of the interface test case in the interface test case file is completed to obtain the target abnormal log information corresponding to the abnormal log template.
Optionally, the comparative analysis unit 6032 may be further specifically configured to:
acquiring context information of a target log keyword from target abnormal log information;
judging whether the content in the preset abnormal log file has the information the same as the context information;
and if the content of the preset abnormal log file does not have the information same as the context information, writing the target abnormal log information into the preset abnormal log file to obtain the target abnormal log file.
Optionally, the sending module 605 may be further specifically configured to:
carrying out statistical analysis on the target automatic execution result file and the target abnormal log file to obtain an abnormal rate, abnormal duration and an abnormal range;
generating a visual chart according to the abnormal rate, the abnormal duration and the abnormal range, and retrieving a preset server performance grade table according to the resource data in the target server resource file to obtain a corresponding target server performance grade;
the method comprises the steps of obtaining a preset mail template and a mailbox address corresponding to a preset feedback end, generating a feedback mail of a target automatic execution result file, a target abnormal log file, a target server resource file, a visual chart and a target server performance grade according to the mail template and the mailbox address, and sending the feedback mail to the preset feedback end.
The functional implementation of each module and each unit in the processing apparatus for automated test data corresponds to each step in the embodiment of the processing method for automated test data, and the functions and implementation processes are not described in detail herein.
In the embodiment of the invention, the interface test case in the interface test case file is automatically tested through the main thread, the preset server is connected through the sub-thread, the server log information of the preset server is monitored in real time, and the resource data of the preset server is read, so that the multi-process monitoring of a plurality of servers, the real-time capturing of the server log information in the interface request process, the abnormal detection of the server log information and the real-time monitoring and reading of the resource data of the preset server are realized, and the monitoring efficiency of the abnormal and performance problems of the servers is improved.
Fig. 6 and 7 describe the processing apparatus for automated test data in the embodiment of the present invention in detail from the perspective of the modular functional entity, and the following describes the processing apparatus for automated test data in the embodiment of the present invention in detail from the perspective of hardware processing.
Fig. 8 is a schematic structural diagram of an apparatus for processing automated test data, where the apparatus 800 for processing automated test data may generate a relatively large difference due to different configurations or performances, and may include one or more processors (CPUs) 810 (e.g., one or more processors) and a memory 820, and one or more storage media 830 (e.g., one or more mass storage devices) for storing an application 833 or data 832. Memory 820 and storage medium 830 may be, among other things, transient or persistent storage. The program stored in the storage medium 830 may include one or more modules (not shown), each of which may include a series of instruction operations in the processing device 800 for automated test data. Further, the processor 810 may be configured to communicate with the storage medium 830 to execute a series of instruction operations in the storage medium 830 on the automated test data processing apparatus 800.
The automated test data processing apparatus 800 may also include one or more power supplies 840, one or more wired or wireless network interfaces 850, one or more input-output interfaces 860, and/or one or more operating systems 831, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, and the like. Those skilled in the art will appreciate that the automated test data processing apparatus configuration illustrated in FIG. 8 does not constitute a limitation of automated test data processing apparatus, and may include more or fewer components than illustrated, or some components in combination, or a different arrangement of components.
The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium, which may also be a volatile computer-readable storage medium, having stored thereon instructions, which, when executed on a computer, cause the computer to perform the steps of the method of processing automated test data.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. An automated test data processing method, comprising:
reading an interface test case file through a pre-established main thread, carrying out automatic test on an interface test case in the interface test case file through the main thread to obtain an execution result, and writing the execution result into a preset result file to obtain a target automatic execution result file;
connecting the preset servers corresponding to the sub-threads through the pre-established sub-threads, and reading the server log information of the preset servers after the connection is successful;
performing anomaly detection on the server log information through the sub-thread to obtain target anomaly log information, and writing the target anomaly log information into a preset anomaly log file to obtain a target anomaly log file;
acquiring resource data of the preset server, and writing the resource data into a preset server resource file to obtain a target server resource file, wherein the resource data comprises information of a process occupying central processing unit and information of a process occupying memory;
and sending the target automatic execution result file, the target abnormal log file and the target server resource file to a preset feedback end according to a preset sending mode.
2. The method for processing automation test data according to claim 1, wherein the reading of the interface test case file by the pre-created main thread, the automation test of the interface test case in the interface test case file by the main thread to obtain the execution result, and the writing of the execution result into the preset result file to obtain the target automation execution result file comprises:
reading an interface test case file through a pre-established main thread, and judging whether the file content of the interface test case file is empty or not;
if the file content of the interface test case file is not empty, calling a preset function to obtain parameter information of each interface test case in the interface test case file, wherein the parameter information comprises parameters, values corresponding to each parameter and index values corresponding to each parameter;
calling a corresponding interface request mode according to the parameter information, and triggering an interface request through the interface request mode to obtain an interface response result;
verifying the interface response result to obtain a case execution result of the interface test case, and writing the case execution result into a preset result file to obtain an execution result file;
and judging whether the content of the last line of the execution result file is empty or not, and if the content of the last line of the execution result file is empty, determining the execution result file as a target automatic execution result file.
3. The method for processing automation test data according to claim 1, wherein the connecting the preset server corresponding to the sub thread through the pre-created sub thread and reading the server log information of the preset server after the connection is successful comprises:
acquiring a configuration file through a pre-created sub-thread, and reading configuration information in the configuration file, wherein the configuration information comprises server connection information and log abnormal keyword information;
connecting the preset servers corresponding to the sub-threads through preset safe shell protocol commands and the server connection information to obtain connection results;
and if the connection result is that the connection is successful, reading the server log information of the preset server after the connection is successful.
4. The method for processing automation test data according to claim 3, wherein the performing abnormality detection on the server log information through the child thread to obtain target abnormality log information, writing the target abnormality log information into a preset abnormality log file to obtain a target abnormality log file includes:
circularly matching the server log information through the sub-thread and the log abnormal keyword information until the execution of the interface test case in the interface test case file is completed to obtain target abnormal log information;
and comparing and analyzing the target abnormal log information with the content in a preset abnormal log file, and writing the compared and analyzed target abnormal log information into the preset abnormal log file to obtain a target abnormal log file.
5. The method for processing automation test data according to claim 4, wherein the circularly matching the server log information through the sub-thread and the log exception keyword information until the execution of the interface test case in the interface test case file is completed to obtain target exception log information includes:
extracting keywords from the server log information through the sub-thread to obtain initial log keywords, and matching corresponding target log keywords from the initial log keywords according to log abnormal keywords in the log abnormal keyword information, wherein the log abnormal keyword information comprises the log abnormal keywords, and an abnormal keyword sequence and an abnormal log template corresponding to the log abnormal keywords;
generating an initial keyword sequence of the target log keywords, and comparing the initial keyword sequence with the abnormal keyword sequence to obtain a target keyword sequence corresponding to the abnormal keyword sequence;
extracting initial abnormal log information corresponding to the target keyword sequence from the server log information, and comparing and analyzing the initial abnormal log information and the abnormal log template until the execution of the interface test case in the interface test case file is completed to obtain the target abnormal log information corresponding to the abnormal log template.
6. The method for processing automation test data according to claim 4, wherein the comparing and analyzing the target exception log information with contents in a preset exception log file, and writing the target exception log information after the comparing and analyzing into the preset exception log file to obtain a target exception log file includes:
acquiring context information of target log keywords from the target abnormal log information;
judging whether the content in the preset abnormal log file has the same information as the context information;
and if the content of the preset abnormal log file does not have the information which is the same as the context information, writing the target abnormal log information into the preset abnormal log file to obtain a target abnormal log file.
7. The method for processing automation test data according to any one of claims 1 to 6, wherein the sending the target automation execution result file, the target exception log file, and the target server resource file to a preset feedback end according to a preset sending mode includes:
performing statistical analysis on the target automatic execution result file and the target abnormal log file to obtain an abnormal rate, an abnormal duration and an abnormal range;
generating a visual chart according to the abnormal rate, the abnormal duration and the abnormal range, and retrieving a preset server performance grade table according to resource data in the target server resource file to obtain a corresponding target server performance grade;
acquiring a preset mail template and a mailbox address corresponding to a preset feedback end, generating a feedback mail of the target automatic execution result file, the target abnormal log file, the target server resource file, the visual chart and the target server performance level according to the mail template and the mailbox address, and sending the feedback mail to the preset feedback end.
8. An automated test data processing apparatus, comprising:
the execution writing-in module is used for reading an interface test case file through a pre-established main thread, carrying out automatic test on an interface test case in the interface test case file through the main thread to obtain an execution result, and writing the execution result into a preset result file to obtain a target automatic execution result file;
the connection reading module is used for connecting the preset server corresponding to the sub thread through the pre-established sub thread and reading the server log information of the preset server after the connection is successful;
the detection writing module is used for carrying out abnormity detection on the server log information through the sub-thread to obtain target abnormity log information, and writing the target abnormity log information into a preset abnormity log file to obtain a target abnormity log file;
the acquisition writing module is used for acquiring resource data of the preset server and writing the resource data into a preset server resource file to obtain a target server resource file, wherein the resource data comprises information of a process occupying central processing unit and information of a process occupying memory;
and the sending module is used for sending the target automatic execution result file, the target abnormal log file and the target server resource file to a preset feedback end according to a preset sending mode.
9. An automated test data processing apparatus, comprising: a memory and at least one processor, the memory having instructions stored therein;
the at least one processor invokes the instructions in the memory to cause the automated test data processing apparatus to perform the automated test data processing method of any of claims 1-7.
10. A computer-readable storage medium having instructions stored thereon, wherein the instructions, when executed by a processor, implement a method of processing automated test data according to any one of claims 1-7.
CN202011298683.5A 2020-11-19 2020-11-19 Method, device and equipment for processing automatic test data and storage medium Pending CN112395195A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011298683.5A CN112395195A (en) 2020-11-19 2020-11-19 Method, device and equipment for processing automatic test data and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011298683.5A CN112395195A (en) 2020-11-19 2020-11-19 Method, device and equipment for processing automatic test data and storage medium

Publications (1)

Publication Number Publication Date
CN112395195A true CN112395195A (en) 2021-02-23

Family

ID=74607470

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011298683.5A Pending CN112395195A (en) 2020-11-19 2020-11-19 Method, device and equipment for processing automatic test data and storage medium

Country Status (1)

Country Link
CN (1) CN112395195A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113672602A (en) * 2021-08-02 2021-11-19 申瓯通信设备有限公司 Communication equipment based on digital scheduling
CN116755944A (en) * 2023-04-26 2023-09-15 宁畅信息产业(北京)有限公司 Server testing method and device, electronic equipment and storage medium
CN117332412A (en) * 2023-12-01 2024-01-02 北京知其安科技有限公司 Detection method and device for data security system and electronic equipment

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113672602A (en) * 2021-08-02 2021-11-19 申瓯通信设备有限公司 Communication equipment based on digital scheduling
CN116755944A (en) * 2023-04-26 2023-09-15 宁畅信息产业(北京)有限公司 Server testing method and device, electronic equipment and storage medium
CN117332412A (en) * 2023-12-01 2024-01-02 北京知其安科技有限公司 Detection method and device for data security system and electronic equipment
CN117332412B (en) * 2023-12-01 2024-03-15 北京知其安科技有限公司 Detection method and device for data security system and electronic equipment

Similar Documents

Publication Publication Date Title
CN112395195A (en) Method, device and equipment for processing automatic test data and storage medium
CN106681854B (en) Information verification method, device and system
US11119843B2 (en) Verifying application behavior based on distributed tracing
CN113254255B (en) Cloud platform log analysis method, system, device and medium
CN111027615A (en) Middleware fault early warning method and system based on machine learning
CN107223257B (en) Test method, test server and test system
WO2022001125A1 (en) Method, system and device for predicting storage failure in storage system
WO2021027126A1 (en) Database monitoring method, apparatus, device and computer-readable storage medium
CN111885001A (en) Abnormal login behavior recognition method, controller and medium
CN113761879B (en) Message format verification method, device and storage medium
CN116361147A (en) Method for positioning root cause of test case, device, equipment, medium and product thereof
CN113312258B (en) Interface testing method, device, equipment and storage medium
CN112632330A (en) Method and device for routing inspection of ATM equipment, computer equipment and storage medium
CN117807481A (en) Fault identification method, training device, training equipment and training medium
CN116643906B (en) Cloud platform fault processing method and device, electronic equipment and storage medium
CN111124809B (en) Test method and device for server sensor system
CN111090395B (en) Electronic information intelligent storage system for accounting industry
CN117081801A (en) Fingerprint identification method, device and medium for content management system of website
CN114676126B (en) Database-based data verification method, device, equipment and storage medium
CN110795308A (en) Server inspection method, device, equipment and storage medium
CN115186001A (en) Patch processing method and device
CN113037521A (en) Method for identifying state of communication equipment, communication system and storage medium
CN111953544B (en) Fault detection method, device, equipment and storage medium of server
CN116483377B (en) Code detection method and device, electronic equipment and storage medium
CN118796354A (en) Container system fault tracing method and device, electronic equipment and storage medium

Legal Events

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