CN116166545A - Test environment creation method, test environment creation device, medium and electronic device - Google Patents

Test environment creation method, test environment creation device, medium and electronic device Download PDF

Info

Publication number
CN116166545A
CN116166545A CN202310042046.9A CN202310042046A CN116166545A CN 116166545 A CN116166545 A CN 116166545A CN 202310042046 A CN202310042046 A CN 202310042046A CN 116166545 A CN116166545 A CN 116166545A
Authority
CN
China
Prior art keywords
test
service
test environment
image
environment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310042046.9A
Other languages
Chinese (zh)
Inventor
赵大伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Boguan Information Technology Co Ltd
Original Assignee
Guangzhou Boguan Information 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 Guangzhou Boguan Information Technology Co Ltd filed Critical Guangzhou Boguan Information Technology Co Ltd
Priority to CN202310042046.9A priority Critical patent/CN116166545A/en
Publication of CN116166545A publication Critical patent/CN116166545A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3664Environments for testing or debugging software

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 method can generate a service test image and a test environment corresponding to the service test image in a cloud platform, can establish communication between a visual page and the test environment based on a test environment identifier, is beneficial to a tester to perform service test based on a communication relationship between the visual page and a temporary test environment, provides a test channel for services which are not deployed in a physical machine, removes the dependence of the service test on the physical machine, and has stability in the test environment generated by the cloud platform, namely, can provide a more stable test environment for the tester.

Description

