CN112395194A - Method and device for accessing test platform - Google Patents

Method and device for accessing test platform Download PDF

Info

Publication number
CN112395194A
CN112395194A CN202011290396.XA CN202011290396A CN112395194A CN 112395194 A CN112395194 A CN 112395194A CN 202011290396 A CN202011290396 A CN 202011290396A CN 112395194 A CN112395194 A CN 112395194A
Authority
CN
China
Prior art keywords
component
test platform
access
interface
access data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011290396.XA
Other languages
Chinese (zh)
Other versions
CN112395194B (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.)
China Construction Bank Corp
Original Assignee
China Construction Bank Corp
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 China Construction Bank Corp filed Critical China Construction Bank Corp
Priority to CN202011290396.XA priority Critical patent/CN112395194B/en
Publication of CN112395194A publication Critical patent/CN112395194A/en
Application granted granted Critical
Publication of CN112395194B publication Critical patent/CN112395194B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3664Environments for testing or debugging software
    • 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

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 and a device for accessing a test platform, and relates to the technical field of computers. One embodiment of the method comprises: receiving an access request, wherein the access request indicates a component to be accessed and access data; checking whether the access data is matched with the standard parameters of the test platform; if so, accessing and operating the component according to the access data; if not, sending an interface standard file to the component, wherein the interface standard file comprises standard parameters of the test platform, so that the component returns access data matched with the standard parameters according to the standard parameters; and accessing and operating the components according to the access data. This embodiment makes the interface phase-match of subassembly interface and test platform, guarantees that the subassembly can insert test platform smoothly, has improved the efficiency of test.

Description

