CN110647470A - Test method and manufacturing method, device, medium and electronic equipment - Google Patents
Test method and manufacturing method, device, medium and electronic equipment Download PDFInfo
- Publication number
- CN110647470A CN110647470A CN201910908303.6A CN201910908303A CN110647470A CN 110647470 A CN110647470 A CN 110647470A CN 201910908303 A CN201910908303 A CN 201910908303A CN 110647470 A CN110647470 A CN 110647470A
- Authority
- CN
- China
- Prior art keywords
- test
- image file
- script
- application
- file
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3698—Environments for analysis, debugging or testing of software
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE 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/00—Energy efficient computing, e.g. low power processors, power management or thermal management
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)
- Stored Programmes (AREA)
Abstract
本发明的实施方式提供了一种用于项目交付的测试方法,包括在宿主机中部署待交付的应用程序,获得测试镜像文件,所述测试镜像文件包括用于测试所述应用程序的测试脚本和用于搭建测试环境的系统程序,运行所述系统程序得到容器作为测试环境,以及在所述容器中执行所述测试脚本,以得到所述应用程序的测试结果,并输出到所述宿主机。该方法无需现场准备测试环境,减少不确定因素,提高测试成功率和测试效率。此外,本发明的实施方式还提供了一种测试镜像文件制作方法、一种用于项目交付的测试装置、一种测试镜像文件制作装置、一种计算机可读存储介质以及一种电子设备。
Embodiments of the present invention provide a testing method for project delivery, including deploying an application to be delivered in a host, and obtaining a test image file, where the test image file includes a test script for testing the application and a system program for building a test environment, running the system program to obtain a container as a test environment, and executing the test script in the container to obtain the test result of the application, and output to the host machine . The method does not require on-site preparation of the test environment, reduces uncertain factors, and improves the test success rate and test efficiency. In addition, embodiments of the present invention also provide a method for producing a test image file, a test apparatus for project delivery, an apparatus for producing a test image file, a computer-readable storage medium, and an electronic device.
Description
技术领域technical field
本发明的实施方式涉及测试技术领域,更具体地,本发明的实施方式涉及一种用于项目交付的测试方法、测试镜像文件制作方法、装置、介质以及电子设备。Embodiments of the present invention relate to the technical field of testing, and more particularly, embodiments of the present invention relate to a testing method for project delivery, a method for producing a test image file, an apparatus, a medium, and an electronic device.
背景技术Background technique
本部分旨在为权利要求书中陈述的本发明的实施方式提供背景或上下文。此处的描述不因为包括在本部分中就承认是现有技术。This section is intended to provide a background or context for the embodiments of the invention that are recited in the claims. The descriptions herein are not admitted to be prior art by inclusion in this section.
一个面向企业交付的系统,其交付内容包括:稳定无遗留问题的服务镜像、脚本的部署、相关文档等(例如产品说明书、技术白皮书、产品操作手册、产品培训材料、安全指南、开发指南,最佳实践、测试报告、交付说明、运维说明等)。A system delivered to enterprises, whose delivery content includes: stable service images without any remaining problems, deployment of scripts, related documents, etc. (such as product manuals, technical white papers, product operation manuals, product training materials, security guides, development guides, most best practices, test reports, delivery instructions, O&M instructions, etc.).
在相关技术中,质量保证人员编写测试自动化脚本,实现基于测试用例的自动化测试过程,然后将自动化脚本提供给运维交付团队去运行。运维交付团队使用服务镜像配置到自动部署脚本中,触发自动部署脚本在客户的环境上部署一套可运行的系统,然后使用自动化脚本验收通过后,保证所有提供的功能完整可用后交付给客户。In related technologies, quality assurance personnel write test automation scripts to implement the automated testing process based on test cases, and then provide the automated scripts to the operation and maintenance delivery team to run. The operation and maintenance delivery team uses the service image to configure the automatic deployment script, triggers the automatic deployment script to deploy a runnable system on the customer's environment, and then uses the automatic script to pass the acceptance check to ensure that all the provided functions are fully available and then delivered to the customer .
发明内容SUMMARY OF THE INVENTION
但是,自动化脚本运行之前需要准备运行环境,例如操作系统、测试工程插件、jdk环境、第三方库等等。自动化脚本运行之前需要准备的运行前提条件过多,由于不同客户的机房环境差异过大,容易造成自动化脚本运行失败概率较大,影响项目交付效率。However, before running the automation script, you need to prepare the running environment, such as the operating system, test project plug-ins, jdk environment, third-party libraries, and so on. There are too many preconditions for running an automated script. Due to the large differences in the computer room environment of different customers, it is easy to cause a high probability of failure of the automated script to run, which affects the efficiency of project delivery.
为此,非常需要一种改进的用于项目交付的测试,以使克服上述技术问题。To this end, there is a great need for an improved test for project delivery that overcomes the aforementioned technical problems.
在本上下文中,本发明的实施方式期望提供一种用于项目交付的测试方法,减少不确定因素,提高测试成功率和测试效率。In this context, embodiments of the present invention are expected to provide a testing method for project delivery that reduces uncertainties and improves test success rate and test efficiency.
在本发明实施方式的第一方面中,提供了一种用于项目交付的测试方法,包括在宿主机中部署待交付的应用程序,获得测试镜像文件,所述测试镜像文件包括用于测试所述应用程序的测试脚本和用于搭建测试环境的系统程序,运行所述系统程序得到容器作为测试环境,以及在所述容器中执行所述测试脚本,以得到所述应用程序的测试结果,并输出到所述宿主机。In a first aspect of the embodiments of the present invention, a testing method for project delivery is provided, including deploying an application to be delivered in a host, and obtaining a test image file, where the test image file includes a test image file for testing The test script of the application program and the system program for building a test environment, run the system program to obtain a container as a test environment, and execute the test script in the container to obtain the test result of the application program, and output to the host.
在本发明的一个实施例中,所述方法还包括获得所述测试脚本的配置文件,将所述配置文件中的域名修改为待交付的应用程序的域名,所述在所述容器中执行测试脚本包括,基于修改后的配置文件执行所述测试脚本。In an embodiment of the present invention, the method further includes obtaining a configuration file of the test script, modifying the domain name in the configuration file to the domain name of the application to be delivered, and executing the test in the container The script includes executing the test script based on the modified configuration file.
在本发明的另一个实施例中,所述在所述容器中执行所述测试脚本包括,基于所述测试镜像文件,确定构建文件,基于所述构建文件,将所述镜像文件中的测试脚本复制到所述容器中的指定路径,基于所述构建文件,在所述容器中执行所述指定路径下的测试脚本。In another embodiment of the present invention, the executing the test script in the container includes, based on the test image file, determining a build file, and based on the build file, converting the test script in the image file Copy to the specified path in the container, and execute the test script under the specified path in the container based on the build file.
在本发明的又一个实施例中,所述测试脚本包括多个子测试脚本,多个子测试脚本中的每个子测试脚本对应一个测试用例,所述测试结果基于所述测试用例确定。In yet another embodiment of the present invention, the test script includes a plurality of sub-test scripts, each sub-test script in the plurality of sub-test scripts corresponds to a test case, and the test result is determined based on the test case.
在本发明实施方式的第二方面中,提供了一种测试镜像文件制作方法,包括获得用于测试待交付的应用程序的测试脚本,基于所述测试脚本,确定构建文件,获得包括用于搭建测试环境的系统程序的基础镜像文件,以及基于所述构建文件,将所述测试脚本和所述系统程序封装为测试镜像文件。In a second aspect of the embodiments of the present invention, a method for making a test image file is provided, including obtaining a test script for testing an application to be delivered, determining a build file based on the test script, The basic image file of the system program of the test environment, and the test script and the system program are packaged into a test image file based on the build file.
在本发明的一个实施例中,所述获得用于测试待交付的应用程序的测试脚本包括获得多个测试用例,基于所述多个测试用例,确定多个子测试脚本以及与所述多个子测试脚本解耦的配置文件,以及将所述多个子测试脚本封装为程序包,作为用于测试所述待交付的应用程序的测试脚本。In an embodiment of the present invention, the obtaining a test script for testing the application program to be delivered includes obtaining a plurality of test cases, determining a plurality of sub-test scripts based on the plurality of test cases, and combining with the plurality of sub-tests A script-decoupled configuration file, and the multiple sub-test scripts are encapsulated into a package as a test script for testing the application to be delivered.
在本发明的另一个实施例中,所述基于所述构建文件,将所述测试脚本和所述系统程序封装为测试镜像文件,包括将所述配置文件、以及所述测试脚本和所述系统程序封装为所述测试镜像文件。In another embodiment of the present invention, encapsulating the test script and the system program into a test image file based on the build file includes encapsulating the configuration file, the test script and the system The program is packaged as the test image file.
在本发明实施方式的第三方面中,提供了一种用于项目交付的测试装置,包括部署模块、第一获得模块、运行模块以及执行模块。部署模块,用于在宿主机中部署待交付的应用程序。第一获得模块,用于获得测试镜像文件,所述测试镜像文件包括用于测试所述应用程序的测试脚本和用于搭建测试环境的系统程序。运行模块,用于运行所述系统程序得到容器作为测试环境。执行模块,用于在所述容器中执行所述测试脚本,以得到所述应用程序的测试结果,并输出到所述宿主机。In a third aspect of the embodiments of the present invention, a testing apparatus for project delivery is provided, which includes a deployment module, a first acquisition module, an operation module, and an execution module. The deployment module is used to deploy the application to be delivered in the host. The first obtaining module is configured to obtain a test image file, where the test image file includes a test script for testing the application program and a system program for building a test environment. The running module is used for running the system program to obtain a container as a test environment. The execution module is configured to execute the test script in the container to obtain the test result of the application program and output the test result to the host computer.
在本发明实施方式的第四方面中,提供了一种测试镜像文件制作装置,包括第二获得模块、确定模块、第三获得模块以及封装模块。第二获得模块,用于获得用于测试待交付的应用程序的测试脚本。确定模块,用于基于所述测试脚本,确定构建文件。第三获得模块,用于获得包括用于搭建测试环境的系统程序的基础镜像文件。封装模块,用于基于所述构建文件,将所述测试脚本和所述系统程序封装为测试镜像文件。In a fourth aspect of the embodiments of the present invention, there is provided an apparatus for producing a test image file, including a second obtaining module, a determining module, a third obtaining module, and an encapsulating module. The second obtaining module is used to obtain a test script for testing the application to be delivered. A determination module for determining a build file based on the test script. The third obtaining module is used for obtaining a basic image file including a system program for building a test environment. An encapsulation module, configured to encapsulate the test script and the system program into a test image file based on the build file.
在本发明实施方式的第五方面中,提供了一种介质,其上存储有可执行指令,所述指令被处理单元执行时使所述处理单元执行上述任一项所述的方法。In a fifth aspect of an embodiment of the present invention, there is provided a medium having executable instructions stored thereon, and when the instructions are executed by a processing unit, the processing unit executes any of the methods described above.
在本发明实施方式的第六方面中,提供了一种电子设备,包括,处理单元,以及存储单元,其上存储有可执行指令,所述指令被所述处理单元执行时使所述处理单元执行如上所述的方法。In a sixth aspect of an embodiment of the present invention, an electronic device is provided, including a processing unit, and a storage unit, on which executable instructions are stored, and when the instructions are executed by the processing unit, cause the processing unit to Perform the method described above.
根据本发明实施方式的用于项目交付的测试方法,无需现场准备测试环境,减少不确定因素,有效地提高了测试成功率和测试效率。According to the test method for project delivery according to the embodiment of the present invention, there is no need to prepare a test environment on site, uncertain factors are reduced, and the test success rate and test efficiency are effectively improved.
附图说明Description of drawings
通过参考附图阅读下文的详细描述,本发明示例性实施方式的上述以及其他目的、特征和优点将变得易于理解。在附图中,以示例性而非限制性的方式示出了本发明的若干实施方式,其中:The above and other objects, features and advantages of exemplary embodiments of the present invention will become readily understood by reading the following detailed description with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present invention are shown by way of example and not limitation, wherein:
图1示意性地示出了根据本发明示例性实施例的用于项目交付的测试的流程图;FIG. 1 schematically shows a flow chart of testing for project delivery according to an exemplary embodiment of the present invention;
图2示意性地示出了根据本发明另一示例性实施例的用于项目交付的测试的流程图;FIG. 2 schematically shows a flow chart of testing for project delivery according to another exemplary embodiment of the present invention;
图3示意性地示出了根据本发明示例性实施例的在所述容器中执行所述测试脚本的流程图;FIG. 3 schematically shows a flow chart of executing the test script in the container according to an exemplary embodiment of the present invention;
图4示意性地示出了根据本发明示例性实施例的测试镜像文件制作方法的流程图;4 schematically shows a flow chart of a method for making a test image file according to an exemplary embodiment of the present invention;
图5示意性地示出了根据本发明示例性实施例的获得用于测试待交付的应用程序的测试脚本的流程图;5 schematically shows a flow chart of obtaining a test script for testing an application to be delivered according to an exemplary embodiment of the present invention;
图6示意性地示出了根据本发明示例性实施例的用于项目交付的测试装置的框图;FIG. 6 schematically shows a block diagram of a testing apparatus for project delivery according to an exemplary embodiment of the present invention;
图7示意性地示出了根据本发明示例性实施例的测试镜像文件制作装置的框图;FIG. 7 schematically shows a block diagram of an apparatus for producing a test image file according to an exemplary embodiment of the present invention;
图8示意性地示出了根据本发明示例性实施例的计算机可读存储介质的示意图;以及FIG. 8 schematically shows a schematic diagram of a computer-readable storage medium according to an exemplary embodiment of the present invention; and
图9示意性地示出了根据本发明示例性实施例的电子设备的方框图。FIG. 9 schematically shows a block diagram of an electronic device according to an exemplary embodiment of the present invention.
在附图中,相同或对应的标号表示相同或对应的部分。In the drawings, the same or corresponding reference numerals denote the same or corresponding parts.
具体实施方式Detailed ways
下面将参考若干示例性实施方式来描述本发明的原理和精神。应当理解,给出这些实施方式仅仅是为了使本领域技术人员能够更好地理解进而实现本发明,而并非以任何方式限制本发明的范围。相反,提供这些实施方式是为了使本公开更加透彻和完整,并且能够将本公开的范围完整地传达给本领域的技术人员。The principles and spirit of the present invention will now be described with reference to several exemplary embodiments. It should be understood that these embodiments are only given for those skilled in the art to better understand and implement the present invention, but not to limit the scope of the present invention in any way. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
本领域技术人员知道,本发明的实施方式可以实现为一种系统、装置、设备、方法或计算机程序产品。因此,本公开可以具体实现为以下形式,即:完全的硬件、完全的软件(包括固件、驻留软件、微代码等),或者硬件和软件结合的形式。As will be appreciated by those skilled in the art, embodiments of the present invention may be implemented as a system, apparatus, device, method or computer program product. Accordingly, the present disclosure may be embodied in entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.
根据本发明的实施方式,提出了一种用于项目交付的测试、系统、介质和电子设备。According to an embodiment of the present invention, a test, system, medium and electronic device for project delivery are presented.
此外,附图中的任何元素数量均用于示例而非限制,以及任何命名都仅用于区分,而不具有任何限制含义。Furthermore, any number of elements in the drawings is for illustration and not limitation, and any designation is for distinction only and does not have any limiting meaning.
下面参考本发明的若干代表性实施方式,详细阐释本发明的原理和精神。The principles and spirit of the present invention are explained in detail below with reference to several representative embodiments of the present invention.
发明概述SUMMARY OF THE INVENTION
一个面向企业交付的系统,其交付内容包括:稳定无遗留问题的服务镜像、脚本的部署、相关文档等(例如产品说明书、技术白皮书、产品操作手册、产品培训材料、安全指南、开发指南,最佳实践、测试报告、交付说明、运维说明等)。为了能够顺利地在客户环境下测试交付的应用程序,本发明示例性实施例可以将测试脚本封装在一个镜像文件中,该镜像文件中还包括用于搭建容器环境的系统程序,运维交付团队可以通过将镜像文件安装到客户环境中,从而运行容器,并在容器中执行测试脚本,无需分别准备操作系统、测试工程插件、jdk环境、第三方库等,减少不确定性,提高测试成功率。A system delivered to enterprises, whose delivery content includes: stable service images without any remaining problems, deployment of scripts, related documents, etc. (such as product manuals, technical white papers, product operation manuals, product training materials, security guides, development guides, most best practices, test reports, delivery instructions, O&M instructions, etc.). In order to successfully test the delivered application in the customer environment, the exemplary embodiment of the present invention can encapsulate the test script in an image file, and the image file also includes a system program for building a container environment. The operation and maintenance delivery team By installing the image file into the customer environment, the container can be run and the test script can be executed in the container, without the need to prepare the operating system, test project plug-ins, jdk environment, third-party libraries, etc., to reduce uncertainty and improve the test success rate .
在介绍了本发明的基本原理之后,下面具体介绍本发明的各种非限制性实施方式。Having introduced the basic principles of the present invention, various non-limiting embodiments of the present invention are described in detail below.
示例性方法Exemplary method
下面参考图1~图5描述根据本发明示例性实施方式的用于项目交付的测试。A test for project delivery according to an exemplary embodiment of the present invention is described below with reference to FIGS. 1 to 5 .
图1示意性地示出了根据本发明示例性实施例的用于项目交付的测试的流程图。Figure 1 schematically shows a flow chart of testing for project delivery according to an exemplary embodiment of the present invention.
如图1所示,该方法包括步骤S110~S140。As shown in FIG. 1, the method includes steps S110-S140.
在步骤S110,在宿主机中部署待交付的应用程序。In step S110, the application to be delivered is deployed in the host.
根据本发明示例性实施例,运维交付团队首先需要将待交付的应用程序部署到客户机房的环境中。在本实施例中,由于后续需要运行容器,相对于容器而言,客户的物理机环境被称为宿主机。According to an exemplary embodiment of the present invention, the operation and maintenance delivery team first needs to deploy the application to be delivered into the environment of the client room. In this embodiment, since the container needs to be run subsequently, the client's physical machine environment is called the host machine relative to the container.
在步骤S120,获得测试镜像文件,所述测试镜像文件包括用于测试所述应用程序的测试脚本和用于搭建测试环境的系统程序。In step S120, a test image file is obtained, where the test image file includes a test script for testing the application and a system program for building a test environment.
根据本发明示例性实施例,所述测试脚本包括多个子测试脚本,多个子测试脚本中的每个子测试脚本对应一个测试用例,所述测试结果基于所述测试用例确定。通过这些用例描述在新部署的系统上通过界面操作来检查该测试用例对应的功能点是否可用。全部通过后认为所有提供的功能完整可用,可以满足交付条件。下表示意性地示出了一个测试用例的实施例:According to an exemplary embodiment of the present invention, the test script includes a plurality of sub-test scripts, each sub-test script in the plurality of sub-test scripts corresponds to a test case, and the test result is determined based on the test case. Use these use case descriptions to check whether the function point corresponding to the test case is available through the interface operation on the newly deployed system. All the provided functions are considered to be fully available after all passed, and can meet the delivery conditions. The following table schematically shows an example of a test case:
镜像(Image)包括一个完整可运行的系统,操作系统、基础组件、应用程序都可以打包在一个镜像中。根据本发明示例性实施例,测试镜像文件在内部测试完成后交由运维交付团队使用,用于在项目交付过程中对交付的应用程序进行测试。该镜像文件包括用于测试所述应用程序的测试脚本和用于搭建测试环境的系统程序,通过该系统程序搭建测试环境后运行该测试脚本以执行自动化测试。该镜像文件的制作方法可以参照下文图4~图5描述的示例性方法,此处暂且略过。Image (Image) includes a complete runnable system, and the operating system, basic components, and applications can all be packaged in an image. According to an exemplary embodiment of the present invention, the test image file is handed over to the operation and maintenance delivery team for use by the operation and maintenance delivery team after the internal testing is completed, and is used to test the delivered application during the project delivery process. The image file includes a test script for testing the application program and a system program for building a test environment, and the test script is run after the test environment is built through the system program to execute automated testing. For the production method of the image file, reference may be made to the exemplary methods described in FIG. 4 to FIG. 5 below, which are omitted here for the time being.
在步骤S130,运行所述系统程序得到容器作为测试环境。In step S130, the system program is run to obtain a container as a test environment.
通过运行系统程序得到一个容器,该容器是某一个镜像的执行实例,实质上是一个处于运行状态的进程,可以启动、关闭、删除。该容器是一个小型的虚拟机,提供一个独立的环境,同一台机器上的多个容器之间互相隔离。在该环境中,可以根据测试镜像文件的配置,安装所需要的测试工程插件、jdk环境、第三方库等,以便顺利地执行测试脚本。A container is obtained by running a system program. The container is an execution instance of an image, which is essentially a running process that can be started, shut down, and deleted. The container is a small virtual machine that provides an independent environment, and multiple containers on the same machine are isolated from each other. In this environment, you can install the required test project plug-ins, jdk environment, third-party libraries, etc. according to the configuration of the test image file, so as to execute the test script smoothly.
在步骤S140,在所述容器中执行所述测试脚本,以得到所述应用程序的测试结果,并输出到所述宿主机。In step S140, the test script is executed in the container to obtain the test result of the application and output to the host computer.
根据本发明示例性实施例,在容器环境准备完成后,可以运行测试脚本,对每一个测试用例进行测试,得到测试结果,通过挂载的方式将容器输出到宿主机上,以便进行读取或显示。According to an exemplary embodiment of the present invention, after the preparation of the container environment is completed, a test script can be run to test each test case to obtain a test result, and the container can be output to the host by means of mounting for reading or show.
本发明示例性实施例提供的方法无需现场准备测试环境,避免了客户机房环境各异的问题,极大地减少操作成本,提高测试成功率和测试效率。The method provided by the exemplary embodiment of the present invention does not require on-site preparation of a test environment, avoids the problem of different client room environments, greatly reduces operating costs, and improves test success rate and test efficiency.
图2示意性地示出了根据本发明另一示例性实施例的用于项目交付的测试的流程图。FIG. 2 schematically shows a flow chart of testing for project delivery according to another exemplary embodiment of the present invention.
如图2所示,该方法在前述实施例的基础上,还可以包括步骤S210和S220,步骤S140可以实现为步骤S230。As shown in FIG. 2 , on the basis of the foregoing embodiment, the method may further include steps S210 and S220, and step S140 may be implemented as step S230.
在步骤S210,获得所述测试脚本的配置文件。其中,该配置文件包括待测试的应用程序的域名,也即是待交付的应用程序的域名。In step S210, a configuration file of the test script is obtained. The configuration file includes the domain name of the application to be tested, that is, the domain name of the application to be delivered.
在步骤S220,将所述配置文件中的域名修改为待交付的应用程序的域名。In step S220, the domain name in the configuration file is modified to the domain name of the application to be delivered.
在步骤S230,在所述容器中基于修改后的配置文件执行所述测试脚本,以得到所述应用程序的测试结果,并输出到所述宿主机。In step S230, the test script is executed in the container based on the modified configuration file, so as to obtain the test result of the application program, and output the test result to the host computer.
根据本发明示例性实施例,通过将测试脚本的配置文件中的域名修改为待交付的应用程序的域名,在容器准备完毕后,通过配置文件中的域名对被测试的应用程序寻址,找到被测试的应用程序,从而可以直接执行测试脚本,对待交付的应用程序进行测试。According to an exemplary embodiment of the present invention, by modifying the domain name in the configuration file of the test script to the domain name of the application to be delivered, after the container is ready, address the application under test through the domain name in the configuration file, and find the The application under test, so that the test script can be directly executed to test the application to be delivered.
图3示意性地示出了根据本发明示例性实施例的在所述容器中执行所述测试脚本的流程图。FIG. 3 schematically shows a flow chart of executing the test script in the container according to an exemplary embodiment of the present invention.
如图3所示,该方法包括步骤S310~S330。As shown in FIG. 3, the method includes steps S310-S330.
在步骤S310,基于所述测试镜像文件,确定构建文件。In step S310, a build file is determined based on the test image file.
在步骤S320,基于所述构建文件,将所述镜像文件中的测试脚本复制到所述容器中的指定路径。In step S320, based on the build file, copy the test script in the image file to a specified path in the container.
在步骤S330,基于所述构建文件,在所述容器中执行所述指定路径下的测试脚本。In step S330, based on the build file, the test script under the specified path is executed in the container.
根据本发明示例性实施例,构建文件可以设置在所述测试镜像文件中。当执行所述测试镜像文件中的系统应用程序时,可以从所述测试镜像文件中获得该构建文件。该构建文件记载了在容器搭建完成后执行的操作,在本实施例中,构建文件中包含了指定路径,构建文件记录了一些指令,用于在容器搭建完成后将测试镜像文件中的测试脚本复制到容器中的该指定路径,并运行该指定路径下的测试脚本。如下示意性地示出构建文件的一个实施例:According to an exemplary embodiment of the present invention, a build file may be set in the test image file. The build file can be obtained from the test image file when the system application in the test image file is executed. The build file records the operations performed after the container is built. In this embodiment, the build file includes a specified path, and the build file records some instructions for testing the test script in the image file after the container is built. Copy to the specified path in the container, and run the test script under the specified path. One embodiment of a build file is shown schematically as follows:
FROM**/library/java:openjdk-8-jreFROM**/library/java:openjdk-8-jre
RUN bash-c′mkdir/test′RUN bash -c 'mkdir/test'
WORKDIR/testWORKDIR/test
COPY./nsf-api-test-1.0-SNAPSHOT.jar/testCOPY./nsf-api-test-1.0-SNAPSHOT.jar/test
RUN bash-c′cd/test′RUN bash -c 'cd /test'
CMD java-jar nsf-api-test-1.0-SNAPSHOT.jar nsf_api_test.xmlCMD java-jar nsf-api-test-1.0-SNAPSHOT.jar nsf_api_test.xml
根据本发明示例性实施例,运维交付团队可以通过如下操作完成项目交付:According to an exemplary embodiment of the present invention, the operation and maintenance delivery team can complete the project delivery through the following operations:
将待交付的应用程序安装到客户环境中;Install the application to be delivered into the customer environment;
通过镜像标签获得测试镜像文件;Obtain the test image file through the image tag;
从测试镜像文件中获得配置文件,并将配置文件的域名修改为待交付的应用程序的域名;Obtain the configuration file from the test image file, and modify the domain name of the configuration file to the domain name of the application to be delivered;
运行测试镜像文件,其中,在运行测试镜像文件时,首先运行测试镜像文件中的系统程序,得到容器;然后测试镜像文件自动基于构建文件执行相应的指令,将测试镜像文件中的测试脚本复制到容器中的指定路径下,并执行该测试脚本;在执行测试脚本时,调用测试脚本的配置文件,确定待测试的应用程序的域名,从而对其进行测试,生成测试结果,并输出到宿主机;Run the test image file, wherein, when running the test image file, first run the system program in the test image file to obtain the container; then the test image file automatically executes the corresponding instructions based on the build file, and copies the test script in the test image file to the In the specified path in the container, and execute the test script; when executing the test script, call the configuration file of the test script to determine the domain name of the application to be tested, so as to test it, generate the test result, and output it to the host ;
运维交付团队将从宿主机获得的测试结果呈现给客户,完成应用程序的部署和测试的交付过程。The operation and maintenance delivery team presents the test results obtained from the host to the customer, and completes the application deployment and test delivery process.
图4示意性地示出了根据本发明示例性实施例的测试镜像文件制作方法的流程图。FIG. 4 schematically shows a flow chart of a method for making a test image file according to an exemplary embodiment of the present invention.
如图4所示,该方法包括步骤S410~S440。As shown in FIG. 4 , the method includes steps S410-S440.
在步骤S410,获得用于测试待交付的应用程序的测试脚本。In step S410, a test script for testing the application to be delivered is obtained.
根据本发明示例性实施例,可以使用maven工程加TestNG测试框架的方式管理测试脚本,每个测试脚本对应一个接口或一个功能场景(即一个测试用例)。通过测试集合触发一个或多个测试脚本的执行,执行完毕以后可以清理所有测试数据,保证被测环境不受影响。可以使用mvn package将测试工程打包为可运行的jar包。通过传入脚本集合描述文件xml来触发jar包运行,例如:java -jar nsf-api-test-1.0-SNAPSHOT.jar nsf_api_test.xml。According to an exemplary embodiment of the present invention, a maven project plus a TestNG test framework can be used to manage test scripts, and each test script corresponds to an interface or a functional scenario (ie, a test case). Trigger the execution of one or more test scripts through the test set. After the execution is completed, all test data can be cleaned up to ensure that the tested environment is not affected. You can use mvn package to package the test project into a runnable jar package. Trigger the jar package to run by passing in the script collection description file xml, for example: java -jar nsf-api-test-1.0-SNAPSHOT.jar nsf_api_test.xml.
在步骤S420,基于所述测试脚本,确定构建文件。该构建文件可以参见上文图3的实施例中的描述,此处不再赘述。In step S420, a build file is determined based on the test script. For the construction file, reference may be made to the description in the embodiment of FIG. 3 above, and details are not repeated here.
在步骤S430,获得包括用于搭建测试环境的系统程序的基础镜像文件。例如,网易云基础服务镜像仓库可以提供基础镜像文件。In step S430, a basic image file including a system program for building a test environment is obtained. For example, the NetEase Cloud Basic Service Image Warehouse can provide basic image files.
在步骤S440,基于所述构建文件,将所述测试脚本和所述系统程序封装为测试镜像文件。In step S440, the test script and the system program are packaged into a test image file based on the build file.
例如,打包命令可参考:For example, the packaging command can refer to:
dockerbuild-t***/qingzhou/qascript-nsf-api-test:20181108-1./dockerbuild-t***/qingzhou/qascript-nsf-api-test: 20181108-1./
打包后在本地生成一个***/qingzhou/qascript-nsf-api-test:20181108-1的镜像标签,登陆网易云基础服务镜像仓库,通过docker push命令可以将本地镜像推送到网易云镜像仓库。该镜像标签可以提供给运维交付团队,运维交付团队在客户环境中安装了待交付的应用程序后,可以根据镜像标签获得测试镜像文件。After packaging, generate an image label of ***/qingzhou/qascript-nsf-api-test: 20181108-1 locally, log in to the NetEase Cloud Basic Service Mirror Warehouse, and use the docker push command to push the local image to the NetEase Cloud Mirror Warehouse. The image tag can be provided to the operation and maintenance delivery team. After the operation and maintenance delivery team installs the application to be delivered in the customer environment, the test image file can be obtained according to the image tag.
根据本发明示例性实施例,测试镜像文件可以包括系统程序、构建文件、包括多个子测试脚本的程序包以及测试脚本的配置文件等。According to an exemplary embodiment of the present invention, the test image file may include a system program, a build file, a program package including a plurality of sub-test scripts, a configuration file of the test script, and the like.
图5示意性地示出了根据本发明示例性实施例的获得用于测试待交付的应用程序的测试脚本的流程图。FIG. 5 schematically shows a flow chart of obtaining a test script for testing an application to be delivered according to an exemplary embodiment of the present invention.
如图5所示,该方法包括步骤S510~S530。As shown in FIG. 5 , the method includes steps S510-S530.
在步骤S510,获得多个测试用例。In step S510, a plurality of test cases are obtained.
在步骤S520,基于所述多个测试用例,确定多个子测试脚本以及与所述多个子测试脚本解耦的配置文件。In step S520, a plurality of sub-test scripts and a configuration file decoupled from the plurality of sub-test scripts are determined based on the plurality of test cases.
在步骤S530,将所述多个子测试脚本封装为程序包,作为用于测试所述待交付的应用程序的测试脚本。In step S530, the multiple sub-test scripts are packaged into a program package as a test script for testing the application to be delivered.
根据本发明示例性实施例,所述基于所述构建文件,将所述测试脚本和所述系统程序封装为测试镜像文件,包括将所述配置文件、以及所述测试脚本和所述系统程序封装为所述测试镜像文件。根据本发明示例性实施例,配置文件并没有封装在该程序包中,与多个子测试脚本之间是解耦的,在使用时,只需要更改一次配置文件的信息,即可应用到程序包中的多个子测试脚本中,方便快捷。According to an exemplary embodiment of the present invention, encapsulating the test script and the system program into a test image file based on the build file includes encapsulating the configuration file, the test script and the system program image file for the test. According to the exemplary embodiment of the present invention, the configuration file is not encapsulated in the program package, and is decoupled from multiple sub-test scripts. When in use, only the information of the configuration file needs to be changed once, and then it can be applied to the program package Multiple sub-test scripts in , convenient and quick.
通过本发明示例性实施例的方法,可以消除人工执行和预置环境的步骤,提高测试效率,并且,在容器内运行测试脚本,可以消除环境差异化,提高测试成功率。Through the method of the exemplary embodiment of the present invention, the steps of manual execution and environment presetting can be eliminated, and the test efficiency can be improved. Moreover, running the test script in the container can eliminate the environment difference and improve the test success rate.
示例性系统Exemplary System
在介绍了本发明示例性实施方式的方法之后,接下来,参考图6和图7对本发明示例性实施方式的装置进行说明。After introducing the method of the exemplary embodiment of the present invention, next, the apparatus of the exemplary embodiment of the present invention will be described with reference to FIG. 6 and FIG. 7 .
图6示意性地示出了根据本发明示例性实施例的用于项目交付的测试装置600的框图。FIG. 6 schematically shows a block diagram of a testing apparatus 600 for project delivery according to an exemplary embodiment of the present invention.
如图6所示,用于项目交付的测试装置600包括部署模块610、第一获得模块620、运行模块630以及执行模块640。As shown in FIG. 6 , the testing apparatus 600 for project delivery includes a deployment module 610 , a first acquisition module 620 , an operation module 630 and an execution module 640 .
部署模块610,例如执行上文参考图1描述的操作S110,用于在宿主机中部署待交付的应用程序。The deployment module 610, for example, performs operation S110 described above with reference to FIG. 1, for deploying the application to be delivered in the host.
第一获得模块620,例如执行上文参考图1描述的操作S120,用于获得测试镜像文件,所述测试镜像文件包括用于测试所述应用程序的测试脚本和用于搭建测试环境的系统程序。The first obtaining module 620, for example, performs operation S120 described above with reference to FIG. 1, to obtain a test image file, where the test image file includes a test script for testing the application and a system program for building a test environment .
运行模块630,例如执行上文参考图1描述的操作S130,用于运行所述系统程序得到容器作为测试环境。The running module 630, for example, performs operation S130 described above with reference to FIG. 1, for running the system program to obtain a container as a test environment.
执行模块640,例如执行上文参考图1描述的操作S140,用于在所述容器中执行所述测试脚本,以得到所述应用程序的测试结果,并输出到所述宿主机。The execution module 640, for example, executes the operation S140 described above with reference to FIG. 1, to execute the test script in the container to obtain the test result of the application and output it to the host.
图7示意性地示出了根据本发明示例性实施例的测试镜像文件制作装置700的框图。FIG. 7 schematically shows a block diagram of an
如图7所示,测试镜像文件制作装置700包括第二获得模块710、确定模块720、第三获得模块730以及封装模块740。As shown in FIG. 7 , the
第二获得模块710,例如执行上文参考图4描述的操作S410,用于获得用于测试待交付的应用程序的测试脚本。The second obtaining
确定模块720,例如执行上文参考图4描述的操作S420,用于基于所述测试脚本,确定构建文件。The
第三获得模块730,例如执行上文参考图4描述的操作S430,用于获得包括用于搭建测试环境的系统程序的基础镜像文件。The third obtaining
封装模块740,例如执行上文参考图4描述的操作S440,用于基于所述构建文件,将所述测试脚本和所述系统程序封装为测试镜像文件。The
根据本发明示例性实施例的模块、子模块、单元、子单元中的任意多个、或其中任意多个的至少部分功能可以在一个模块中实现。根据本发明示例性实施例的模块、子模块、单元、子单元中的任意一个或多个可以被拆分成多个模块来实现。根据本发明示例性实施例的模块、子模块、单元、子单元中的任意一个或多个可以至少被部分地实现为硬件电路,例如现场可编程门阵列(FPGA)、可编程逻辑阵列(PLA)、片上系统、基板上的系统、封装上的系统、专用集成电路(ASIC),或可以通过对电路进行集成或封装的任何其他的合理方式的硬件或固件来实现,或以软件、硬件以及固件三种实现方式中任意一种或以其中任意几种的适当组合来实现。或者,根据本发明示例性实施例的模块、子模块、单元、子单元中的一个或多个可以至少被部分地实现为计算机程序模块,当该计算机程序模块被运行时,可以执行相应的功能。Any of the modules, sub-modules, units, sub-units, or at least part of the functions of any of them according to the exemplary embodiments of the present invention may be implemented in one module. Any one or more of the modules, sub-modules, units, and sub-units according to the exemplary embodiments of the present invention may be divided into multiple modules for implementation. Any one or more of the modules, sub-modules, units, sub-units according to the exemplary embodiments of the present invention may be implemented at least in part as hardware circuits, such as Field Programmable Gate Arrays (FPGA), Programmable Logic Arrays (PLA) ), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or any other reasonable means of hardware or firmware that integrates or packages a circuit, or can be implemented in software, hardware, and The firmware can be implemented in any one of the three implementation manners or in an appropriate combination of any of them. Alternatively, one or more of the modules, sub-modules, units, sub-units according to the exemplary embodiments of the present invention may be implemented at least in part as computer program modules which, when executed, may perform corresponding functions .
例如,部署模块610、第一获得模块620、运行模块630以及执行模块640中的任意多个可以合并在一个模块中实现,或者其中的任意一个模块可以被拆分成多个模块。或者,这些模块中的一个或多个模块的至少部分功能可以与其他模块的至少部分功能相结合,并在一个模块中实现。根据本公开的实施例,部署模块610、第一获得模块620、运行模块630以及执行模块640中的至少一个可以至少被部分地实现为硬件电路,例如现场可编程门阵列(FPGA)、可编程逻辑阵列(PLA)、片上系统、基板上的系统、封装上的系统、专用集成电路(ASIC),或可以通过对电路进行集成或封装的任何其他的合理方式等硬件或固件来实现,或以软件、硬件以及固件三种实现方式中任意一种或以其中任意几种的适当组合来实现。或者,部署模块610、第一获得模块620、运行模块630以及执行模块640中的至少一个可以至少被部分地实现为计算机程序模块,当该计算机程序模块被运行时,可以执行相应的功能。For example, any of the deploying module 610, the first obtaining module 620, the running module 630, and the executing module 640 may be combined in one module for implementation, or any one of the modules may be split into multiple modules. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the deployment module 610, the first acquisition module 620, the execution module 630, and the execution module 640 may be implemented at least partially as hardware circuits, such as field programmable gate arrays (FPGA), programmable Logic array (PLA), system-on-chip, system-on-substrate, system-on-package, application-specific integrated circuit (ASIC), or any other reasonable means of integrating or packaging circuits, implemented in hardware or firmware, or in It can be implemented in any one of the three implementation manners of software, hardware and firmware or in a suitable combination of any of them. Alternatively, at least one of the deployment module 610, the first acquisition module 620, the execution module 630, and the execution module 640 may be implemented at least in part as a computer program module that, when executed, may perform corresponding functions.
例如,第二获得模块710、确定模块720、第三获得模块730以及封装模块740中的任意多个可以合并在一个模块中实现,或者其中的任意一个模块可以被拆分成多个模块。或者,这些模块中的一个或多个模块的至少部分功能可以与其他模块的至少部分功能相结合,并在一个模块中实现。根据本公开的实施例,第二获得模块710、确定模块720、第三获得模块730以及封装模块740中的至少一个可以至少被部分地实现为硬件电路,例如现场可编程门阵列(FPGA)、可编程逻辑阵列(PLA)、片上系统、基板上的系统、封装上的系统、专用集成电路(ASIC),或可以通过对电路进行集成或封装的任何其他的合理方式等硬件或固件来实现,或以软件、硬件以及固件三种实现方式中任意一种或以其中任意几种的适当组合来实现。或者,第二获得模块710、确定模块720、第三获得模块730以及封装模块740中的至少一个可以至少被部分地实现为计算机程序模块,当该计算机程序模块被运行时,可以执行相应的功能。For example, any one of the second obtaining
示例性介质Exemplary Media
在介绍了本发明示例性实施方式的系统之后,接下来,参考图8对本发明示例性实施方式的一种计算机可读存储介质进行说明。本发明示例性实施方式提供了一种计算机可读存储介质,其上存储有可执行指令,所述指令被处理单元执行时使所述处理单元执行上文所述的方法。After introducing the system of the exemplary embodiment of the present invention, next, a computer-readable storage medium of the exemplary embodiment of the present invention will be described with reference to FIG. 8 . Exemplary embodiments of the present invention provide a computer-readable storage medium having stored thereon executable instructions that, when executed by a processing unit, cause the processing unit to perform the method described above.
在一些可能的实施方式中,本发明的各个方面还可以实现为一种程序产品的形式,其包括程序代码,当所述程序产品在电子设备上运行时,所述程序代码用于使所述电子设备执行本说明书上述“示例性方法”部分中描述的根据本发明各种示例性实施方式的方法步骤,例如,所述处理单元可以执行如图1中所示的步骤S110,在宿主机中部署待交付的应用程序;步骤S120,获得测试镜像文件,所述测试镜像文件包括用于测试所述应用程序的测试脚本和用于搭建测试环境的系统程序;步骤S130,运行所述系统程序得到容器作为测试环境;步骤S140,在所述容器中执行所述测试脚本,以得到所述应用程序的测试结果,并输出到所述宿主机。或者,所述处理单元可以执行如图4中所示的步骤S410,获得用于测试待交付的应用程序的测试脚本;步骤S420,基于所述测试脚本,确定构建文件;步骤S430,获得包括用于搭建测试环境的系统程序的基础镜像文件;步骤S440,基于所述构建文件,将所述测试脚本和所述系统程序封装为测试镜像文件。In some possible implementations, aspects of the present invention may also be implemented in the form of a program product comprising program code for causing the program product to run on an electronic device The electronic device executes the method steps according to various exemplary embodiments of the present invention described in the above-mentioned “Exemplary Method” section of this specification. For example, the processing unit may execute step S110 as shown in FIG. 1 , in the host computer Deploy the application to be delivered; step S120, obtain a test image file, the test image file includes a test script used to test the application and a system program used to build a test environment; step S130, run the system program to obtain The container is used as a test environment; in step S140, the test script is executed in the container to obtain the test result of the application and output to the host. Alternatively, the processing unit may execute step S410 as shown in FIG. 4 to obtain a test script for testing the application to be delivered; step S420 , determine a build file based on the test script; step S430 , obtain a test script including A basic image file of a system program for building a test environment; step S440, based on the build file, encapsulate the test script and the system program into a test image file.
所述程序产品可以采用一个或多个可读介质的任意组合。可读介质可以是可读信号介质或者可读存储介质。可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or a combination of any of the above. More specific examples (non-exhaustive list) of readable storage media include: electrical connections with one or more wires, portable disks, hard disks, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
如图8所示,描述了根据本发明的实施方式的程序产品800,其可以采用便携式紧凑盘只读存储器(CD-ROM)并包括程序代码,并可以在电子设备,例如个人电脑上运行。然而,本发明的程序产品不限于此,在本文件中,可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。As shown in FIG. 8, a program product 800 according to an embodiment of the present invention is depicted, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and which may be executed on an electronic device, such as a personal computer. However, the program product of the present invention is not limited thereto, and in this document, a readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了可读程序代码。这种传播的数据信号可以采用多种形式,包括——但不限于——电磁信号、光信号或上述的任意合适的组合。可读信号介质还可以是可读存储介质以外的任何可读介质,该可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。A readable signal medium may include a propagated data signal in baseband or as part of a carrier wave, carrying readable program code therein. Such propagated data signals may take a variety of forms including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the foregoing. A readable signal medium can also be any readable medium, other than a readable storage medium, that can transmit, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
可读介质上包含的程序代码可以用任何适当的介质传输,包括——但不限于——无线、有线、光缆,RF等等,或者上述的任意合适的组合。Program code embodied on a readable medium may be transmitted using any suitable medium including, but not limited to, wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
可以以一种或多种程序设计语言的任意组合来编写用于执行本发明操作的程序代码,所述程序设计语言包括面向对象的程序设计语言——诸如Java,C++等,还包括常规的过程式程序设计语言——诸如“C”,语言或类似的程序设计语言。程序代码可以完全地在用户电子设备上执行、部分在用户电子设备上部分在远程电子设备上执行、或者完全在远程电子设备或服务器上执行。在涉及远程电子设备的情形中,远程电子设备可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)一连接到用户电子设备,或者,可以连接到外部电子设备(例如利用因特网服务提供商来通过因特网连接)。Program code for carrying out operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages - such as Java, C++, etc., as well as conventional procedures programming language - such as "C", or a similar programming language. The program code may execute entirely on the user electronic device, partly on the user electronic device and partly on the remote electronic device, or entirely on the remote electronic device or server. In the case of remote electronic equipment, the remote electronic equipment may be connected to the user electronic equipment through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to external electronic equipment (eg, using Internet services provider to connect via the Internet).
示例性电子设备Exemplary Electronics
在介绍了本发明示例性实施方式的方法、系统和介质之后,接下来,参考图9对本发明示例性实施方式的电子设备进行说明。After introducing the method, system and medium of the exemplary embodiment of the present invention, next, the electronic device of the exemplary embodiment of the present invention will be described with reference to FIG. 9 .
本发明实施例还提供了一种电子设备。所属技术领域的技术人员能够理解,本发明的各个方面可以实现为系统、方法或程序产品。因此,本发明的各个方面可以具体实现为以下形式,即:完全的硬件实施方式、完全的软件实施方式(包括固件、微代码等),或硬件和软件方面结合的实施方式,这里可以统称为“电路”、“模块”或“系统”。The embodiment of the present invention also provides an electronic device. As will be appreciated by one skilled in the art, various aspects of the present invention may be implemented as a system, method or program product. Therefore, various aspects of the present invention can be embodied in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software aspects, which may be collectively referred to herein as implementations "circuit", "module" or "system".
在一些可能的实施方式中,根据本发明的电子设备可以至少包括至少一个处理单元、以及至少一个存储单元。其中,所述存储单元存储有程序代码,当所述程序代码被所述处理单元执行时,使得所述处理单元执行本说明书上述“示例性方法”部分中描述的根据本发明各种示例性实施方式的方法步骤。例如,所述处理单元可以执行如图1中所示的步骤S110,在宿主机中部署待交付的应用程序;步骤S120,获得测试镜像文件,所述测试镜像文件包括用于测试所述应用程序的测试脚本和用于搭建测试环境的系统程序;步骤S130,运行所述系统程序得到容器作为测试环境;步骤S140,在所述容器中执行所述测试脚本,以得到所述应用程序的测试结果,并输出到所述宿主机。或者,所述处理单元可以执行如图4中所示的步骤S410,获得用于测试待交付的应用程序的测试脚本;步骤S420,基于所述测试脚本,确定构建文件;步骤S430,获得包括用于搭建测试环境的系统程序的基础镜像文件;步骤S440,基于所述构建文件,将所述测试脚本和所述系统程序封装为测试镜像文件。In some possible implementations, the electronic device according to the present invention may include at least one processing unit and at least one storage unit. Wherein, the storage unit stores program codes, which, when executed by the processing unit, cause the processing unit to execute various exemplary implementations according to the present invention described in the above-mentioned "Exemplary Methods" section of this specification way method steps. For example, the processing unit may perform step S110 as shown in FIG. 1 to deploy the application to be delivered in the host; step S120, obtain a test image file, where the test image file includes a test image file for testing the application program The test script and the system program used to build the test environment; step S130, run the system program to obtain a container as the test environment; step S140, execute the test script in the container to obtain the test result of the application , and output to the host. Alternatively, the processing unit may execute step S410 as shown in FIG. 4 to obtain a test script for testing the application to be delivered; step S420 , determine a build file based on the test script; step S430 , obtain a test script including A basic image file of a system program for building a test environment; step S440, based on the build file, encapsulate the test script and the system program into a test image file.
下面参照图9来描述根据本发明的这种实施方式的电子设备900。如图9所示的电子设备900仅仅是一个示例,不应对本发明实施例的功能和使用范围带来任何限制。An
如图9所示,电子设备900以通用电子设备的形式表现。电子设备900的组件可以包括但不限于:上述至少一个处理单元910、上述至少一个存储单元920、连接不同系统组件(包括存储单元920和处理单元910)的总线930。As shown in FIG. 9, the
总线930包括数据总线、地址总线和控制总线。The
存储单元920可以包括易失性存储器,例如随机存取存储器(RAM)921和/或高速缓存存储器922,还可以进一步包括只读存储器(ROM)923。The
存储单元920还可以包括具有一组(至少一个)程序模块924的程序/实用工具925,这样的程序模块924包括但不限于:操作系统、一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。The
电子设备900也可以与一个或多个外部设备940(例如键盘、指向设备、蓝牙设备等)通信,这种通信可以通过输入/输出(I/O)接口950进行。并且,电子设备900还可以通过网络适配器960与一个或者多个网络(例如局域网(LAN),广域网(WAN)和/或公共网络,例如因特网)通信。如图所示,网络适配器960通过总线930与电子设备900的其它模块通信。应当明白,尽管图中未示出,可以结合电子设备900使用其它硬件和/或软件模块,包括但不限于:微代码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、RAID系统、磁带驱动器以及数据备份存储系统等。
应当注意,尽管在上文详细描述中提及了若干单元/模块或子单元/模块,但是这种划分仅仅是示例性的并非强制性的。实际上,根据本发明的实施方式,上文描述的两个或更多单元/模块的特征和功能可以在一个单元/模块中具体化。反之,上文描述的一个单元/模块的特征和功能可以进一步划分为由多个单元/模块来具体化。It should be noted that although several units/modules or sub-units/modules are mentioned in the above detailed description, this division is merely exemplary and not mandatory. Indeed, the features and functions of two or more units/modules described above may be embodied in one unit/module according to embodiments of the present invention. Conversely, the features and functions of one unit/module described above may be further subdivided to be embodied by multiple units/modules.
此外,尽管在附图中以特定顺序描述了本发明方法的操作,但是,这并非要求或者暗示必须按照该特定顺序来执行这些操作,或是必须执行全部所示的操作才能实现期望的结果。附加地或备选地,可以省略某些步骤,将多个步骤合并为一个步骤执行,和/或将一个步骤分解为多个步骤执行。Furthermore, although the operations of the methods of the present invention are depicted in the figures in a particular order, this does not require or imply that the operations must be performed in the particular order, or that all illustrated operations must be performed to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined to be performed as one step, and/or one step may be decomposed into multiple steps to be performed.
虽然已经参考若干具体实施方式描述了本发明的精神和原理,但是应该理解,本发明并不限于所公开的具体实施方式,对各方面的划分也不意味着这些方面中的特征不能组合以进行受益,这种划分仅是为了表述的方便。本发明旨在涵盖所附权利要求的精神和范围内所包括的各种修改和等同布置。While the spirit and principles of the present invention have been described with reference to a number of specific embodiments, it should be understood that the invention is not limited to the specific embodiments disclosed, nor does the division of aspects imply that features of these aspects cannot be combined to perform Benefit, this division is only for convenience of presentation. The invention is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.
Claims (11)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910908303.6A CN110647470B (en) | 2019-09-24 | 2019-09-24 | Test method and method of manufacture, apparatus, medium and electronic equipment |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910908303.6A CN110647470B (en) | 2019-09-24 | 2019-09-24 | Test method and method of manufacture, apparatus, medium and electronic equipment |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN110647470A true CN110647470A (en) | 2020-01-03 |
| CN110647470B CN110647470B (en) | 2023-07-25 |
Family
ID=69011359
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201910908303.6A Active CN110647470B (en) | 2019-09-24 | 2019-09-24 | Test method and method of manufacture, apparatus, medium and electronic equipment |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN110647470B (en) |
Cited By (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112286802A (en) * | 2020-10-23 | 2021-01-29 | 上海淇玥信息技术有限公司 | Method and device for testing program performance and electronic equipment |
| CN112306866A (en) * | 2020-10-26 | 2021-02-02 | 苏州浪潮智能科技有限公司 | Test method, system, equipment and medium |
| CN112650556A (en) * | 2020-12-25 | 2021-04-13 | 芜湖雄狮汽车科技有限公司 | Multitask concurrent testing method and device for vehicle |
| CN113468040A (en) * | 2020-03-30 | 2021-10-01 | 嘉楠明芯(北京)科技有限公司 | Program evaluating method and device and computer readable storage medium |
| CN113722201A (en) * | 2020-05-25 | 2021-11-30 | 中移(苏州)软件技术有限公司 | API consistency detection method and PaaS platform |
| CN113961925A (en) * | 2021-11-18 | 2022-01-21 | 中国工商银行股份有限公司 | Container escape detection method and device |
| CN114625478A (en) * | 2022-02-10 | 2022-06-14 | 阿里巴巴(中国)有限公司 | Application program management method and device, electronic equipment and computer readable storage medium |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20160085666A1 (en) * | 2014-09-22 | 2016-03-24 | International Business Machines Corporation | Auto-deployment and testing of system application test cases in remote server environments |
| CN106502905A (en) * | 2016-10-26 | 2017-03-15 | 腾讯科技(深圳)有限公司 | A kind of method of testing of application program, apparatus and system |
| CN108733553A (en) * | 2017-04-18 | 2018-11-02 | 北京嘀嘀无限科技发展有限公司 | Configuration method, the device and system of test device based on docker |
| CN109144880A (en) * | 2018-09-06 | 2019-01-04 | 北京京东尚科信息技术有限公司 | The management method and system of image file, equipment, storage medium |
-
2019
- 2019-09-24 CN CN201910908303.6A patent/CN110647470B/en active Active
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20160085666A1 (en) * | 2014-09-22 | 2016-03-24 | International Business Machines Corporation | Auto-deployment and testing of system application test cases in remote server environments |
| CN106502905A (en) * | 2016-10-26 | 2017-03-15 | 腾讯科技(深圳)有限公司 | A kind of method of testing of application program, apparatus and system |
| CN108733553A (en) * | 2017-04-18 | 2018-11-02 | 北京嘀嘀无限科技发展有限公司 | Configuration method, the device and system of test device based on docker |
| CN109144880A (en) * | 2018-09-06 | 2019-01-04 | 北京京东尚科信息技术有限公司 | The management method and system of image file, equipment, storage medium |
Cited By (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113468040A (en) * | 2020-03-30 | 2021-10-01 | 嘉楠明芯(北京)科技有限公司 | Program evaluating method and device and computer readable storage medium |
| CN113722201A (en) * | 2020-05-25 | 2021-11-30 | 中移(苏州)软件技术有限公司 | API consistency detection method and PaaS platform |
| CN112286802A (en) * | 2020-10-23 | 2021-01-29 | 上海淇玥信息技术有限公司 | Method and device for testing program performance and electronic equipment |
| CN112286802B (en) * | 2020-10-23 | 2023-04-25 | 上海淇玥信息技术有限公司 | A test program performance method, device and electronic equipment |
| CN112306866A (en) * | 2020-10-26 | 2021-02-02 | 苏州浪潮智能科技有限公司 | Test method, system, equipment and medium |
| CN112650556A (en) * | 2020-12-25 | 2021-04-13 | 芜湖雄狮汽车科技有限公司 | Multitask concurrent testing method and device for vehicle |
| CN113961925A (en) * | 2021-11-18 | 2022-01-21 | 中国工商银行股份有限公司 | Container escape detection method and device |
| CN114625478A (en) * | 2022-02-10 | 2022-06-14 | 阿里巴巴(中国)有限公司 | Application program management method and device, electronic equipment and computer readable storage medium |
| CN114625478B (en) * | 2022-02-10 | 2025-06-24 | 阿里巴巴(中国)有限公司 | Application management method and device, electronic device and computer-readable storage medium |
Also Published As
| Publication number | Publication date |
|---|---|
| CN110647470B (en) | 2023-07-25 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN110647470B (en) | Test method and method of manufacture, apparatus, medium and electronic equipment | |
| CN113778898B (en) | User interface automated testing methods, devices, electronic equipment and storage media | |
| US9886375B2 (en) | Automated execution of functional test scripts on a remote system within a unit testing framework | |
| US9658944B2 (en) | Generic test automation for graphical user interface (GUI) applications | |
| CN102792268B (en) | For disposing the method for virtual software application deployment configuration | |
| US20090031170A1 (en) | System and method to facilitate automatic globalization verification test | |
| CN108369532A (en) | Packaging tools for 1st and 3rd party component deployment | |
| CN108845940A (en) | A kind of enterprise information system automated function test method and system | |
| CN112835568B (en) | A project construction method and device | |
| CN111782523A (en) | Cloud service deployment test method, device, electronic device and storage medium | |
| US20240394030A1 (en) | Deriving a container from a package set | |
| US20230315615A1 (en) | Generating user interface (ui) automation test cases for workflow automation platform plugins | |
| CN111881054A (en) | User interface automation test method, system, equipment and storage medium | |
| CN115658529A (en) | Automatic testing method for user page and related equipment | |
| CN112379969A (en) | Continuous integrated delivery method based on containerized application and related equipment | |
| CN115576817A (en) | An automated test system, method, electronic device and storage medium | |
| CN114661594A (en) | A method, apparatus, medium and program product for automated testing | |
| CN112506772A (en) | Web automatic testing method and device, electronic equipment and storage medium | |
| CN111258875A (en) | Interface testing method and system, electronic device, storage medium | |
| US8413117B1 (en) | Systems and methods for focusing product testing based on areas of change within the product between product builds | |
| CN118012446A (en) | Automatic integrated deployment method and system for software version | |
| CN111881056A (en) | Automatic test framework and test method | |
| CN107480055A (en) | Method of testing, device, calculate readable storage medium storing program for executing and computing device | |
| KR20180076020A (en) | Apparatus and method for application test automation | |
| CN115185599A (en) | Project deployment method, system and storage medium based on Golang |
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 | ||
| TR01 | Transfer of patent right |
Effective date of registration: 20231116 Address after: 310052 Room 301, Building No. 599, Changhe Street Network Business Road, Binjiang District, Hangzhou City, Zhejiang Province Patentee after: Hangzhou NetEase Shuzhifan Technology Co.,Ltd. Address before: 310052 Building No. 599, Changhe Street Network Business Road, Binjiang District, Hangzhou City, Zhejiang Province, 4, 7 stories Patentee before: NETEASE (HANGZHOU) NETWORK Co.,Ltd. |
|
| TR01 | Transfer of patent right |