Test environment creation method, test environment creation device, medium and electronic device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a test environment creation method, a test environment creation device, a computer readable storage medium, and an electronic apparatus.
Background
Before a new service is brought on-line, it is often necessary for a tester to test the functionality of the service to ensure that the various functions in the new service can function properly. Generally, to test a service, a tester is required to log in a physical machine where the service is deployed to view and test the state of the service, and perform functional verification by modifying specific parameters. However, if the service is not deployed on the physical machine, it is difficult for a tester to test it.
It should be noted that the information disclosed in the foregoing background section is only for enhancing understanding of the background of the present application and thus may include information that does not form an existing solution known to those of ordinary skill in the art.
Disclosure of Invention
The purpose of the application is to provide a test environment creation method, a test environment creation device, a computer readable storage medium and electronic equipment, which can generate a service test image and generate a test environment corresponding to the service test image in a cloud platform, and can establish communication between a visual page and the test environment based on a test environment identifier, thereby being beneficial to a tester to perform service test based on a communication relationship between the visual page and a temporary test environment, providing a test channel for services which are not deployed in a physical machine, relieving the dependence of the service test on the physical machine, and providing a more stable test environment for the tester, wherein the test environment generated in the cloud platform is more stable.
Other features and advantages of the present application will be apparent from the following detailed description, or may be learned in part by the practice of the application.
According to an aspect of the present application, there is provided a test environment creation method including:
Generating a service test mirror image;
generating a testing environment corresponding to the service testing mirror image in the cloud platform;
responding to the test request, and determining a test environment identifier corresponding to the test request;
communication is established between the visualization page and the test environment based on the test environment identification.
According to an aspect of the present application, there is provided a test environment creation apparatus including:
the test image generating unit is used for generating a service test image;
the test environment generating unit is used for generating a test environment corresponding to the service test mirror image in the cloud platform;
the identification determining unit is used for responding to the test request and determining a test environment identification corresponding to the test request;
and the communication establishing unit is used for establishing communication between the visual page and the test environment based on the test environment identification.
According to an aspect of the present application, there is provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The computer instructions are read from the computer-readable storage medium by a processor of a computer device, and executed by the processor, cause the computer device to perform the methods provided in the various alternative implementations described above.
According to an aspect of the present application, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method of any of the above.
According to an aspect of the present application, there is provided an electronic apparatus including: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the method of any of the above via execution of executable instructions.
Exemplary embodiments of the present application may have some or all of the following benefits:
in the test environment creation method provided by the example embodiment of the application, the service test image can be generated, the test environment corresponding to the service test image can be generated in the cloud platform, communication can be established between the visual page and the test environment based on the test environment identification, service testing can be conducted by the test personnel based on the communication relationship between the visual page and the temporary test environment, a test channel is provided for services which are not deployed in the physical machine, dependence of the service testing on the physical machine is relieved, and the test environment generated in the cloud platform is more stable, namely, a more stable test environment can be provided for the test personnel. In addition, because the service test based on the visual page can be realized, the intuitiveness of the service test can be improved, and the difficulty of the service test of a tester is reduced.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application. It is apparent that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained from these drawings without inventive effort for a person of ordinary skill in the art.
FIG. 1 illustrates a schematic diagram of an exemplary system architecture to which a test environment creation method and test environment creation apparatus of embodiments of the present application may be applied;
FIG. 2 schematically illustrates a flow chart of a test environment creation method according to one embodiment of the present application;
FIG. 3 schematically illustrates a flow chart of a test environment creation method according to another embodiment of the present application;
FIG. 4 schematically illustrates an application scenario diagram according to one embodiment of the present application;
FIG. 5 schematically illustrates a visualization management page diagram according to one embodiment of the present application;
FIG. 6 schematically illustrates a block diagram of a test environment creation device in accordance with one embodiment of the present application;
fig. 7 shows a schematic diagram of a computer system suitable for use in implementing the electronic device of the embodiments of the present application.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. However, the exemplary embodiments may be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the present application. One skilled in the relevant art will recognize, however, that the aspects of the application may be practiced without one or more of the specific details, or with other methods, components, devices, steps, etc. In other instances, well-known aspects have not been shown or described in detail to avoid obscuring aspects of the present application.
Furthermore, the drawings are only schematic illustrations of the present application and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus a repetitive description thereof will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software or in one or more hardware modules or integrated circuits or in different networks and/or processor devices and/or microcontroller devices.
Referring to fig. 1, fig. 1 is a schematic diagram illustrating a system architecture of an exemplary application environment to which a test environment creation method and a test environment creation apparatus according to embodiments of the present application may be applied. As shown in fig. 1, the system architecture 100 may include one or more of the terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used as a medium to provide communication links between the terminal devices 101, 102, 103 and the server 105.
The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others. The terminal devices 101, 102, 103 may be devices that provide voice and/or data connectivity to a user, handheld devices with wireless connectivity, or other processing devices connected to a wireless modem. The wireless terminal may communicate with one or more core networks via the RAN. The wireless terminal may be a User Equipment (UE), a handheld terminal, a notebook computer, a subscriber unit (subscriber unit), a cellular phone (cellular phone), a smart phone (smart phone), a wireless data card, a personal digital assistant (personal digital assistant, PDA) computer, a tablet computer, a wireless modem (modem), a handheld device (handheld), a laptop computer (laptop computer), a cordless phone (cord) or a wireless local loop (wireless local loop, WLL) station, a machine type communication (machine type communication, MTC) terminal or other network accessible device. The terminals communicate with the access network device using some kind of air interface technology (e.g. 3GPP access technology or non-3 GPP access technology). It should be understood that the number of terminal devices, networks and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation. For example, the server 105 may be a server cluster formed by a plurality of servers.
The test environment creation method provided by the embodiment of the present application may be executed by the server 105, and accordingly, the test environment creation apparatus is generally provided in the server 105. However, it is easily understood by those skilled in the art that the test environment creation method provided in the embodiment of the present application may be performed by the terminal device 101, 102 or 103, and accordingly, the test environment creation apparatus may be provided in the terminal device 101, 102 or 103, which is not particularly limited in the present exemplary embodiment. For example, in one exemplary embodiment, server 105 may generate a service test image; and generating a test environment corresponding to the service test image in the cloud platform.
In the related art, if a tester needs to test a service, it is necessary to build a physical machine and deploy related software (the software can provide the service) and its test environment on the physical machine, so as to achieve the test requirement; wherein a service is used to provide a user with a specific function or functions (e.g., view picture function, undo function, publish function, etc.). The physical machine refers to a real hardware device (such as a computer, a server, etc.), and an operating system and application programs run on the physical machine. Testers often need to assemble machine accessories (e.g., CPU, memory, motherboard, etc.) to obtain a physical machine, install an operating system for the physical machine, and configure network connections to implement the building of the physical machine. Furthermore, a tester can install the software to be tested on the physical machine, configure the testing environment according to the testing plan and generate the testing case (which can be realized as a script), log in the physical machine, perform functional testing on the software to be tested according to the testing case, further obtain a testing result, find problems existing in the functional implementation process according to the testing result, repair software codes based on the problems, and repeat the steps to perform the software testing until the testing result meets the expected requirement.
In the related art, it is known that to implement service testing, software to be tested needs to be deployed in a physical machine, and this method is relatively difficult and complex for a tester. According to the cloud testing method and device, cloud testing can be achieved through resources of the cloud platform, software to be tested does not need to be deployed in a physical machine, a tester only needs to trigger equipment, a service testing mirror image is generated, a testing environment corresponding to the service testing mirror image is generated in the cloud platform, communication relation between a visual page and the temporary testing environment can be triggered and established, and testing of services can be achieved through the communication relation.
Referring to fig. 2, fig. 2 schematically illustrates a flow chart of a test environment creation method according to one embodiment of the present application. As shown in fig. 2, the test environment creation method may include: step S210 to step S240.
Step S210: a service test image is generated.
Step S220: and generating a test environment corresponding to the service test image in the cloud platform.
Step S230: and responding to the test request, and determining a test environment identifier corresponding to the test request.
Step S240: communication is established between the visualization page and the test environment based on the test environment identification.
By implementing the method shown in fig. 2, a service test image can be generated, a test environment corresponding to the service test image can be generated in the cloud platform, communication can be established between the visual page and the test environment based on the test environment identification, service testing can be conducted by a tester based on the communication relationship between the visual page and the temporary test environment, a test channel is provided for services which are not deployed in the physical machine, dependence of the service testing on the physical machine is relieved, and the test environment generated in the cloud platform is more stable, namely, a more stable test environment can be provided for the tester. In addition, because the service test based on the visual page can be realized, the intuitiveness of the service test can be improved, and the difficulty of the service test of a tester is reduced.
Next, the above steps of the present exemplary embodiment will be described in more detail.
In step S210, a service test image is generated.
Specifically, the service test image may be dedicated to a tester for service testing, the service test image may be generated in response to a test requirement, a test result may be run in a test environment by the service test image based on parameters set by the tester, and whether and which problems exist for the service may be determined based on the test result.
The service test image is a lightweight and executable independent software package, and contains all contents required by running software, including codes, databases, environment variables and configuration files required by functional tests. The test environment is the general term for computer hardware, software, network equipment and historical data necessary for completing software test work. The test environment is created to simulate a real production environment, and the test environment can be a stand-alone device, a virtual machine or a container, or the like. In brief, the test environment corresponds to a sum of the individual computer resources provided to the service test image, where the service test image may invoke the individual computer resources to perform a test for one or more of the functions.
As an alternative embodiment, generating a service test image includes: copying the service image in response to an image generation request for the service image to obtain a service test image; wherein the service test image contains code, database, environment variables and configuration files required for functional testing. Therefore, the needed service test image can be timely generated according to the image generation request, so that subsequent service tests can be efficiently performed.
In particular, the image generation request may be used to indicate which service image needs to be replicated, where a service image may be understood as a sum of codes, databases, environment variables, and configuration files for implementing a specific service, the service image is used to provide a service to a user, and the service test image is used to perform a service test.
Wherein copying the service image in response to the image generation request for the service image to obtain the service test image comprises: responding to a mirror image generation request aiming at the service mirror image, generating the service mirror image based on the continuous integration module and copying the service mirror image to obtain a service test mirror image; among other things, the continuous integration module (CI/CD) is a method for frequently delivering applications to customers by introducing automation in the application development phase, which is mainly aimed at the problems raised when integrating new code, and can enable continuous automation and continuous monitoring throughout the whole lifecycle of the application. After the service image and the corresponding service test image are generated, the service image and the corresponding service test image can be submitted to a cloud platform based on a Job management module in a cloud native Kubernetes container, wherein the cloud platform refers to hardware-based service, and can provide functions of calculation, network, storage and the like.
In step S220, a test environment corresponding to the service test image is generated in the cloud platform.
Specifically, the test environment refers to a summary of computer hardware (e.g., servers, clients, network connections, etc.), software (e.g., operating systems, databases, etc.), networks (e.g., network systems, network structures, etc.), historical data necessary to complete software testing work. In this application, a test environment may be understood as Pod. Pod is the smallest deployable computing unit that can be created and managed in cloud native Kubernetes. The Pod may contain one or more containers, each of which may run a service. The content in the Pod is always collocated and scheduled together, running in a shared context.
As an optional embodiment, generating a test environment corresponding to a service test image in a cloud platform includes: determining computer resources required for realizing the function test according to the codes, the database, the environment variables and the configuration file; wherein the computer resource comprises at least one of a hardware resource, a software resource, a network resource, a data resource and a tool resource; isolating computer resources from the total resources of the cloud platform, and generating a test environment in the cloud platform based on the computer resources. Therefore, the automatic generation of the test environment can be realized, the test environment in the cloud platform has stability compared with a physical machine built by a tester, and the service test can be realized more efficiently and stably.
Specifically, the code, the database, the environment variable and the configuration file are the elements forming the service test image, and the code, the database, the environment variable and the configuration file can determine the computer resources required for testing the service test image, so that the computer resources are required to be divided to form a test environment. The test environment meets the requirement of various resources required to be called by the test service test image, and the test of the service test image can be completed in the test environment.
As an alternative embodiment, further comprising: the duration corresponding to the service test image is configured. Therefore, the available time of the resources allocated to the service test mirror image can be limited, the resources are prevented from being occupied for a long time, the resources are recovered in time, and the utilization rate of the resources can be improved.
In particular, the duration may be used to define a duration, e.g., 1 day, that the service test image occupies cloud platform resources.
As an alternative embodiment, configuring the duration corresponding to the service test image includes: responding to the time configuration operation, and configuring the duration corresponding to the service test image as the duration corresponding to the time configuration operation; or configuring the duration corresponding to the service test image as a preset duration. Therefore, a more various duration configuration mode can be provided, namely, the duration of configuration is more personalized and reasonable, and the tester is helped to efficiently complete the test work without occupying resources for a long time.
Specifically, a corresponding duration can be automatically selected according to the service type corresponding to the service test image, and the duration corresponding to the service test image is configured as the corresponding duration; wherein different service types may correspond to different durations. In addition, the preset duration may be understood as a preset fixed duration, and the preset duration may be customized.
In step S230, in response to the test request, a test environment identifier corresponding to the test request is determined.
Specifically, in the cloud platform, different test environments may correspond to different test environment identifiers (e.g., POD IDs), and the test environment identifiers may be represented as text, symbols, numerical values, or any combination of various forms, which are not limited in the embodiments of the present application.
In addition, the test request indicates which service test image needs to be tested and states that the service test image needs to be tested at present, based on the test request, a corresponding test environment identifier can be determined in time, and communication can be established between the visual page and the test environment based on the test environment identifier. The test environment identifier is used as a condition for establishing communication, so that a tester can instruct the test environment of the cloud platform to run a specified use case/script in the visual page.
In step S240, communication is established between the visualization page and the test environment based on the test environment identification.
Specifically, the visual page may be a user interface of a visual management background, where the visual management background may store and record a service test image, and provide a user to perform an operation to control a test environment to run a specific script, so as to implement a specific functional test for the service test image. It can be seen that after communication is established between the visualization page and the test environment, specific test items can be implemented based on the communication channel.
As an alternative embodiment, further comprising: in response to the functional test operation, a functional test is performed on the service test image in the test environment based on a communication protocol with the test environment. Therefore, communication with the test environment can be realized based on a communication protocol between the cloud platform resource and the test environment, so that service testing based on the cloud platform resource is realized, dependence of the service testing on a local physical machine is avoided, and service testing efficiency is improved.
Specifically, the functional test operation may include a parameter modification operation, a data input operation, and the like, which are not limited in the embodiments of the present application. In the application, the service test mirror image can communicate with the test environment based on a communication protocol WebSocket between the service test mirror image and the test environment so as to realize the purpose of carrying out functional test on the service test mirror image; the WebSocket is a communication protocol, so that data exchange can be performed between a client and a server, and full duplex communication can be performed on a single TCP connection.
As an alternative embodiment, in response to a functional test operation, functional testing a service test image in a test environment based on a communication protocol with the test environment, comprising: determining a test script for testing the specific function in response to the function test operation; the test script is used for simulating user operation; based on a communication protocol with the test environment, the test script is sent to the test environment and is run in the test environment to realize a specific function test for the service test image. Therefore, the testing of the specified function in the service test mirror image can be realized, and the resources in the testing environment of the cloud platform can be utilized, so that stable, efficient and accurate functional testing can be realized.
In particular, the service test image is used for realizing one service (such as an online medical service) set by a user, specific functions which can be realized by the service test image include one or more, the specific function can be one of multiple functions of the service test image, a test script for testing the specific function can be used for realizing simulation of user operation, that is, by running the test script, the service test image can be operated by simulating a user in a test environment, so as to obtain a test result.
As an alternative embodiment, further comprising: and responding to the test result acquisition request, and acquiring service test results corresponding to the test environment from the cloud platform based on the test environment identification. Therefore, service testing based on cloud platform resources can be realized, the utilization rate of the cloud platform resources is improved, and the dependence of the service testing on a local physical machine is eliminated.
Specifically, service test results corresponding to different test environments can be stored in the cloud platform, a tester can acquire the corresponding service test results through inputting the test environment identifier, and problems existing in the service can be analyzed based on the service test results.
Referring to fig. 3, fig. 3 schematically illustrates a flow chart of a test environment creation method according to another embodiment of the present application. As shown in fig. 3, the test environment creation method may include: step S310 to step S360.
Step S310: copying the service image in response to an image generation request for the service image to obtain a service test image; wherein the service test image contains code, database, environment variables and configuration files required for functional testing.
Step S320: responding to the time configuration operation, and configuring the duration corresponding to the service test image as the duration corresponding to the time configuration operation; or configuring the duration corresponding to the service test image as a preset duration.
Step S330: determining computer resources required for realizing the function test according to the codes, the database, the environment variables and the configuration file; the computer resources comprise at least one of hardware resources, software resources, network resources, data resources and tool resources, so that the computer resources are isolated from the total resources of the cloud platform, and a test environment is generated in the cloud platform based on the computer resources.
Step S340: and responding to the test request, determining a test environment identifier corresponding to the test request, and establishing communication between the visual page and the test environment based on the test environment identifier.
Step S350: in response to the functional test operation, a functional test is performed on the service test image in the test environment based on a communication protocol with the test environment.
Step S360: and responding to the test result acquisition request, and acquiring service test results corresponding to the test environment from the cloud platform based on the test environment identification.
It should be noted that, the steps S310 to S360 correspond to the steps and the embodiments thereof shown in fig. 2, and for the specific implementation of the steps S310 to S360, please refer to the steps and the embodiments thereof shown in fig. 2, and the details thereof are not repeated here.
Therefore, by implementing the method shown in fig. 3, a service test image can be generated, a test environment corresponding to the service test image can be generated in the cloud platform, communication can be established between the visual page and the test environment based on the test environment identifier, service testing can be conducted by a tester based on the communication relationship between the visual page and the temporary test environment, a test channel is provided for services which are not deployed in the physical machine, dependence of the service test on the physical machine is relieved, and the test environment generated in the cloud platform is more stable, namely, a more stable test environment can be provided for the tester. In addition, because the service test based on the visual page can be realized, the intuitiveness of the service test can be improved, and the difficulty of the service test of a tester is reduced.
Referring to fig. 4, fig. 4 schematically illustrates an application scenario according to an embodiment of the present application. As shown in fig. 4, the developer side 420 may package the service test image from the Git code repository 421 and submit the service test image to the cloud platform 430 through the Job management module 422, the tester side 410 may generate a test environment (POD) corresponding to the service test image at the cloud platform 430 in response to the test requirement received by the visual management page 411, in the test environment, the tester may complete the test work for the specified service, and further, the cloud platform 430 may store the test result to the database 440, and the tester side 410 may display the test result stored in the database 440 based on the visual management page 411, so that the tester may analyze the problem of the service based on the test result. In addition, data interactions between Job management module 422 and database 440 may be performed to enable submission of various types of images.
Referring to fig. 5 for the above visual management page, fig. 5 schematically shows a visual management page according to an embodiment of the present application. As shown in fig. 5, the visual management page may be oriented to users such as developers and testers, and in the visual management page, grouping information to which a service belongs may be input in a region 510, service information to be tested may be input in a region 520, and image related information to be generated may be input in a region 530. Further, by triggering the control "create temporary intranet test environment" 540, temporary creation of the test environment may be achieved, and specific creation results may be displayed in the code display area 560.
Further, referring to fig. 6, fig. 6 schematically shows a block diagram of a test environment creation apparatus according to an embodiment of the present application. As shown in fig. 6, the test environment creation apparatus 600 may include:
a test image generating unit 601, configured to generate a service test image;
the test environment generating unit 602 is configured to generate a test environment corresponding to a service test image in the cloud platform;
an identifier determining unit 603, configured to determine a test environment identifier corresponding to the test request in response to the test request;
A communication establishing unit 604, configured to establish communication between the visualization page and the test environment based on the test environment identifier.
Therefore, by implementing the device shown in fig. 6, a service test image can be generated, a test environment corresponding to the service test image can be generated in the cloud platform, communication can be established between the visual page and the test environment based on the test environment identifier, service testing can be conducted by a tester based on the communication relationship between the visual page and the temporary test environment, a test channel is provided for services which are not deployed in the physical machine, dependence of the service test on the physical machine is relieved, and the test environment generated in the cloud platform is more stable, namely, a more stable test environment can be provided for the tester. In addition, because the service test based on the visual page can be realized, the intuitiveness of the service test can be improved, and the difficulty of the service test of a tester is reduced.
In an exemplary embodiment of the present application, the test image generating unit 601 generates a service test image, including:
copying the service image in response to an image generation request for the service image to obtain a service test image; wherein the service test image contains code, database, environment variables and configuration files required for functional testing.
It can be seen that implementing this alternative embodiment, the required service test image can be generated in time according to the image generation request, so as to efficiently perform the subsequent service test.
In an exemplary embodiment of the present application, the test environment generating unit 602 generates a test environment corresponding to a service test image in a cloud platform, including:
determining computer resources required for realizing the function test according to the codes, the database, the environment variables and the configuration file; wherein the computer resource comprises at least one of a hardware resource, a software resource, a network resource, a data resource and a tool resource;
isolating computer resources from the total resources of the cloud platform, and generating a test environment in the cloud platform based on the computer resources.
Therefore, the optional embodiment is implemented to realize automatic generation of the test environment, and the test environment in the cloud platform is more stable compared with a physical machine built by a tester, so that more efficient and stable service test can be realized.
In an exemplary embodiment of the present application, further comprising:
and the time configuration unit is used for configuring the duration time corresponding to the service test image.
Therefore, by implementing the alternative embodiment, the available time of the resources allocated to the service test image can be limited, the resources are prevented from being occupied for a long time, the resources are recovered in time, and the utilization rate of the resources can be improved.
In an exemplary embodiment of the present application, the time configuration unit configures a duration corresponding to the service test image, including:
responding to the time configuration operation, and configuring the duration corresponding to the service test image as the duration corresponding to the time configuration operation; or alternatively, the process may be performed,
and configuring the duration corresponding to the service test mirror image as a preset duration.
It can be seen that implementing this alternative embodiment can provide a more varied duration configuration, i.e., make the duration of the configuration more personalized and rational, and help the tester to efficiently complete the test work without taking up resources for a long time.
In an exemplary embodiment of the present application, further comprising:
and the function test unit is used for responding to the function test operation and carrying out function test on the service test image in the test environment based on a communication protocol between the function test unit and the test environment.
Therefore, by implementing the optional embodiment, communication with the testing environment can be realized based on a communication protocol between the cloud platform resource and the testing environment, so that service testing based on the cloud platform resource is realized, dependence of the service testing on a local physical machine is avoided, and efficiency of the service testing is improved.
In one exemplary embodiment of the present application, a functional test unit performs functional testing of a service test image in a test environment based on a communication protocol with the test environment in response to a functional test operation, including:
determining a test script for testing the specific function in response to the function test operation; the test script is used for simulating user operation;
based on a communication protocol with the test environment, the test script is sent to the test environment and is run in the test environment to realize a specific function test for the service test image.
Therefore, by implementing the alternative embodiment, the test of the specified function in the service test image can be realized, and particularly, the resources in the test environment of the cloud platform can be utilized, so that stable, efficient and accurate function test can be realized.
In an exemplary embodiment of the present application, further comprising:
and the test result acquisition unit is used for responding to the test result acquisition request and acquiring service test results corresponding to the test environment from the cloud platform based on the test environment identification.
Therefore, by implementing the optional embodiment, the service test based on the cloud platform resource can be realized, the utilization rate of the cloud platform resource is improved, and the dependence of the service test on the local physical machine is eliminated.
It should be noted that although in the above detailed description several modules or units of a device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functions of two or more modules or units described above may be embodied in one module or unit, in accordance with embodiments of the present application. Conversely, the features and functions of one module or unit described above may be further divided into a plurality of modules or units to be embodied.
Since each functional module of the test environment creation device according to the exemplary embodiment of the present application corresponds to a step of the exemplary embodiment of the test environment creation method described above, for details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the test environment creation method described above.
Referring to fig. 7, fig. 7 shows a schematic diagram of a computer system suitable for implementing the electronic device according to the embodiments of the present application.
It should be noted that, the computer system 700 of the electronic device shown in fig. 7 is only an example, and should not impose any limitation on the functions and the application scope of the embodiments of the present application.
As shown in fig. 7, the computer system 700 includes a Central Processing Unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data required for the system operation are also stored. The CPU 701, ROM 702, and RAM 703 are connected to each other through a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
The following components are connected to the I/O interface 705: an input section 706 including a keyboard, a mouse, and the like; an output portion 707 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage section 708 including a hard disk or the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. The drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is installed on the drive 710 as needed, so that a computer program read out therefrom is installed into the storage section 708 as needed.
In particular, according to embodiments of the present application, the processes described below with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present application 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 shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 709, and/or installed from the removable medium 711. The computer program, when executed by a Central Processing Unit (CPU) 701, performs the various functions defined in the methods and apparatus of the present application.
As another aspect, the present application also provides a computer-readable medium that may be contained in the electronic device described in the above embodiment; or may exist alone without being incorporated into the electronic device. The computer-readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to implement the methods described in the above embodiments.
It should be noted that the computer readable medium shown in the present application may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples 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 context of this document, 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 application, however, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowcharts 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 application. 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 units involved in the embodiments of the present application may be implemented by means of software, or may be implemented by means of hardware, and the described units may also be provided in a processor. Wherein the names of the units do not constitute a limitation of the units themselves in some cases.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the application pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It is to be understood that the present application is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (11)