Method and device for accessing test platform
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for accessing a test platform.
Background
In the process of software development, many developers can adopt a testing platform, and after a component is newly developed each time, the component can be accessed into the testing platform, integrated with other developed components, and then compiled and tested by the testing platform, so that errors existing in software can be discovered as early as possible.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
because the developer usually adopts the test platform of the third party, the situation that the component interface written by the developer is not matched with the interface of the test platform of the third party often occurs, when the components developed by different developers need to be accessed on the same assembly line platform, the situation of the mismatch is more obvious, the components can not be accessed into the test platform at the moment, the test failure is further caused, and the test efficiency is reduced.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for accessing a test platform, where the test platform checks access data after receiving an access request and access data of a component, and accesses and operates the component according to the access data if the access data matches standard parameters of the test platform; if the access data are not matched with the standard parameters of the component after verification, the interface standard file is sent to the component, wherein the interface standard file contains the standard parameters of the test platform, so that the component returns the access data matched with the standard parameters, and the test platform accesses and operates the component according to the access data, so that the component interface is matched with the interface of the test platform, the component can be ensured to be smoothly accessed into the test platform, and the test efficiency is improved.
To achieve the above object, according to an aspect of an embodiment of the present invention, a method for accessing a test platform is provided.
The method for accessing the test platform comprises the following steps:
receiving an access request, wherein the access request indicates a component to be accessed and access data;
checking whether the access data is matched with the standard parameters of the test platform;
if so, accessing and operating the component according to the access data;
if not, sending an interface standard file to the component, wherein the interface standard file comprises standard parameters of the test platform, so that the component returns access data matched with the standard parameters according to the standard parameters; and accessing and operating the components according to the access data.
Alternatively,
accessing and operating the components according to the access data, including:
determining whether an operation strategy is appointed in the access data, if so, accessing and operating the component according to the appointed operation strategy; wherein, the operation strategy comprises the following steps: serial synchronous operation or serial asynchronous operation.
Alternatively,
when the operation strategy is serial synchronous operation, the test platform accesses the assembly and blocks other tasks;
and operating the component, acquiring the operating state of the component, and when the operating state indicates that the component is operated successfully, continuing to execute other tasks by the test platform.
Alternatively,
and when the running state indicates that the component fails to run, stopping running the test platform.
Alternatively,
when the operation strategy is serial asynchronous operation, after the test platform is connected to the component, the component is operated while other tasks are executed.
Alternatively,
after the test platform starts to operate the components, the operating state of the components is inquired by adopting a polling method;
and when the operation state is inquired to be the successful operation of the component, recording the operation result of the component.
Alternatively,
recording the operation result of the component, comprising:
performing online storage on the operation result, and displaying a storage path on a result page of the test platform so that a user can check the operation result according to the storage path; wherein the result page is used to show the storage path of the component.
Alternatively,
recording the operation result of the component, comprising:
storing the operation result in the local test platform, and displaying the operation result on a result page of the test platform; and the result page is used for displaying the operation result of the component.
Alternatively,
the access data also comprises: the access interface name of the component;
accessing and operating the components according to the access data, including:
calling an access interface corresponding to the access interface name according to the access interface name so as to access the component according to the access interface;
if the response duration of the access interface exceeds the first duration threshold, the component is marked as a response timeout and an optimization prompt is returned for the response duration.
Alternatively,
the method further comprises the following steps:
after receiving the response of the access interface, starting to record the operation duration of the component, and counting the average operation duration of other components on the test platform;
and when the difference value between the operation time length of the component and the average operation time length is larger than a second time length threshold value, marking the component as unstable and stopping operating the component.
Alternatively,
after receiving the response of the access interface, the method further comprises:
acquiring a code of the component, and compiling the code;
storing the codes and the binary system package obtained by compiling into the local test platform;
and calling an interface of the component to enable the component to download the binary package from the test platform in an http mode, and starting to operate according to the binary package.
Alternatively,
after accessing and running the component, the method further comprises:
calling a state interface according to a preset check period;
and when the results returned by calling the state interface twice continuously are both failures, marking the component as abnormal and stopping running the component.
Alternatively,
the test platform runs with a plurality of accessed components, and the access data further comprises: the access position and calling sequence of the components;
accessing and operating components comprising:
and according to the access position and the calling sequence, determining the access position and the running sequence of the component to be accessed, which correspond to the accessed component, and accessing and running the component according to the access position and the running sequence.
Alternatively,
the method further comprises the following steps:
generating a front-end page, wherein the front-end page comprises an identifier of the component so that a user generates a user instruction according to the identifier of the component;
receiving a user instruction, wherein the user instruction indicates the running sequence of the components;
and accessing and operating the components according to the operation sequence and the access data matched with the standard parameters and returned by the components.
Alternatively,
the interface standard file contains one or more of the following standard parameters: the system comprises a component name, an interface name, interface response time, running state, running progress, running result and extensible parameters.
To achieve the above object, according to still another aspect of the embodiments of the present invention, a test platform is provided.
The test platform of the embodiment of the invention comprises a request receiving module, a checking module and a component access module; wherein:
the device comprises a request receiving module, a data receiving module and a data transmitting module, wherein the request receiving module is used for receiving an access request which indicates a component to be accessed and access data;
the checking module is used for checking whether the access data is matched with the standard parameters of the test platform;
if so, the component access module is used for accessing and operating the component according to the access data; if not, the component access module is used for sending an interface standard file to the component, wherein the interface standard file comprises standard parameters of the test platform, so that the component returns access data matched with the standard parameters according to the standard parameters; and accessing and operating the components according to the access data.
To achieve the above object, according to another aspect of the embodiments of the present invention, a server for accessing a test platform is provided.
The server of the access test platform of the embodiment of the invention comprises: one or more processors; the storage device is used for storing one or more programs, and when the one or more programs are executed by one or more processors, the one or more processors implement the method for accessing the test platform according to the embodiment of the invention.
To achieve the above object, according to still another aspect of embodiments of the present invention, there is provided a computer-readable storage medium.
A computer-readable storage medium of an embodiment of the present invention stores thereon a computer program, and when the computer program is executed by a processor, the computer program implements a method for accessing a test platform of an embodiment of the present invention.
One embodiment of the above invention has the following advantages or benefits: after receiving an access request and access data of the component, the test platform verifies the access data, and if the access data is matched with standard parameters of the test platform, the test platform accesses and operates the component according to the access data; if the access data are not matched with the standard parameters of the component after verification, the interface standard file is sent to the component, wherein the interface standard file contains the standard parameters of the test platform, so that the component returns the access data matched with the standard parameters, and then the component is accessed and operated according to the access data, so that the component interface is matched with the interface of the test platform, the component can be ensured to be smoothly accessed into the test platform, and the test efficiency is improved.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
fig. 1 is a schematic diagram of main steps of a method for accessing a test platform according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of the main steps of a method of accessing and operating a component according to an embodiment of the invention;
FIG. 3 is a diagram illustrating the main steps of a method for accessing and operating a "for Security scanning component" according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of the main steps of a method for accessing and operating a "Sonar static scanning component" according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of the main steps of another method of accessing and operating a component according to an embodiment of the invention;
FIG. 6 is a schematic diagram of the main steps of a method of health checking a component according to an embodiment of the invention;
FIG. 7 is a schematic diagram of the major modules of a test platform according to an embodiment of the present invention;
FIG. 8 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 9 is a schematic structural diagram of a computer system suitable for implementing a terminal device or a server according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It should be noted that the embodiments of the present invention and the technical features of the embodiments may be combined with each other without conflict.
Fig. 1 is a schematic diagram of main steps of a method for accessing a test platform according to an embodiment of the present invention.
As shown in fig. 1, a method for accessing a test platform according to an embodiment of the present invention mainly includes the following steps:
step S101: receiving an access request, wherein the access request indicates a component to be accessed and access data;
step S102: checking whether the access data is matched with the standard parameters of the test platform, if not, executing a step S103, and if so, executing a step S104;
step S103: sending an interface standard file to the component, wherein the interface standard file comprises standard parameters of the test platform, so that the component returns access data matched with the standard parameters according to the standard parameters;
step S104: and accessing and operating the component according to the access data.
In the embodiment of the invention, the test platform can be a continuous integration pipeline, and can also be other platforms for software test, and the function of the test platform is to integrate developed components and then test the components in the software development process.
In the embodiment of the invention, the component to be accessed is accessed to the test platform through the interface, that is, the interface of the test platform has corresponding standard parameters, and the interface of the component to be accessed has corresponding access data. If the access data is matched with the standard parameters, the component can be successfully accessed to the test platform; if the access data is not matched with the standard parameters, the test platform cannot call the interface of the component, and the component cannot be accessed to the test platform. Therefore, in the embodiment of the invention, the test platform checks the access data of the component to be accessed, and if the access data obtained by checking is matched with the standard parameters of the test platform, the test platform directly accesses and operates the component according to the access data, so that the speed of accessing the test platform can be accelerated for the component which is accessed to the test platform before and the component developed by referring to the standard parameters of the test platform, and the test efficiency is further improved.
And if the access data obtained by verification is not matched with the standard parameters of the test platform, the test platform sends an interface standard file to the component. The interface standard file comprises standard parameters of the test platform, so that the component returns access data matched with the standard parameters according to the standard parameters, and the test platform accesses and operates the component according to the access data.
In an embodiment of the present invention, the interface standard file may include one or more of the following standard parameters: the system comprises a component name, an interface name, interface response time, running state, running progress, running result and extensible parameters. In a preferred embodiment of the present invention, the format of the interface standard file may be:
Figure BDA0002783649730000081
Figure BDA0002783649730000091
in addition, the interface standard file may further include standard parameters such as a physical subsystem name, a pipeline construction number, a version number, and a code path to explain a relevant situation of the test platform so as to facilitate access of the component, and the format of the interface standard file may be:
{
"pysicSysId"; ",// physical subsystem name
Build did
Version// version number
// code Path
}
In the embodiment of the invention, the access data of the component can be sent to the test platform in a json file form, and the test platform analyzes the json file to obtain the access data. The access data may or may not specify an operation policy. The test platform needs to determine whether an operation strategy is designated in the access data, if not, the components are accessed and operated according to the default operation strategy of the test platform; and if so, accessing and operating the component according to the operation strategy specified by the component to be accessed. The default operation strategy of the test platform and the operation strategy specified by the component to be accessed can be one of serial synchronous operation or serial asynchronous operation.
In the embodiment of the present invention, when the test platform determines that the operation policy is specified in the access data, a method for accessing and operating the component is as shown in fig. 2. Fig. 2 is a schematic diagram of the main steps of a method for accessing and operating a component according to an embodiment of the present invention, the method mainly comprising the following steps:
step S201: and analyzing the access data to obtain an operation strategy.
In the embodiment of the present invention, the operation policy may include: serial synchronous operation or serial asynchronous operation. Wherein, for the components which have short running time and have to pass the running process requirement, the running strategy is usually designated as serial synchronous running; for components that have long run times and do not require a pass through for the run flow, the run policy is typically specified as serial asynchronous operation.
Step S202: and when the operation strategy is serial asynchronous operation, after the test platform is connected to the component, the component is operated while other tasks are executed.
In the embodiment of the invention, when the operation strategy is serial asynchronous operation, the test platform can immediately execute the subsequent task after the component to be accessed is successfully accessed. And the newly accessed component can not be operated to block the test platform from operating other accessed components, and the subsequent return operation state of the newly accessed component does not influence the state of the test platform.
For example, as shown in the step of accessing and running the "fortify security scanning component" in fig. 3, after determining that the running policy of the fortify security scanning component is serial asynchronous running, the testing platform obtains the code of the component, performs unit testing on the component, compiles the code, and creates a scanning task on the testing platform when compiling is successful. The test platform continues to run other components and execute other tasks, but the scan result of the fortify cannot be seen by the test platform (because the scan is not completed), and usually, the scan result may still not be seen in the result page even though the test platform has finished testing in serial asynchronous running; and the result page is used for displaying the operation result of the component. The results of the scan are not shown in the results page until after the fortify scan is completed.
Step S203: when the operation policy is serial synchronous operation, the platform access component is tested, and other tasks are blocked, and step S204 is executed.
Step S204: the component is operated, the operating state of the component is obtained, and when the operating state indicates that the component is operated successfully, the test platform continues to execute other tasks; and when the running state indicates that the component fails to run, stopping running the test platform.
In the embodiment of the invention, when the operation strategy is serial synchronous operation, after the component to be accessed is successfully accessed, the test platform blocks subsequent tasks (including tasks of other components), and the test platform can not continue to execute the subsequent tasks until the tasks of the component are completed and the returned operation state indicates that the operation is successful.
For example, as shown in the step of accessing and running the "Sonar static scanning component" in fig. 4, after the running policy of the Sonar static scanning component is determined to be serial synchronous running, the test platform obtains the code of the component, performs unit test on the component, and compiles the code, and when compiling is successful, creates a scanning task on the test platform, and at this time, the test platform blocks subsequent tasks until the scanning task is completed and returns a scanning result. If the returned scanning result is successful, the code scanning is passed, the test platform continues to execute other tasks, and the scanning result can be seen in a result page at the moment, wherein the result page is used for showing the operation result of the component; if the returned scanning result is failure, which indicates that the code scanning is unqualified, the test platform does not allow subsequent operations such as deployment, and the like, can mark both the Sonar static scanning step and the state of the test platform as failure on the result page, and stop running the test platform.
In the embodiment of the invention, after the test platform starts to operate the component, the operating state of the component can be inquired by adopting a polling method; when the operation state is found to be < finish/abort >, the component is successfully operated, and the test platform can record the operation result of the component.
In the embodiment of the invention, the test platform can store the operation result in the local test platform and directly display the operation result on the result page of the test platform, wherein the result page is used for displaying the operation result of the component, so that the operation times of a user can be reduced and the user experience is improved.
In the embodiment of the invention, the test platform can also store the operation result of the component on line, and only the storage path is displayed on the result page of the test platform, so that a user can check the operation result according to the storage path, wherein the result page is used for displaying the storage path of the component, thus the occupation of resources of the test platform can be reduced, and the test platform is lighter.
In the embodiment of the invention, the storage time length of the operation result of the component can be set so as to clean the operation result at regular time, and the occupation of the resource of the test platform or the on-line storage resource is avoided.
In the embodiment of the present invention, the file size of the operation result of the component may be further limited, for example, for the above "fortify security scan component" and "Sonar static scan component", if the file is too large, the scan time may be greatly increased, so that in order not to affect the test effect of the test platform, the file size of the operation result of the "fortify security scan component" and the "Sonar static scan component" may be limited to not exceed 2G.
In addition to the operation policy, in the embodiment of the present invention, the access data may further include an access interface name of the component, and a method for accessing and operating the component at this time is shown in fig. 5. Fig. 5 is a schematic diagram of the main steps of another method of accessing and operating a component according to an embodiment of the present invention, the method mainly comprising the following steps:
step S501: and calling the access interface corresponding to the access interface name according to the access interface name so as to access the component according to the access interface.
Step S502: if the response time length of the access interface exceeds a first time length threshold value, the component is marked as response overtime, and an optimization prompt about the response time length is returned, so that a developer can conduct troubleshooting optimization on the component.
In the embodiment of the present invention, the first time threshold may be specified by the test platform, or may be specified by the access data, and this scheme is not specifically limited. In a preferred embodiment of the present invention, the first time threshold is 1 second, and if the response time for calling the access interface exceeds 1 second, the test platform returns an optimization prompt about the response time.
Step S503: and after receiving the response of the access interface, starting to record the running time of the component, and counting the average running time of other components on the test platform.
In the embodiment of the invention, after the response of the access interface is received, the test platform can run the component. Specifically, the method comprises the following steps: the test platform acquires a code of the component and compiles the code; storing the codes and the binary system package obtained by compiling into the local test platform; and calling an interface of the component so that the component downloads the binary package from the platform in an http mode and starts to operate according to the binary package.
Step S504: and when the difference value of the operation time length of the component and the average operation time length is larger than a second time length threshold value, marking the component as unstable and stopping operating the component.
In the embodiment of the invention, after the component is accessed and run, the test platform can limit the running time of the component, so that the running time of the component is recorded from the response of receiving the access interface. In a preferred embodiment of the present invention, the second duration threshold is equal to the average running duration, and the running duration of the component reaches twice the average running duration, which indicates that the component may have a problem, so that the test platform marks the component as unstable, so that the developer optimizes the component for inspection, and stops running the component, so as to prevent the component from occupying too many resources when the component runs too long.
In the embodiment of the present invention, after accessing and running the component, the test platform may further perform health check on the component, and at this time, the access data of the component needs to include a status interface. FIG. 6 is a schematic diagram of the main steps of a method of health checking a component according to an embodiment of the invention, the method mainly comprising the following steps:
step S601: calling a state interface according to a preset check period;
step S602: and when the results returned by calling the state interface twice continuously are both failures, marking the component as abnormal and stopping running the component.
In the embodiment of the invention, the mode that the test platform carries out health check on the component can also carry out judgment according to the response time of the state interface by calling the state interface, if the response time of the state interface is too long, the state of the component is also abnormal, the test platform is required to mark the component as abnormal, and the component is stopped running, so that a developer carries out examination and optimization on the component. The specific judgment criteria for the health examination are not specifically limited in this embodiment.
In the embodiment of the present invention, the names of the access interfaces, the names of the status interfaces, and the names of the other interfaces may be uniformly named in a "small hump type," that is, a first word is lower case, and the initials of the other words are upper case, for example: myApiName to facilitate management of the interface.
In the embodiment of the present invention, the test platform runs a plurality of accessed components, and the access data may further include: the access position and calling sequence of the components; at this time, the test platform may determine, according to the access position and the call sequence, an access position and an operation sequence of the component to be accessed, which correspond to the accessed component, and access and operate the component according to the determined access position and operation sequence.
In the embodiment of the invention, the test platform can also generate a front-end page, wherein the front-end page comprises the identifier of the component, so that a user generates a user instruction according to the identifier of the component; after the test platform receives the user instruction indicating the operation sequence of the components, the components can be accessed and operated according to the operation sequence and the access data matched with the standard parameters returned by the components, so that the user can self-define the arrangement of the test sequence of the components, the front-end page can contain the result page, the user can conveniently check the operation result of the components and the test condition of software, and the user experience is improved.
According to the method for accessing the test platform, disclosed by the embodiment of the invention, the test platform checks the access data after receiving the access request and the access data of the component, and accesses and operates the component according to the access data if the access data is matched with the standard parameters of the test platform after the test platform checks the access data; if the access data are not matched with the standard parameters of the component after verification, the interface standard file is sent to the component, wherein the interface standard file contains the standard parameters of the test platform, so that the component returns the access data matched with the standard parameters, and the test platform accesses and operates the component according to the access data, so that the component interface is matched with the interface of the test platform, the component can be ensured to be smoothly accessed into the test platform, and the test efficiency is improved.
FIG. 7 is a schematic diagram of the main modules of a test platform according to an embodiment of the invention.
As shown in fig. 7, a test platform 700 according to an embodiment of the present invention includes: a request receiving module 701, a checking module 702 and a component access module 703; wherein:
a request receiving module 701, configured to receive an access request, where the access request indicates a component to be accessed and access data;
a checking module 702, configured to check whether the access data matches a standard parameter of the test platform;
if so, the component access module 703 is configured to access and run the component according to the access data; if not, the component access module 703 is configured to send an interface standard file to the component, where the interface standard file includes standard parameters of the test platform, so that the component returns access data matched with the standard parameters according to the standard parameters; and accessing and operating the components according to the access data.
In this embodiment of the present invention, the component access module 703 is further configured to: determining whether an operation strategy is appointed in the access data, if so, accessing and operating the component according to the appointed operation strategy; wherein, the operation strategy comprises the following steps: serial synchronous operation or serial asynchronous operation.
In this embodiment of the present invention, the component access module 703 is further configured to: when the operation strategy is serial synchronous operation, the test platform accesses the assembly and blocks other tasks; and operating the component, acquiring the operating state of the component, and when the operating state indicates that the component is operated successfully, continuing to execute other tasks by the test platform.
In this embodiment of the present invention, the component access module 703 is further configured to: and when the running state indicates that the component fails to run, stopping running the test platform.
In this embodiment of the present invention, the component access module 703 is further configured to: when the operation strategy is serial asynchronous operation, after the test platform is connected to the component, the component is operated while other tasks are executed.
In this embodiment of the present invention, the component access module 703 is further configured to: after the test platform starts to operate the components, the operating state of the components is inquired by adopting a polling method; and when the operation state is inquired to be the successful operation of the component, recording the operation result of the component.
In this embodiment of the present invention, the component access module 703 is further configured to: performing online storage on the operation result, and displaying a storage path on a result page of the test platform so that a user can check the operation result according to the storage path; wherein the result page is used to show the storage path of the component.
In this embodiment of the present invention, the component access module 703 is further configured to: storing the operation result in the local test platform, and displaying the operation result on a result page of the test platform; and the result page is used for displaying the operation result of the component.
In the embodiment of the present invention, the access data further includes: the access interface name of the component; the component access module 703 is further configured to: calling an access interface corresponding to the access interface name according to the access interface name so as to access the component according to the access interface; if the response duration of the access interface exceeds the first duration threshold, the component is marked as a response timeout and an optimization prompt is returned for the response duration.
In this embodiment of the present invention, the component access module 703 is further configured to: after receiving the response of the access interface, starting to record the operation duration of the component, and counting the average operation duration of other components on the test platform; and when the difference value between the operation time length of the component and the average operation time length is larger than a second time length threshold value, marking the component as unstable and stopping operating the component.
In this embodiment of the present invention, after receiving the response of the access interface, the component access module 703 is further configured to: acquiring a code of the component, and compiling the code; storing the codes and the binary system package obtained by compiling into the local test platform; and calling an interface of the component to enable the component to download the binary package from the test platform in an http mode, and starting to operate according to the binary package.
In this embodiment of the present invention, after accessing and running the component, the component access module 703 is further configured to: calling a state interface according to a preset check period; and when the results returned by calling the state interface twice continuously are both failures, marking the component as abnormal and stopping running the component.
In the embodiment of the present invention, the test platform runs with a plurality of accessed components, and the access data further includes: the access position and calling sequence of the components; the component access module 703 is further configured to: and according to the access position and the calling sequence, determining the access position and the running sequence of the component to be accessed, which correspond to the accessed component, and accessing and running the component according to the access position and the running sequence.
In this embodiment of the present invention, the component access module 703 is further configured to: generating a front-end page, wherein the front-end page comprises an identifier of the component so that a user generates a user instruction according to the identifier of the component; receiving a user instruction, wherein the user instruction indicates the running sequence of the components; and accessing and operating the components according to the operation sequence and the access data matched with the standard parameters and returned by the components.
In an embodiment of the present invention, the interface standard file contains one or more of the following standard parameters: the system comprises a component name, an interface name, interface response time, running state, running progress, running result and extensible parameters.
According to the test platform provided by the embodiment of the invention, after receiving the access request and the access data of the component, the test platform verifies the access data, and if the verification shows that the access data is matched with the standard parameters of the test platform, the test platform accesses and operates the component according to the access data; if the access data are not matched with the standard parameters of the component after verification, the interface standard file is sent to the component, wherein the interface standard file contains the standard parameters of the test platform, so that the component returns the access data matched with the standard parameters, and the test platform accesses and operates the component according to the access data, so that the component interface is matched with the interface of the test platform, the component can be ensured to be smoothly accessed into the test platform, and the test efficiency is improved.
Fig. 8 shows an exemplary system architecture 800 of a test platform or a method of accessing a test platform to which embodiments of the invention may be applied.
As shown in fig. 8, the system architecture 800 may include terminal devices 801, 802, 803, a network 804, and a server 805. The network 804 serves to provide a medium for communication links between the terminal devices 801, 802, 803 and the server 805. Network 804 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 801, 802, 803 to interact with a server 805 over a network 804 to receive or send messages or the like. The terminal devices 801, 802, 803 may have installed thereon various communication client applications, such as shopping applications, web browser applications, search applications, instant messaging tools, mailbox clients, social platform software, and the like.
The terminal devices 801, 802, 803 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 805 may be a server that provides various services, such as a background management server that provides support for users to view results pages or front-end pages using the terminal devices 801, 802, 803. The background management server can analyze and process the received access data and feed back the processing result to the terminal equipment.
It should be noted that, the method for accessing the test platform provided by the embodiment of the present invention is generally executed by the server 805, and accordingly, a test platform is generally disposed in the server 805.
It should be understood that the number of terminal devices, networks, and servers in fig. 8 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 9, shown is a block diagram of a computer system 900 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 9 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 9, the computer system 900 includes a Central Processing Unit (CPU)901 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)902 or a program loaded from a storage section 908 into a Random Access Memory (RAM) 903. In the RAM 903, various programs and data necessary for the operation of the system 900 are also stored. The CPU 901, ROM 902, and RAM 903 are connected to each other via a bus 904. An input/output (I/O) interface 905 is also connected to bus 904.
The following components are connected to the I/O interface 905: an input portion 906 including a keyboard, a mouse, and the like; an output section 907 including components such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 908 including a hard disk and the like; and a communication section 909 including a network interface card such as a LAN card, a modem, or the like. The communication section 909 performs communication processing via a network such as the internet. The drive 910 is also connected to the I/O interface 905 as necessary. A removable medium 911 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 910 as necessary, so that a computer program read out therefrom is mounted into the storage section 908 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 909, and/or installed from the removable medium 911. The above-described functions defined in the system of the present invention are executed when the computer program is executed by a Central Processing Unit (CPU) 901.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, 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. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. 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, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a request receiving module, a verification module, and a component access module. The names of these modules do not in some cases form a limitation on the module itself, for example, the check module may also be described as a "module that checks whether the access data matches the standard parameters of the test platform".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: receiving an access request, wherein the access request indicates a component to be accessed and access data; checking whether the access data is matched with the standard parameters of the test platform; if so, accessing and operating the component according to the access data; if not, sending an interface standard file to the component, wherein the interface standard file comprises standard parameters of the test platform, so that the component returns access data matched with the standard parameters according to the standard parameters; and accessing and operating the components according to the access data.
According to the technical scheme of the embodiment of the invention, after receiving the access request and the access data of the component, the test platform verifies the access data, and if the access data is verified to be matched with the standard parameters of the test platform, the test platform accesses and operates the component according to the access data; if the access data are not matched with the standard parameters of the component after verification, the interface standard file is sent to the component, wherein the interface standard file contains the standard parameters of the test platform, so that the component returns the access data matched with the standard parameters, and the test platform accesses and operates the component according to the access data, so that the component interface is matched with the interface of the test platform, the component can be ensured to be smoothly accessed into the test platform, and the test efficiency is improved.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (18)

