CN112214413B - Application program testing method, device, equipment and storage medium - Google Patents

Application program testing method, device, equipment and storage medium Download PDF

Info

Publication number
CN112214413B
CN112214413B CN202011166639.9A CN202011166639A CN112214413B CN 112214413 B CN112214413 B CN 112214413B CN 202011166639 A CN202011166639 A CN 202011166639A CN 112214413 B CN112214413 B CN 112214413B
Authority
CN
China
Prior art keywords
test
target
equipment
identifier
application program
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011166639.9A
Other languages
Chinese (zh)
Other versions
CN112214413A (en
Inventor
曾磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202011166639.9A priority Critical patent/CN112214413B/en
Publication of CN112214413A publication Critical patent/CN112214413A/en
Application granted granted Critical
Publication of CN112214413B publication Critical patent/CN112214413B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • G06F9/4451User profiles; Roaming
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The disclosure provides a method, a device, equipment and a storage medium for testing an application program, and relates to the technical field of data processing, wherein the method comprises the following steps: responding to an application program test request carrying a test server identifier, and determining a target test server corresponding to the test server identifier; the target test server runs in the target container; acquiring a first equipment identifier in a configuration file of a target container, and driving first test equipment corresponding to the first equipment identifier by utilizing a target test server to test a target application program; when abnormality of the first test equipment is detected, updating a first equipment identifier in the configuration file into a newly acquired second equipment identifier; and driving second testing equipment corresponding to the second equipment identifier by using the target testing server to test the target application program. The method and the device can effectively reduce the waste of test resources and improve the problem that the test flow of the application program is influenced due to the interruption of the test process.

Description

Application program testing method, device, equipment and storage medium
Technical Field
The disclosure relates to the technical field of data processing, and in particular relates to a test method, a test device, test equipment and a storage medium of an application program.
Background
Today, to ensure that applications loaded on mobile terminals can function properly, automated testing for applications is becoming increasingly popular. At present, testing equipment such as a mobile phone is mainly used for testing an application program.
During the testing process of the application program, the testing equipment is easy to be abnormal so as to influence the testing flow; therefore, the traditional function test for application in the mobile terminal is mainly based on the idea of equipment redundancy, namely, testing the same type of application program by utilizing a plurality of test equipment at the same time. However, the application program test is realized in a device redundancy mode, so that excessive test devices are obviously occupied, and the waste of test resources is undoubtedly caused.
Disclosure of Invention
In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a method, an apparatus, a device, and a storage medium for testing an application program.
The present disclosure provides a method for testing an application program, the method comprising: responding to an application program test request carrying a test server identifier, and determining a target test server corresponding to the test server identifier; the target test server runs in a target container; acquiring a first equipment identifier in a configuration file of the target container, and driving first test equipment corresponding to the first equipment identifier by utilizing the target test server to test a target application program; when the first test equipment is detected to be abnormal, a second equipment identifier is obtained from available test equipment identifiers corresponding to the target container, and the first equipment identifier in the configuration file is updated to the second equipment identifier; and driving second testing equipment corresponding to the second equipment identifier by using the target testing server to test the target application program.
Optionally, after the obtaining the second device identifier and before the updating the first device identifier in the configuration file to the second device identifier, the method further includes: executing the pre-script of the target application program aiming at the second test equipment corresponding to the second equipment identifier; the pre-script is used for realizing pre-stage operation of the target application program, and the pre-stage operation comprises any one or more operations of installing the target application program, initializing resources and logging in an account.
Optionally, before the second device identifier is obtained from the available test device identifiers corresponding to the target container, the method further includes: when monitoring a universal serial bus device insertion message on a test host for deploying the target container, acquiring a device identifier of a current inserted device, and determining the device identifier as an available test device identifier corresponding to the target container; or when the universal serial bus device unplugging message on the test host for deploying the target container is monitored, acquiring the device identifier of the current unplugged device, and deleting the device identifier from the available test device identifiers corresponding to the target container.
Optionally, when detecting that the first test device is abnormal, acquiring a second device identifier from available test device identifiers corresponding to the target container includes: when the first test equipment is detected to be abnormal, the identification of the equipment with the same preset attribute as the first test equipment is obtained from the available test equipment identifications corresponding to the target container and is used as a second equipment identification.
Optionally, the method further comprises: and sending heartbeat connection to the first test equipment by using the target test server, and determining whether the first test equipment is abnormal or not based on the heartbeat connection result.
Optionally, the target container has a one-to-one correspondence with the target test server.
Optionally, the service end identifier includes an internet protocol address and a port number; the determining, in response to an application program test request carrying a test server identifier, a target test server corresponding to the test server identifier includes: responding to an application program test request carrying an Internet protocol address and a port number, and determining a test host corresponding to the Internet protocol address; determining a target test server corresponding to the port number in the test host; the target test server operates in a target container deployed on the test host.
The present disclosure also provides a test device for an application program, the device including: the server determining module is used for responding to an application program test request carrying a test server identifier and determining a target test server corresponding to the test server identifier; the target test server runs in a target container; the first equipment identifier acquisition module is used for acquiring a first equipment identifier in the configuration file of the target container, and driving first test equipment corresponding to the first equipment identifier by utilizing the target test server to test a target application program; the second equipment identifier obtaining module is used for obtaining a second equipment identifier from available test equipment identifiers corresponding to the target container when the first test equipment is detected to be abnormal, and updating the first equipment identifier in the configuration file into the second equipment identifier; and the program test module is used for driving the second test equipment corresponding to the second equipment identifier to test the target application program by using the target test server.
The disclosure also provides a computer readable storage medium having instructions stored therein that, when executed on a terminal device, cause the terminal device to implement the method for testing an application program described above.
The present disclosure also provides an apparatus comprising: the test device comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, wherein the test method of the application program is realized when the processor executes the computer program.
Compared with the prior art, the technical scheme provided by the embodiment of the disclosure has the following advantages:
the embodiment of the disclosure provides a method, a device, equipment and a storage medium for testing an application program, wherein the method comprises the following steps: firstly, responding to an application program test request carrying a test server identifier, and determining a target test server corresponding to the test server identifier, wherein the target test server runs in a target container; and then, acquiring a first equipment identifier in the configuration file of the target container, and driving first testing equipment corresponding to the first equipment identifier by utilizing the target testing server to test the target application program. When abnormality of the first test equipment is detected, acquiring a second equipment identifier from available test equipment identifiers corresponding to the target container, and updating the first equipment identifier in the configuration file into the second equipment identifier; and driving second testing equipment corresponding to the second equipment identifier by using the target testing server to test the target application program. In the above test manner, the target test server runs in the target container, and the configuration file of the container is generally used to save the device identifier of the available device mounted on the container; therefore, after the target test server is determined based on the test server identifier, the test device driven by the target test server can be determined based on the device identifier in the configuration file, so that the test of the target application program is completed. Obviously, according to the test mode provided by the invention, only one test device is occupied at the same time point, a plurality of test devices are not required to be occupied at the same time, and the waste of test resources is reduced.
Further, considering that the configuration file of the container is modifiable, in case of abnormality of the first test device, the first test device may be replaced by an available second test device by updating the device identifier in the configuration file of the target container, and then the second test device is used to test the target application program; therefore, the application program testing method provided by the disclosure can effectively solve the problem that the application program testing flow is influenced due to the interruption of the testing process on the basis of reducing the waste of testing resources.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments of the present disclosure or the solutions in the prior art, the drawings that are required for the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1A is a schematic diagram of a test platform according to an embodiment of the disclosure;
FIG. 1B is a flow chart of a method of testing an application according to an embodiment of the present disclosure;
FIG. 2 is a flow chart of a test equipment update method according to an embodiment of the present disclosure;
FIG. 3 is a block diagram of a test device for an application according to an embodiment of the present disclosure;
fig. 4 is a block diagram of an apparatus according to an embodiment of the present disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, a further description of aspects of the present disclosure will be provided below. It should be noted that, without conflict, the embodiments of the present disclosure and features in the embodiments may be combined with each other.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced otherwise than as described herein; it will be apparent that the embodiments in the specification are only some, but not all, embodiments of the disclosure.
In the process of automated testing of applications in mobile terminals, the inventors have studied and found that anomalies in the test equipment, such as seizing, popup of application unresponsive (Application Not Responding; ANR) dialogs, shutdown of the running process, etc., are easily caused by the long-term operation of the test equipment, etc. Once the test equipment is abnormal, the test process of the application program is interrupted, and the test flow of the application program is affected.
For this reason, testing is currently performed in two main ways:
one way is based on the idea of device redundancy, i.e. testing the same type of application program by using multiple test devices at the same time, and if only one test device can successfully complete the test process, then the test for the application program is successful. However, the application program test is realized in a device redundancy mode, so that excessive test devices are obviously occupied, and the waste of test resources is undoubtedly caused.
The other mode is based on a task distribution thought, the test task is divided into a plurality of subtasks in advance, each test device only executes one subtask through scheduling, and the success of the test of the application program is determined when all the subtasks are successfully executed and completed. However, when an abnormality occurs in a device that performs a certain subtask, the test cannot be resumed, and it is also necessary for the user to know which device is abnormal, to reschedule a new test device to re-perform the subtask.
In view of this, in order to improve at least one of the above problems, embodiments of the present disclosure provide a method, an apparatus, a device, and a storage medium for testing an application program, and in order to facilitate understanding, the embodiments of the present disclosure are described in detail below.
Embodiment one:
the embodiment of the disclosure provides a test method for an application program, which may be implemented on a test platform, for example, referring to fig. 1A, where the test platform may be at least deployed with a test host, a container, a test server, and a test device.
In practical application, the containers can be deployed on a test host, and at least one container is deployed on one test host; the test server can run in a container, and a plurality of test devices can be mounted on the container.
Referring to the flowchart of the test method of the application program shown in fig. 1B, the method may include the steps of:
step S102, a target test server corresponding to the test server identifier is determined in response to an application program test request carrying the test server identifier; the target test server operates in the target container.
In an application scenario of executing application program testing, when there is only one test host, the test server identifier may be a port number of the test server (ADB-server), based on which, in response to an application program test request carrying the port number, a target test server corresponding to the port number in the test host may be determined. When there are multiple test hosts, referring to the solid line part in fig. 1A, the test server identifier may include an IP (internet protocol) address and a port number, based on which, first, the test host corresponding to the IP address may be determined in response to an application program test request carrying the IP address and the port number; and then determining a target test server corresponding to the port number in the test host.
Step S104, a first equipment identifier in a configuration file of the target container is obtained, and a target test server is utilized to drive first test equipment corresponding to the first equipment identifier to test the target application program.
In practical application, resource allocation and management in a container (dock) depend on a configuration file, wherein the configuration file is a file generated by configuring available equipment corresponding to the container in advance by a user. Thus, parameters of available devices that are mounted on the target container may be included in the configuration file, including device identification. The device identifier is a unique and unchanged identifier for representing the test device, taking the mobile phone as the test device as an example, the device identifier can comprise a main attribute value and a slave attribute value of the mobile phone, wherein the main attribute value is used for representing the type of the mobile phone, and the slave attribute value is used for distinguishing different mobile phones under the same mobile phone type.
When a target test server corresponding to the test server identifier is determined, a target container of the running target test server can be determined, and then a first equipment identifier stored in a configuration file is obtained by reading the configuration file of the target container; and then, driving the first test equipment (such as the test equipment 1 in fig. 1A) corresponding to the first equipment identifier by using the target test service end to test the target application program.
And step S106, when the first test equipment is detected to be abnormal, acquiring a second equipment identifier from the available test equipment identifiers corresponding to the target container, and updating the first equipment identifier in the configuration file into the second equipment identifier.
In consideration of the fact that during the testing process of the application program, the first testing equipment is possibly abnormal, and the application program testing process is interrupted, the application program testing flow is affected. Based on this, this embodiment can detect first test equipment to when detecting first test equipment and taking place the unusual, in time change to second test equipment, guarantee that test flow is continuous, stable going on. In this embodiment, there may be multiple available test device identifiers corresponding to the target container, one may be designated as the second device identifier, and the first device identifier in the configuration file is updated to the selected second device identifier.
Step S108, using the target test server to drive the second test device (such as the test device 2 in fig. 1A) corresponding to the second device identifier to test the target application program.
In this embodiment, the first test device corresponding to the first device identifier may include at least one test device; the target test server is a service process which runs in the background all the time, and drives the first test equipment to test the target application program based on the application program test request.
The method for testing the application program provided by the embodiment of the disclosure includes the steps of firstly, responding to an application program test request carrying a test server identifier, determining a target test server corresponding to the test server identifier, wherein the target test server runs in a target container; and then, acquiring a first equipment identifier in the configuration file of the target container, and driving first testing equipment corresponding to the first equipment identifier by utilizing the target testing server to test the target application program. And when the first test equipment is detected to be abnormal, acquiring a second equipment identifier from the available test equipment identifiers corresponding to the target container, updating the first equipment identifier in the configuration file into the second equipment identifier, and using the target test server to drive the second test equipment corresponding to the second equipment identifier to test the target application program.
In the above test manner, the target test server runs in the target container, and the configuration file of the container is generally used to save the device identifier of the available device mounted on the container; therefore, after the target test server is determined based on the test server identifier, the test device driven by the target test server can be determined based on the device identifier in the configuration file, so that the test of the target application program is completed. Obviously, according to the test mode provided by the invention, only one test device is occupied at the same time point, a plurality of test devices are not required to be occupied at the same time, and the waste of test resources is reduced. Further, considering that the configuration file of the container is modifiable, in case of abnormality of the first test device, the first test device may be replaced by a second test device by updating the device identifier in the configuration file, and then the second test device is used to test the target application program; therefore, the application program testing method provided by the disclosure can effectively solve the problem that the application program testing flow is influenced due to the interruption of the testing process on the basis of reducing the waste of testing resources.
In order to better understand the testing method of the application program provided by the embodiment of the present disclosure, a detailed description is developed below for implementation of each step.
For the above step S102, the application test request may be initiated by the user through a client (ADB-devices), which may be created from the IP address and the port number, for example, refer to the following code: client=adbclient (host=host, port=port).
The client transmits an application program test request to the test platform; and the test platform determines a target test server according to the application program test request and the port number and the IP address carried by the application program test request.
In a specific implementation, the following codes may be used: the adb-a-P$ PORT server nodaemon &, and the target test server side realizes external service; on the client, an ADB (Android Debug Bridge ) tool is used for enabling the target test server to process an application program test request of the client by using an ADB-H$P1_ip-P$PORTshall, and the first test equipment is driven to test the target application program. The version of the ADB tool used by the client is the same as that used by the target test server.
And further determining first test equipment mounted on the target container where the target test server is located, and using the target test server to drive the first test equipment to test the target application program.
The client interacts with the target test server and transmits an application program test request to the target test server. In the prior art, a plurality of test devices are connected with each other by a test server. The more the test devices are in butt joint with the test server, the higher the probability of the test server being disconnected; based on this, in this embodiment, each test server is operated in an isolated container, that is, the target container has a one-to-one correspondence with the target test server, and each test server interfaces with a smaller number of test devices, such as only one test device.
Taking one test device for each test server to be docked, one test device for each test server to be docked is realized through a container, and it can be understood that only one available test device for docking with the target test server is bound in each container at any time. Based on this, the present embodiment provides a possible implementation of binding the test device to the container, as shown with reference to the following steps (1) and (2).
(1) All test devices connected on USB (Universal Serial Bus ) were mounted in the target container with reference to the following code:
docker run--rm-d-v/dev/bus/usb:/dev/bus/usb--net host--name adb$PORT_NUM hub.byted.org/toutiao.stf.adb:latest adb-a-P$PORT_NUM server nodaemon。
and selecting the replaced available test equipment from the other test equipment under the condition that the first test equipment is abnormal.
(2) Configuring a first device identifier in a configuration file of a target container; wherein the first device identification is one or more of the available test device identifications that are mounted under the target container.
In one embodiment, activity detection is performed on a plurality of test devices to obtain the available test devices and the identifiers of each available test device, namely, the available test device identifiers corresponding to the target container; and then designating a first equipment identifier from the available test equipment identifiers, and configuring the first equipment identifier in a configuration file of the container. So far, the first test equipment corresponding to the first equipment identifier can be bound to the target container.
Specifically, when the test device is a mobile phone, the device identifier may include a primary attribute value (major) and a secondary attribute value (minor), where the major of the mobile phone is generally 189, which represents the type of the mobile phone, and the minor is used to distinguish different mobile phones. And carrying out configuration shown by the following codes in the configuration file of the container according to the acquired major and minor of the mobile phone:
1#device.allow
2c 189:*rwm#if config like this,will allow all smart phone load in docker
3c 189:25rwm#if config like this,will only allow one phone with mior 25load in docker
the mobile phone determined by major and minor can be bound in the container.
For the available test device identifier in the above embodiment, the available test device identifier may be obtained in advance through a write operation and/or a delete operation, and specifically reference may be made to the following manner:
when a USB device insertion message on a test host for deploying the target container is monitored, acquiring a device identifier of the current insertion device, and determining the device identifier as an available test device identifier corresponding to the target container; or when the USB equipment unplugging message on the test host for deploying the target container is monitored, acquiring the equipment identifier of the current unplugged equipment, and deleting the equipment identifier from the available test equipment identifiers corresponding to the target container.
When a USB device insertion message or a USB device extraction message on a test host for deploying a target container is monitored, a loading Path (mount Path) of the test device is obtained, and then a major and a minor of the mobile phone are obtained through the loading Path.
Then, a device identifier can be randomly designated in the available test device identifiers corresponding to the target container, and the device identifier is used as a first device identifier and is configured in the configuration file of the target container. It will be appreciated that, for the updated second device identifier, the same manner may be adopted to obtain and configure the second device identifier from the available test device identifier corresponding to the target container in the configuration file of the target container.
In the test process of the application program, the first test equipment can be detected, so that when the first test equipment is abnormal, the second test equipment can be replaced in time, and the continuous and stable test flow is ensured. Based on this, the present embodiment provides a detection method of a test apparatus, referring to the following:
and sending heartbeat connection to the first test equipment by using the target test server, and determining whether the first test equipment is abnormal or not based on the heartbeat connection result.
In this embodiment, the target test server sends an ADB-p$port shell pwd to the first test device as a heartbeat connection according to a preset period (e.g., 30 seconds); if the first test equipment can respond normally, the first test equipment is not abnormal; if the first test equipment cannot respond normally, the first test equipment is abnormal, and the first test equipment needs to be replaced by other available test equipment and is bound in the target container.
When an abnormality of the first test device is detected, referring to fig. 2, the method for updating the first test device to the second test device may include the following steps:
step S202, when detecting that the first test equipment is abnormal, acquiring a second equipment identifier from available test equipment identifiers corresponding to the target container.
In practical applications, the user may have a personalized requirement on the attribute of the test device, for example, only test the application program for a certain type of mobile phone, and the types (i.e. the main attribute values) of the mobile phones before and after the user needs to be replaced are the same; in this case, when it is detected that the first test device is abnormal, the identifier of the device having the same preset attribute as the first test device is acquired as the second device identifier from the available test device identifiers corresponding to the target container.
Specifically, firstly, a preset attribute of a user to test equipment is obtained; preset attributes such as cell phone type or cell phone brand. And then determining a second equipment identifier of the equipment with the same preset attribute as the first testing equipment in the available testing equipment identifiers corresponding to the target container according to the pre-established mapping relation. The mapping relation is used for representing the corresponding relation between the equipment identifier of the test equipment and the preset attribute; taking a mobile phone as an example, the mapping relationship may be a mapping relationship between a dependency value of the mobile phone and a mobile phone type, which is established when the mobile phone is inserted into the container through the USB.
After the second device identification is acquired, the following step S204 is performed.
Step S204, executing a pre-script of the target application program aiming at the second test equipment corresponding to the second equipment identifier; the pre-script is used to implement a pre-stage operation of the target application program, where the pre-stage operation may at least include: installing any one or more of a target application, initializing a resource, and logging into an account; and the pre-script is executed before updating the second test device.
In this embodiment, the timeout period (for example, 30 minutes) of the pre-script may be set, and after the timeout period is reached, the first test device is replaced with the second test device, so as to ensure that the pre-operation after the replacement of the second test device is all completed.
Step S206, the first device identification in the configuration file is updated to the second device identification. And then, driving a second testing device corresponding to the second device identifier by using the target testing server to test the target application program.
In the replacing manner of the test device provided in this embodiment, since the replaced second device identifier belongs to the available test device identifier corresponding to the target container, the second test device corresponding to the second device identifier is necessarily available for testing.
In the above embodiment, the detection of the test device is performed between the target test server and the test device, the replacement of the test device is performed on the target container, and none of the above processes is exposed to the user; therefore, the user does not need to care which test equipment is the test equipment, and does not need to care whether the plurality of test equipment mounted on the container has the abnormal conditions of shutdown, disconnection, death, offline and the like. The test platform can rapidly determine the target test server and the available test equipment (the available test equipment, namely the first test equipment or the updated second test equipment) after receiving an application program test request which is initiated by a user and carries the IP address and the port number by providing the IP address and the port number for the user, and directly drives the determined available test equipment by utilizing the target test server to test the target application program.
In summary, according to the method for testing an application program provided in the foregoing embodiment, based on an application program test request carrying a test server identifier, a target test server may be directly determined, and the target test server may be used to drive a first test device to test a target application program. Obviously, the above test mode provided by the present disclosure does not need to occupy multiple test devices at the same time, so that the waste of test resources is reduced. Next, in the testing process of the application program, considering that the configuration file of the container is modifiable, when the first testing device is abnormal, the first testing device can be replaced by a second available testing device by modifying the device identification mode in the configuration file of the target container, and then the second testing device is used for testing the target application program; therefore, the application program testing method provided by the disclosure can effectively solve the problem that the application program testing flow is influenced due to the interruption of the testing process on the basis of reducing the waste of testing resources.
Embodiment two:
the present embodiment provides an application program testing apparatus for implementing the application program testing method in the first embodiment. Referring to fig. 3, the apparatus includes:
the server determining module 302 is configured to determine, in response to an application program test request carrying a test server identifier, a target test server corresponding to the test server identifier; the target test server runs in the target container;
the first device identifier obtaining module 304 is configured to obtain a first device identifier in a configuration file of the target container, and drive a first test device corresponding to the first device identifier to test the target application program by using the target test server;
the second device identifier obtaining module 306 is configured to obtain a second device identifier from available test device identifiers corresponding to the target container when an abnormality occurs in the first test device, and update the first device identifier in the configuration file to the second device identifier;
and the program testing module 308 is configured to utilize the target testing server to drive the second testing device corresponding to the second device identifier to test the target application program.
According to the application program testing device provided by the embodiment of the disclosure, the target testing server can be determined based on the testing server identification, and the target testing server is utilized to directly drive available testing equipment to test the target application program. In the test mode, only one test device is occupied at the same time point, a plurality of test devices are not required to be occupied at the same time, and waste of test resources is reduced. Further, considering that the configuration file of the container is modifiable, in case of abnormality of the first test device, the first test device may be replaced by an available second test device by updating the device identifier in the configuration file of the target container, and then the second test device is used to test the target application program; therefore, the application program testing method provided by the disclosure can effectively solve the problem that the application program testing flow is influenced due to the interruption of the testing process on the basis of reducing the waste of testing resources.
In one embodiment, the second device identification acquisition module 306 is further configured to: executing a pre-script of the target application program aiming at second test equipment corresponding to the second equipment identifier; the pre-script is used for realizing pre-stage operation of the target application program, and the pre-stage operation comprises any one or more operations of installing the target application program, initializing resources and logging in an account.
In one embodiment, the apparatus further comprises a listening module (not shown in the figure) for: when a universal serial bus device insertion message on a test host for deploying a target container is monitored, acquiring a device identifier of a current inserted device, and determining the device identifier as an available test device identifier corresponding to the target container; or when the universal serial bus device unplugging message on the test host for deploying the target container is monitored, acquiring the device identifier of the current unplugged device, and deleting the device identifier from the available test device identifiers corresponding to the target container.
In one embodiment, the second device identifier obtaining module 306 is further configured to: when the first test equipment is detected to be abnormal, the identification of the equipment with the same preset attribute as the first test equipment is obtained from the available test equipment identifications corresponding to the target container and is used as a second equipment identification.
In one embodiment, the apparatus further includes an anomaly detection module (not shown in the figure) for: and sending heartbeat connection to the first test equipment by using the target test server, and determining whether the first test equipment is abnormal or not based on the heartbeat connection result.
In one embodiment, the service identifier includes an internet protocol address and a port number; the server determining module 302 is further configured to: responding to an application program test request carrying an Internet protocol address and a port number, and determining a test host corresponding to the Internet protocol address; determining a target test server corresponding to the port number in the test host; the target test server operates in a target container deployed on the test host.
The device provided in this embodiment has the same implementation principle and technical effects as those of the first embodiment of the method, and for brevity, reference may be made to the corresponding contents of the first embodiment of the method.
Based on the foregoing embodiments, this embodiment provides a computer-readable storage medium having instructions stored therein, which when executed on a terminal device, cause the terminal device to implement the test method for an application program provided in the foregoing embodiments.
The embodiment also provides a device, comprising: the test method for the application program provided by the embodiment is realized by the memory, the processor and the computer program stored in the memory and capable of running on the processor when the processor executes the computer program. Referring to fig. 4, the apparatus may include:
a processor 401, a memory 402, an input device 403 and an output device 404. The number of processors 401 in the atlas packing device may be one or more, one processor being exemplified in fig. 4. In some embodiments of the invention, the processor 401, memory 402, input device 403, and output device 404 may be connected by a bus or other means, with the bus connection being exemplified in FIG. 4.
The memory 402 may be used to store software programs and modules, and the processor 401 executes various functional applications and data processing of the atlas packaging device by executing the software programs and modules stored in the memory 402. The memory 402 may mainly include a storage program area that may store an operating system, application programs required for at least one function, and the like, and a storage data area. In addition, memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device. The input means 403 may be used to receive input numeric or character information and to generate signal inputs related to user settings and function control of the atlas packaging device.
In particular, in this embodiment, the processor 401 loads executable files corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 401 executes the application programs stored in the memory 402, so as to implement the various functions of the above-mentioned atlas packing device.
It should be noted that in this document, relational terms such as "first" and "second" and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing is merely a specific embodiment of the disclosure to enable one skilled in the art to understand or practice the disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown and described herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method for testing an application program, the method comprising:
responding to an application program test request carrying a test server identifier, and determining a target test server corresponding to the test server identifier; the target test server runs in a target container;
acquiring a first equipment identifier in a configuration file of the target container, and driving first test equipment corresponding to the first equipment identifier by utilizing the target test server to test a target application program;
when the first test equipment is detected to be abnormal, a second equipment identifier is obtained from available test equipment identifiers corresponding to the target container, and the first equipment identifier in the configuration file is updated to the second equipment identifier;
and driving second testing equipment corresponding to the second equipment identifier by using the target testing server to test the target application program.
2. The method of claim 1, wherein after the obtaining the second device identification and before the updating the first device identification in the configuration file to the second device identification, further comprises:
executing the pre-script of the target application program aiming at the second test equipment corresponding to the second equipment identifier; the pre-script is used for realizing pre-stage operation of the target application program, and the pre-stage operation comprises any one or more operations of installing the target application program, initializing resources and logging in an account.
3. The method of claim 1, wherein the acquiring a second device identifier from the available test device identifiers corresponding to the target container further comprises:
when monitoring a universal serial bus device insertion message on a test host for deploying the target container, acquiring a device identifier of a current inserted device, and determining the device identifier as an available test device identifier corresponding to the target container;
or when the universal serial bus device unplugging message on the test host for deploying the target container is monitored, acquiring the device identifier of the current unplugged device, and deleting the device identifier from the available test device identifiers corresponding to the target container.
4. The method according to claim 1, wherein when the first test device is detected to be abnormal, the step of obtaining a second device identifier from available test device identifiers corresponding to the target container includes:
when the first test equipment is detected to be abnormal, the identification of the equipment with the same preset attribute as the first test equipment is obtained from the available test equipment identifications corresponding to the target container and is used as a second equipment identification.
5. The method according to claim 1, wherein the method further comprises:
and sending heartbeat connection to the first test equipment by using the target test server, and determining whether the first test equipment is abnormal or not based on the heartbeat connection result.
6. The method of claim 1, wherein the target container has a one-to-one correspondence with the target test server.
7. The method of claim 1, wherein the service end identification comprises an internet protocol address and a port number; the determining, in response to an application program test request carrying a test server identifier, a target test server corresponding to the test server identifier includes:
responding to an application program test request carrying an Internet protocol address and a port number, and determining a test host corresponding to the Internet protocol address;
determining a target test server corresponding to the port number in the test host; the target test server operates in a target container deployed on the test host.
8. An apparatus for testing an application program, the apparatus comprising:
the server determining module is used for responding to an application program test request carrying a test server identifier and determining a target test server corresponding to the test server identifier; the target test server runs in a target container;
the first equipment identifier acquisition module is used for acquiring a first equipment identifier in the configuration file of the target container, and driving first test equipment corresponding to the first equipment identifier by utilizing the target test server to test a target application program;
the second equipment identifier obtaining module is used for obtaining a second equipment identifier from available test equipment identifiers corresponding to the target container when the first test equipment is detected to be abnormal, and updating the first equipment identifier in the configuration file into the second equipment identifier;
and the program test module is used for driving the second test equipment corresponding to the second equipment identifier to test the target application program by using the target test server.
9. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein instructions, which when run on a terminal device, cause the terminal device to implement the method of any of claims 1-7.
10. An apparatus, comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the method of any one of claims 1-7 when the computer program is executed.
CN202011166639.9A 2020-10-27 2020-10-27 Application program testing method, device, equipment and storage medium Active CN112214413B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011166639.9A CN112214413B (en) 2020-10-27 2020-10-27 Application program testing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011166639.9A CN112214413B (en) 2020-10-27 2020-10-27 Application program testing method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112214413A CN112214413A (en) 2021-01-12
CN112214413B true CN112214413B (en) 2024-01-16

Family

ID=74057112

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011166639.9A Active CN112214413B (en) 2020-10-27 2020-10-27 Application program testing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112214413B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113485905B (en) * 2021-02-26 2023-09-05 杜自然 Test method, device, equipment and computer storage medium in data transaction
CN113010060A (en) * 2021-03-17 2021-06-22 杭州遥望网络科技有限公司 Task execution method, device and equipment of application program and readable storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109726107A (en) * 2018-06-01 2019-05-07 平安普惠企业管理有限公司 Test method, device, equipment and storage medium
CN110688202A (en) * 2019-10-09 2020-01-14 腾讯科技(深圳)有限公司 Service process scheduling method, device, equipment and storage medium
CN110838953A (en) * 2019-11-01 2020-02-25 北京字节跳动网络技术有限公司 Test method, test system, electronic equipment and storage medium
CN111400131A (en) * 2020-03-06 2020-07-10 苏州浪潮智能科技有限公司 Performance detection method and system of AI server, electronic equipment and storage medium
CN111597112A (en) * 2020-04-30 2020-08-28 北京金山云网络技术有限公司 Automatic test method and device and electronic equipment
CN111639019A (en) * 2020-04-24 2020-09-08 北京五八信息技术有限公司 Code testing method and device and readable storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102201616B1 (en) * 2014-02-23 2021-01-12 삼성전자주식회사 Method of Searching Device Between Electrical Devices
JP2017167763A (en) * 2016-03-15 2017-09-21 富士通株式会社 Information processor, test execution method and program
US20180285247A1 (en) * 2017-03-29 2018-10-04 The Travelers Indemnity Company Systems, methods, and apparatus for automated code testing
US10664388B2 (en) * 2017-06-14 2020-05-26 T-Mobile Usa, Inc. Continuous integration testing for network-based applications

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109726107A (en) * 2018-06-01 2019-05-07 平安普惠企业管理有限公司 Test method, device, equipment and storage medium
CN110688202A (en) * 2019-10-09 2020-01-14 腾讯科技(深圳)有限公司 Service process scheduling method, device, equipment and storage medium
CN110838953A (en) * 2019-11-01 2020-02-25 北京字节跳动网络技术有限公司 Test method, test system, electronic equipment and storage medium
CN111400131A (en) * 2020-03-06 2020-07-10 苏州浪潮智能科技有限公司 Performance detection method and system of AI server, electronic equipment and storage medium
CN111639019A (en) * 2020-04-24 2020-09-08 北京五八信息技术有限公司 Code testing method and device and readable storage medium
CN111597112A (en) * 2020-04-30 2020-08-28 北京金山云网络技术有限公司 Automatic test method and device and electronic equipment

Also Published As

Publication number Publication date
CN112214413A (en) 2021-01-12

Similar Documents

Publication Publication Date Title
CN107769949B (en) Application component deployment method and deployment node
CN112214413B (en) Application program testing method, device, equipment and storage medium
CN109614167B (en) Method and system for managing plug-ins
CN108509215B (en) System software replacing method and device, terminal equipment and storage medium
CN110837388B (en) Software upgrading method of robot, upgrading server, robot and storage medium
CN110765026A (en) Automatic testing method and device, storage medium and equipment
CN111124286A (en) Libcloud-based multi-cloud management implementation method
CN110333876A (en) A kind of data clearing method and control equipment
CN105159716A (en) Memory device initialization method and electronic equipment
CN107526584B (en) Data access method and device
EP2575037A1 (en) Generation apparatus, generation method and computer readable information recording medium
CN113434180B (en) Data processing method and device for application, server and storage medium
CN113138768A (en) Application package generation method and device, electronic equipment and readable storage medium
CN108595292B (en) System optimization method, mobile terminal and computer storage medium
US9317273B2 (en) Information processing apparatus and information processing method
CN115827035A (en) Equipment upgrading method and device, storage medium and electronic device
CN110753040A (en) Request processing method and device
CN116009984A (en) Security arrangement and automatic response processing method and device and electronic equipment
EP4086756A1 (en) Method and apparatus for processing virtual machine component
CN107688479B (en) Android system network cluster, construction method thereof, and Android system network cluster data processing method and system
CN112685063B (en) Feature library updating method, device, network equipment and readable storage medium
CN114047933A (en) Method, device, equipment and medium for multi-open Android application
CN112463228A (en) Storage pool hybrid deployment method and device
CN112256384A (en) Service set processing method and device based on container technology and computer equipment
CN108304200B (en) Method and device for upgrading driving program and electronic equipment

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