1. A test environment creation method, comprising:
generating a service test mirror image;
generating a test environment corresponding to the service test image in a cloud platform;
responding to a test request, and determining a test environment identifier corresponding to the test request;
communication is established between the visualization page and the test environment based on the test environment identification.
2. The method of claim 1, wherein generating a service test image comprises:
copying the service image in response to an image generation request for the service image to obtain a service test image; wherein the service test image contains codes, databases, environment variables and configuration files required for functional testing.
3. The method of claim 2, wherein generating a test environment corresponding to the service test image in a cloud platform comprises:
determining computer resources required for realizing functional test according to the codes, the database, the environment variables and the configuration file; wherein the computer resource comprises at least one of a hardware resource, a software resource, a network resource, a data resource and a tool resource;
isolating the computer resources from the total resources of the cloud platform, and generating a test environment in the cloud platform based on the computer resources.
4. The method according to claim 1, wherein the method further comprises:
and configuring the duration corresponding to the service test image.
5. The method of claim 4, wherein configuring the duration corresponding to the service test image comprises:
Responding to time configuration operation, and configuring duration corresponding to the service test image as duration corresponding to the time configuration operation; or alternatively, the process may be performed,
and configuring the duration time corresponding to the service test image as a preset duration time.
6. The method according to claim 1, wherein the method further comprises:
in response to a functional test operation, functional testing is performed on the service test image in the test environment based on a communication protocol with the test environment.
7. The method of claim 6, wherein responsive to a functional test operation, performing a functional test on the service test image in the test environment based on a communication protocol with the test environment, comprising:
determining a test script for testing the specific function in response to the function test operation; the test script is used for simulating user operation;
the test script is sent to the test environment based on a communication protocol with the test environment, and the test script is run in the test environment to realize specific function test for the service test image.
8. The method according to claim 1, wherein the method further comprises:
And responding to a test result acquisition request, and acquiring a service test result corresponding to the test environment from the cloud platform based on the test environment identifier.
9. A test environment creation apparatus, comprising:
the test image generating unit is used for generating a service test image;
the test environment generation unit is used for generating a test environment corresponding to the service test image in the cloud platform;
the identification determining unit is used for responding to the test request and determining a test environment identification corresponding to the test request;
and the communication establishing unit is used for establishing communication between the visual page and the test environment based on the test environment identification.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the method of any of claims 1-8.
11. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the method of any of claims 1-8 via execution of the executable instructions.
CN202310042046.9A 2023-01-11 2023-01-11 Test environment creation method, test environment creation device, medium and electronic device Pending CN116166545A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310042046.9A CN116166545A (en) 2023-01-11 2023-01-11 Test environment creation method, test environment creation device, medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310042046.9A CN116166545A (en) 2023-01-11 2023-01-11 Test environment creation method, test environment creation device, medium and electronic device