1. A method for accessing a test platform, comprising:
receiving an access request, wherein the access request indicates a component to be accessed and access data;
checking whether the access data is matched with standard parameters of the test platform;
if so, accessing and operating the component according to the access data;
if not, sending an interface standard file to the component, wherein the interface standard file comprises standard parameters of the test platform, so that the component returns access data matched with the standard parameters according to the standard parameters; and accessing and operating the component according to the access data.
2. The method of claim 1, wherein accessing and operating the component according to the access data comprises:
determining whether an operation strategy is appointed in the access data, if so, accessing and operating the component according to the appointed operation strategy; wherein the specifying the operation policy comprises: serial synchronous operation or serial asynchronous operation.
3. The method of claim 2, wherein when the operational policy is serial synchronous operation, the test platform accesses the component and blocks other tasks;
and operating the component, acquiring the operating state of the component, and when the operating state indicates that the component is operated successfully, continuing to execute the other tasks by the test platform.
4. The method of claim 3, wherein the test platform ceases operation when the operational status indicates a failure of the component to operate.
5. The method of claim 2, wherein when the runtime policy is serial asynchronous runtime, the test platform accesses the component and runs the component while performing other tasks.
6. The method according to claim 3 or 5,
after the test platform starts to operate the component, inquiring the operation state of the component by adopting a polling method;
and when the operation state is inquired to be the successful operation of the component, recording the operation result of the component.
7. The method of claim 6, wherein said recording results of the operation of the component comprises:
storing the running result on line, and displaying the storage path on a result page of the test platform so that a user can view the running result according to the storage path; wherein the result page is used for showing the storage path of the component.
8. The method of claim 6, wherein said recording results of the operation of the component comprises:
storing the operation result in the local test platform, and displaying the operation result on a result page of the test platform; and the result page is used for displaying the operation result of the component.
9. The method of claim 1, wherein the access data further comprises: an access interface name of the component;
accessing and operating the component according to the access data comprises:
calling an access interface corresponding to the access interface name according to the access interface name so as to access the component according to the access interface;
if the response time of the access interface exceeds a first time threshold, the component is marked as response overtime, and an optimization prompt about the response time is returned.
10. The method of claim 9, further comprising:
after receiving the response of the access interface, starting to record the running time of the component, and counting the average running time of other components on the test platform;
and when the difference value between the operation time length of the component and the average operation time length is larger than a second time length threshold value, marking the component as unstable and stopping operating the component.
11. The method of claim 10, wherein after receiving the response from the access interface, the method further comprises:
acquiring a code of the component, and compiling the code;
storing the code and the compiled binary package in the local test platform;
and calling an interface of the component to enable the component to download the binary package from the test platform in an http mode, and starting to operate according to the binary package.
12. The method of claim 1, wherein after said accessing and running said component, the method further comprises:
calling a state interface according to a preset check period;
and when the results returned by calling the state interface twice continuously are both failures, marking the component as abnormal and stopping running the component.
13. The method of claim 1, wherein the test platform runs a plurality of accessed components, and the access data further comprises: the access position and the calling sequence of the components;
the accessing and operating the component includes:
and determining the access position and the operation sequence of the component to be accessed corresponding to the accessed component according to the access position and the calling sequence, and accessing and operating the component according to the access position and the operation sequence.
14. The method of claim 1 or 13, further comprising:
generating a front-end page, wherein the front-end page comprises the identifier of the component, so that a user generates a user instruction according to the identifier of the component;
receiving the user instruction, wherein the user instruction indicates the running sequence of the components;
and accessing and operating the component according to the operation sequence and the access data matched with the standard parameters returned by the component.
15. The method of claim 1, wherein the interface standard file contains one or more of the following standard parameters: the system comprises a component name, an interface name, interface response time, running state, running progress, running result and extensible parameters.
16. A test platform is characterized by comprising a request receiving module, a checking module and a component access module; wherein:
the request receiving module is used for receiving an access request, and the access request indicates a component to be accessed and access data;
the checking module is used for checking whether the access data is matched with the standard parameters of the test platform;
if yes, the component access module is used for accessing and operating the component according to the access data; if not, the component access module is used for sending an interface standard file to the component, wherein the interface standard file comprises standard parameters of the test platform, so that the component returns access data matched with the standard parameters according to the standard parameters; and accessing and operating the component according to the access data.
17. A server for accessing a test platform, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-15.
18. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-15.
CN202011290396.XA 2020-11-17 2020-11-17 Method and device for accessing test platform Active CN112395194B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011290396.XA CN112395194B (en) 2020-11-17 2020-11-17 Method and device for accessing test platform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011290396.XA CN112395194B (en) 2020-11-17 2020-11-17 Method and device for accessing test platform