Publications (1)

Publication Number Publication Date
CN116166545A true CN116166545A (en) 2023-05-26

Family

ID=86419426

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310042046.9A Pending CN116166545A (en) 2023-01-11 2023-01-11 Test environment creation method, test environment creation device, medium and electronic device

Country Status (1)

Country Link
CN (1) CN116166545A (en)

Similar Documents

Publication Publication Date Title
CN110442524B (en) Method and device for testing web service interface with authentication authorization
CN111078539B (en) Test method, device, system and computer readable storage medium
CN109726108B (en) Front-end code testing method, device, system and medium based on analog data
CN109977012B (en) Joint debugging test method, device, equipment and computer readable storage medium of system
CN113687858B (en) Configuration file checking method and device, electronic equipment and storage medium
US20230185702A1 (en) Method and Apparatus for Generating and Applying Deep Learning Model based on Deep Learning Framework
CN110879776A (en) Test case generation method and device
CN111930614B (en) Automatic testing method, device, equipment and medium
CN112631590A (en) Component library generation method and device, electronic equipment and computer readable medium
CN111414154A (en) Method and device for front-end development, electronic equipment and storage medium
CN115203977B (en) Power grid simulation system
CN107562629B (en) Method and device for testing
CN116166545A (en) Test environment creation method, test environment creation device, medium and electronic device
CN114968823A (en) Automatic testing method, device, equipment and storage medium
CN112131095B (en) Pressure testing method and device
CN113704079A (en) Interface testing method and device based on Protobuf
CN112579428A (en) Interface testing method and device, electronic equipment and storage medium
CN112667491A (en) Function test method and device of virtual machine
CN113157360B (en) Method, apparatus, device, medium, and article for processing an API
CN113064810A (en) Automatic testing method and device
CN112783753B (en) Testing method and device for stream data processing system
CN113608996B (en) Mirror image compiling test method, system, device and readable storage medium
CN115129323B (en) Method, device and equipment for processing data resource packet and storage medium
CN114881751A (en) Method and system for configuring financial scheduling task, electronic device and storage medium
CN116107908A (en) Unit test code generation method and device

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