Publications (2)

Publication Number Publication Date
CN112395194A true CN112395194A (en) 2021-02-23
CN112395194B CN112395194B (en) 2024-03-22

Family

ID=74607207

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011290396.XA Active CN112395194B (en) 2020-11-17 2020-11-17 Method and device for accessing test platform

Country Status (1)

Country Link
CN (1) CN112395194B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113704016A (en) * 2021-08-26 2021-11-26 北京百度网讯科技有限公司 Cloud function component diagnosis method, device, equipment, storage medium and program product

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6662312B1 (en) * 2000-06-30 2003-12-09 Qwest Communications International Inc. Software-testing automation system
CN109902026A (en) * 2019-03-27 2019-06-18 北京奇艺世纪科技有限公司 A kind of processing method and test platform of interface testing information
CN110046088A (en) * 2019-02-19 2019-07-23 阿里巴巴集团控股有限公司 A kind of interface test method, device and equipment
CN110275831A (en) * 2019-06-18 2019-09-24 广州华多网络科技有限公司 The mock data verification method and device of protocol interface
CN111045921A (en) * 2019-10-12 2020-04-21 平安普惠企业管理有限公司 Automatic interface testing method and device, computer equipment and storage medium
CN111258832A (en) * 2020-01-22 2020-06-09 泰康保险集团股份有限公司 Interface parameter checking method, device, equipment and medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6662312B1 (en) * 2000-06-30 2003-12-09 Qwest Communications International Inc. Software-testing automation system
CN110046088A (en) * 2019-02-19 2019-07-23 阿里巴巴集团控股有限公司 A kind of interface test method, device and equipment
CN109902026A (en) * 2019-03-27 2019-06-18 北京奇艺世纪科技有限公司 A kind of processing method and test platform of interface testing information
CN110275831A (en) * 2019-06-18 2019-09-24 广州华多网络科技有限公司 The mock data verification method and device of protocol interface
CN111045921A (en) * 2019-10-12 2020-04-21 平安普惠企业管理有限公司 Automatic interface testing method and device, computer equipment and storage medium
CN111258832A (en) * 2020-01-22 2020-06-09 泰康保险集团股份有限公司 Interface parameter checking method, device, equipment and medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113704016A (en) * 2021-08-26 2021-11-26 北京百度网讯科技有限公司 Cloud function component diagnosis method, device, equipment, storage medium and program product
CN113704016B (en) * 2021-08-26 2023-07-28 北京百度网讯科技有限公司 Cloud function component diagnosis method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN112395194B (en) 2024-03-22

Similar Documents

Publication Publication Date Title
CN111090423B (en) Webhook framework system and method for realizing active calling and event triggering
CN113900834B (en) Data processing method, device, equipment and storage medium based on Internet of things technology
CN110007936B (en) Data processing method and device
CN111580882A (en) Application program starting method, device, computer system and medium
CN111414154A (en) Method and device for front-end development, electronic equipment and storage medium
CN112395194B (en) Method and device for accessing test platform
CN113191889A (en) Wind control configuration method, configuration system, electronic device and readable storage medium
CN114610446B (en) Method, device and system for automatically injecting probe
CN110806967A (en) Unit testing method and device
CN113407229B (en) Method and device for generating offline scripts
CN112783903B (en) Method and device for generating update log
CN114020513A (en) Method and device for processing log information
CN108287792B (en) Method and apparatus for outputting information
CN113312900A (en) Data verification method and device
CN113535568A (en) Verification method, device, equipment and medium for application deployment version
CN111176718A (en) Script online method and device, storage medium and electronic equipment
CN112068814A (en) Method, device, system and medium for generating executable file
CN112860447A (en) Interaction method and system between different applications
CN112749073B (en) Service testing method and device, storage medium and electronic equipment
CN113342633B (en) Performance test method and device
CN111125676B (en) Joint authorization method and device
CN112783753B (en) Testing method and device for stream data processing system
CN113590483A (en) Case operation method and device
CN115686911A (en) Server-side self-checking method and device, electronic equipment and storage medium
CN113900652A (en) Automatic conversion method, device, equipment, medium and product of comparison test script

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