[go: up one dir, main page]

CN114780431A - SAI THRIFT automatic test method - Google Patents

SAI THRIFT automatic test method Download PDF

Info

Publication number
CN114780431A
CN114780431A CN202210501979.5A CN202210501979A CN114780431A CN 114780431 A CN114780431 A CN 114780431A CN 202210501979 A CN202210501979 A CN 202210501979A CN 114780431 A CN114780431 A CN 114780431A
Authority
CN
China
Prior art keywords
test
server
sai
script
thrift
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
CN202210501979.5A
Other languages
Chinese (zh)
Inventor
邢家茂
李贯中
樊立鹏
李晓林
田成
肖立娜
陈清华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Clounix Technology Ltd
Original Assignee
Hangzhou Clounix Technology 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 Hangzhou Clounix Technology Ltd filed Critical Hangzhou Clounix Technology Ltd
Priority to CN202210501979.5A priority Critical patent/CN114780431A/en
Publication of CN114780431A publication Critical patent/CN114780431A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3698Environments for analysis, debugging or testing of software
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44568Immediately runnable code
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4488Object-oriented
    • G06F9/449Object-oriented method invocation or resolution

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses an SAI THRIFT automatic test method, which has excellent universality, supports the test verification requirements of three scenes in a set of test framework, and forms three test kits, namely an automatic test kit, a new environment test kit and a development test kit based on a set of universal deploy and autotest scripts. The automatic testing and verifying task calls an automatic verification suite, so that the quality of engineering codes can be ensured; when a testing framework is deployed SAI THRIFT in the new environment, a new environment testing suite is called, and the SAI THRIFT testing environment can be rapidly deployed; and carrying out engineering development or problem positioning and modifying scenes, calling a development test suite before preparing to submit codes, and carrying out test verification by using the generated mirror image to confirm that the newly added codes have no influence on the existing functions. The invention can ensure the stability of SAI THRIFT test and effectively improve the efficiency of SAI development and maintenance.

Description

SAI THRIFT自动化测试方法SAI THRIFT automated testing method

技术领域technical field

本发明涉及服务部署测试技术领域,特别涉及一种SAI THRIFT自动化测试方法。The invention relates to the technical field of service deployment testing, in particular to a SAI THRIFT automated testing method.

背景技术Background technique

Thrift是一个跨语言跨平台的服务部署框架,通过接口定义语言来定义RPC的接口和数据类型,再通过Thrift编译器生成不同的语言代码(支持C++、Java、Python、PHP、Ruby、Erlang等语言),并由生成的代码负责RPC协议层和传输层的实现。RPC(RemoteProcedure Call)是一种远程调用协议,简单地说就是能使应用像调用本地方法一样的调用远程的过程或服务,可以应用在分布式服务、分布式计算、远程服务调用等许多场景。Thrift is a cross-language and cross-platform service deployment framework. It defines RPC interfaces and data types through the interface definition language, and then generates different language codes (supports C++, Java, Python, PHP, Ruby, Erlang and other languages) through the Thrift compiler. ), and the generated code is responsible for the implementation of the RPC protocol layer and the transport layer. RPC (RemoteProcedure Call) is a remote calling protocol. Simply put, it enables applications to call remote procedures or services as if they were calling local methods. It can be used in many scenarios such as distributed services, distributed computing, and remote service calls.

SAI Thrift 是一套基于Thrift技术的SAI功能测试框架,如图1所示,由一台服务器(Test Machine)和一台被测设备(DUT,Device Under Test)组成,服务器的网卡与被测设备的网络端口直连。DUT作为SAI Thrift测试Server的角色,服务器Test Machine作为SAI Thrift 测试的Client角色。在被测设备Switch上运行SAI Server Container,也称为Thrift Test Server;使用一台安装多INTF网卡的服务器作为Test Machine,也称为SAIThrift Test Client,服务器接口与被测试设备存在物理连接;在SAI Thrift TestClient上执行测试PTF脚本,测试被测设备的功能和性能。当前测试设备与测试服务器,使用了多个网络端口互联,以进行设备的功能测试。Test Machine服务器先远程调用DUT上的SAI对外接口,进行Device的配置;Test Machine服务器再构造组装报文,通过网卡发送到DUT;之后检查网卡是否收到的来自DUT的报文,若收到报文则进一步检查报文格式是否符合预期,以达到DUT报文转发功能测试的目的。SAI Thrift is a set of SAI functional testing framework based on Thrift technology. As shown in Figure 1, it consists of a server (Test Machine) and a device under test (DUT, Device Under Test). The network card of the server is connected to the device under test. directly connected to the network port. The DUT acts as the SAI Thrift test server, and the server Test Machine acts as the SAI Thrift test client. Run SAI Server Container, also known as Thrift Test Server, on the device under test Switch; use a server with multiple INTF network cards as Test Machine, also known as SAIThrift Test Client, and the server interface is physically connected to the device under test; Execute the test PTF script on the Thrift TestClient to test the function and performance of the device under test. At present, the test equipment and the test server are interconnected using multiple network ports for functional testing of the equipment. The Test Machine server first remotely calls the SAI external interface on the DUT to configure the Device; the Test Machine server then constructs the assembly message and sends it to the DUT through the network card; then checks whether the network card receives the message from the DUT, if received The document further checks whether the packet format meets the expectations, so as to achieve the purpose of testing the DUT packet forwarding function.

在工程化的程序开发实践中,通常代码的版本控制与编译环境集成在一起。通过代码的版本控制工具更新和管理代码,从版本控制工具获取的代码目录,可以进行程序版本的编译。为保证开发工程的质量,可部署自动化测试任务。为了提高开发的效率,同样建立自动化编译任务,在服务器上定期进行代码编译。In the practice of engineering program development, usually the version control of the code is integrated with the compilation environment. The code is updated and managed through the code version control tool, and the program version can be compiled from the code directory obtained from the version control tool. To ensure the quality of the development project, automated testing tasks can be deployed. In order to improve the efficiency of development, an automated compilation task is also established, and code compilation is performed on the server on a regular basis.

在SAI Thrift的应用实践中,缺少一个同时适配自动构建版本自动化测试,新测试环境SAI THRIFT部署和测试验证,以及编译服务器自主编译版本测试的测试框架。In the application practice of SAI Thrift, there is a lack of a test framework that can simultaneously adapt to automatic build version automated testing, new test environment SAI THRIFT deployment and test verification, and compile server self-compiled version testing.

发明内容SUMMARY OF THE INVENTION

根据本发明实施例,提供了一种SAI THRIFT自动化测试方法,包含如下步骤:According to an embodiment of the present invention, a SAI THRIFT automated testing method is provided, comprising the following steps:

创建编码和编译服务器,用于负责编译用到的系统镜像;Create an encoding and compilation server to be responsible for compiling the system images used;

创建自动化测试服务器,用于触发定时编译、定时自动化测试执行;Create an automated test server to trigger scheduled compilation and scheduled automated test execution;

对SAI Thrift自动化测试、新测试环境部署执行SAI THRIFT自动化测试以及开发人员编译版本的自动化测试的需求进行抽象分析,获得镜像构建、测试环境部署以及测试用例执行三个执行动作;Abstractly analyze the requirements of SAI Thrift automated testing, new test environment deployment to execute SAI THRIFT automated testing, and automated testing of the developer's compiled version, and obtain three execution actions: image construction, test environment deployment, and test case execution;

镜像构建可自动编译构建或开发人员自主编译构建;Mirror construction can be automatically compiled or built by developers;

将测试环境部署抽象形成deploy脚本,适配基于测试服务器的本地部署执行以及代码服务器的远程部署执行;The deployment of the test environment is abstracted into a deploy script, which adapts to the local deployment execution based on the test server and the remote deployment execution of the code server;

将测试用例执行抽象为autotest脚本,也适配基于测试服务器的本地部署执行以及代码服务器的远程部署执行;The test case execution is abstracted into an autotest script, and it is also adapted to the local deployment execution based on the test server and the remote deployment execution of the code server;

以deploy脚本和autotest脚本为基础,进行包装抽象,获得自动化测试套件、新环境测试套件、开发测试套件,分别用于进行SAI Thrift自动化测试、新测试环境部署执行SAI THRIFT自动化测试以及开发人员编译版本的自动化测试。Based on the deploy script and autotest script, carry out packaging abstraction to obtain automated test suites, new environment test suites, and development test suites, which are respectively used for SAI Thrift automated testing, new test environment deployment to execute SAI THRIFT automated testing, and developer compiled versions of automated tests.

进一步,自动编译构建由编码服务器定时执行,借助Jenkins持续集成工具进行编译任务的定时触发。Further, the automatic compilation and construction are executed regularly by the encoding server, and the compilation task is triggered regularly by the Jenkins continuous integration tool.

进一步,开发人员自主编译构建采用增量编译的方式,只编译修改的文件。Further, developers independently compile and build by incremental compilation, only compiling modified files.

进一步,使用自动化测试套件进行SAI Thrift自动化测试具体为:Further, using the automated test suite for SAI Thrift automated testing is specifically:

自动化编译工程,定时进行工程的编译,获得编译的镜像,将编译的镜像推送到指定的位置存储;Automatically compile the project, compile the project regularly, obtain the compiled image, and push the compiled image to the specified location for storage;

自动化测试任务,调用deploy脚本完成镜像的部署;Automate test tasks and call deploy scripts to complete image deployment;

调用autotest脚本进行自动化测试,生成自动化测试结果;Call the autotest script for automated testing and generate automated test results;

分析自动化测试结果,生成自动化测试报告,并通过邮件或其他工具推送给相关人员。Analyze automated test results, generate automated test reports, and send them to relevant personnel via email or other tools.

进一步,当测试服务器存储资源充足时,使用新环境测试套件进行新测试环境部署执行SAI THRIFT自动化测试具体为:Further, when the storage resources of the test server are sufficient, use the new environment test suite to deploy the new test environment and execute the SAI THRIFT automated test as follows:

从编译服务器中获取LoadJenkinsImage脚本,使用LoadJenkinsImage脚本,将自动编译的镜像和编译生成的saithrift中间文件下载到版本控制工具的代码目录,再拷贝到测试服务器;Obtain the LoadJenkinsImage script from the compilation server, use the LoadJenkinsImage script to download the automatically compiled image and the saithrift intermediate file generated by the compilation to the code directory of the version control tool, and then copy it to the test server;

在测试服务器上,执行deploy脚本,执行镜像的部署;On the test server, execute the deploy script to deploy the image;

在测试服务器上,调用autotest脚本,执行自动化测试,获得自动化测试结果;On the test server, call the autotest script, execute the automated test, and obtain the automated test result;

分析自动化测试结果,确认对代码目录做的修改,对基本功能无影响。Analyze the automated test results and confirm that the changes made to the code directory have no effect on the basic functions.

进一步,当测试服务器存储资源紧张时,使用新环境测试套件进行新测试环境部署执行SAI THRIFT自动化测试具体为:Further, when the storage resources of the test server are limited, use the new environment test suite to deploy the new test environment and execute the SAI THRIFT automated test as follows:

从编译服务器中获取LoadJenkinsImage脚本,使用LoadJenkinsImage脚本,将编译的镜像和编译生成的saithrift中间文件下载到版本控制工具的代码目录;Obtain the LoadJenkinsImage script from the compilation server, and use the LoadJenkinsImage script to download the compiled image and the saithrift intermediate file generated by the compilation to the code directory of the version control tool;

在代码服务器上,远程调用执行deploy脚本,执行镜像的部署;On the code server, remotely call and execute the deploy script to deploy the image;

在代码服务器上,远程调用autotest脚本,执行自动化测试,获得自动化测试结果;On the code server, remotely call the autotest script, execute automated tests, and obtain automated test results;

分析自动化测试结果,确认对代码目录做的修改,对基本功能无影响。Analyze the automated test results and confirm that the changes made to the code directory have no effect on the basic functions.

进一步,当测试服务器存储资源紧张时,使用开发测试套件进行开发人员编译版本的自动化测试具体为:Further, when the storage resources of the test server are limited, the automated testing of the developer-compiled version using the development test suite is as follows:

使用代码管理服务器,修改指定的代码,针对修改的代码进行增量编译,生成镜像;Use the code management server to modify the specified code, perform incremental compilation for the modified code, and generate an image;

从编译服务器中获取LoadJenkinsImage脚本,调用LoadJenkinsImage脚本,将生成的镜像和编译生成的saithrift中间文件整理到一个文件夹中;Obtain the LoadJenkinsImage script from the compilation server, call the LoadJenkinsImage script, and organize the generated image and the compiled saithrift intermediate files into a folder;

在代码服务器上,调用deploy脚本,将生成的镜像部署到测试服务器和测试设备;On the code server, call the deploy script to deploy the generated image to the test server and test equipment;

在代码服务器上,调用autotest脚本,执行自动化测试,获得自动化测试结果;On the code server, call the autotest script, execute the automated test, and obtain the automated test result;

分析自动化测试结果,确认对代码目录做的修改,对基本功能无影响。Analyze the automated test results and confirm that the changes made to the code directory have no effect on the basic functions.

进一步,当测试服务器存储资源充足时,使用开发测试套件进行开发人员编译版本的自动化测试具体为:Further, when the storage resources of the test server are sufficient, the automated testing of the compiled version of the developer using the development test suite is as follows:

使用代码管理服务器,修改指定的代码,针对修改的代码进行增量编译,生成镜像;Use the code management server to modify the specified code, perform incremental compilation for the modified code, and generate an image;

从编译服务器中获取LoadJenkinsImage脚本,调用LoadJenkinsImage脚本,将生成的镜像和编译生成的saithrift中间文件整理到一个文件夹中,并打包压缩文件夹后拷贝到测试服务器;Obtain the LoadJenkinsImage script from the compilation server, call the LoadJenkinsImage script, organize the generated image and the compiled saithrift intermediate files into a folder, package and compress the folder and copy it to the test server;

在测试服务器上,执行deploy脚本,执行镜像的部署;On the test server, execute the deploy script to deploy the image;

在测试服务器上,调用autotest脚本,执行自动化测试,获得自动化测试结构;On the test server, call the autotest script, execute the automated test, and obtain the automated test structure;

分析自动化测试结果,确认对代码目录做的修改,对基本功能无影响。Analyze the automated test results and confirm that the changes made to the code directory have no effect on the basic functions.

根据本发明实施例的SAI THRIFT自动化测试方法,本发明具有极好的通用性,将三种场景的测试验证需求在一套测试框架中进行了支持,基于一套通用的deploy和autotest脚本,形成了三个测试套件——自动化测试套件、新环境测试套件、开发测试套件。自动化测试验证任务调用自动化验证套件,可保证工程代码的质量;在新环境部署SAITHRIFT测试框架时,调用新环境测试套件,可快速部署SAI THRIFT测试环境;进行工程开发或者问题定位修改场景,准备进行代码提交前,可调用开发测试套件,使用生成的镜像进行测试验证,确认新增代码对已有功能无影响。本发明可保证SAI THRIFT测试的稳定性,有效提高SAI开发维护的效率。According to the SAI THRIFT automated testing method of the embodiment of the present invention, the present invention has excellent versatility, and supports the test verification requirements of the three scenarios in a set of test frameworks. Based on a set of general deploy and autotest scripts, the Three test suites were created - automated test suite, new environment test suite, development test suite. The automated test verification task invokes the automated verification suite to ensure the quality of the engineering code; when deploying the SAITHRIFT test framework in the new environment, the new environment test suite is invoked to quickly deploy the SAI THRIFT test environment; for engineering development or problem location, modify the scenario and prepare for Before code submission, you can call the development test suite and use the generated image for test verification to confirm that the new code has no effect on the existing functions. The present invention can ensure the stability of the SAI THRIFT test and effectively improve the efficiency of SAI development and maintenance.

要理解的是,前面的一般描述和下面的详细描述两者都是示例性的,并 且意图在于提供要求保护的技术的进一步说明。It is to be understood that both the foregoing general description and the following detailed description are exemplary and are intended to provide further explanation of the claimed technology.

附图说明Description of drawings

图1为现有技术的SAI Thrift的测试框架图。FIG. 1 is a test frame diagram of SAI Thrift in the prior art.

图2为根据本发明实施例SAI THRIFT自动化测试方法的测试框架图。FIG. 2 is a test frame diagram of the SAI THRIFT automated test method according to an embodiment of the present invention.

图3为根据本发明实施例SAI THRIFT自动化测试方法的流程图。FIG. 3 is a flowchart of a SAI THRIFT automated testing method according to an embodiment of the present invention.

具体实施方式Detailed ways

以下将结合附图,详细描述本发明的优选实施例,对本发明做进一步阐述。The preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings to further illustrate the present invention.

首先,将结合图2~3描述根据本发明实施例的SAI THRIFT自动化测试方法,用于进行设备的功能测试,其应用场景很广。First, the SAI THRIFT automated testing method according to an embodiment of the present invention will be described with reference to FIGS. 2 to 3 , which is used for functional testing of equipment, and has a wide range of application scenarios.

如图2~3所示,本发明实施例的SAI THRIFT自动化测试方法,包含如下步骤:As shown in Figures 2 to 3, the SAI THRIFT automated testing method according to the embodiment of the present invention includes the following steps:

在S1中,如图3所示,创建编码和编译服务器,用于负责编译用到的系统镜像。在本实施例中,系统镜像包含SAI(Thrift) Server Docker Image和PTF Client DockerImage。In S1, as shown in Figure 3, an encoding and compiling server is created to be responsible for compiling the system image used. In this embodiment, the system image includes SAI (Thrift) Server Docker Image and PTF Client Docker Image.

在S2中,如图3所示,创建自动化测试服务器,用于触发定时编译、定时自动化测试执行。In S2, as shown in Figure 3, an automated test server is created for triggering timing compilation and timing automated test execution.

在S3中,如图3所示,对SAI Thrift自动化测试、新测试环境部署执行SAI THRIFT自动化测试以及开发人员编译版本的自动化测试的需求进行抽象分析,获得镜像构建、测试环境部署以及测试用例执行三个执行动作。In S3, as shown in Figure 3, abstract analysis of the requirements for SAI Thrift automated testing, new test environment deployment and execution of SAI THRIFT automated testing, and automated testing of developers' compiled versions to obtain image construction, test environment deployment, and test case execution. Three perform actions.

在S4中,如图3所示,镜像构建可自动编译构建或开发人员自主编译构建。在本实施例中,进一步,自动编译构建由编码服务器定时执行,借助Jenkins持续集成工具进行编译任务的定时触发。开发人员自主编译构建采用增量编译的方式,只编译修改的文件,快速构建处来版本镜像。In S4, as shown in Figure 3, the image build can be automatically compiled or built by developers. In this embodiment, further, the automatic compilation and construction are executed by the encoding server periodically, and the compilation task is triggered regularly by means of the Jenkins continuous integration tool. Developers independently compile and build using incremental compilation, only compiling modified files, and quickly building the version image.

在S5中,如图3所示,将测试环境部署抽象形成deploy脚本,适配基于测试服务器的本地部署执行以及代码服务器的远程部署执行。In S5, as shown in Figure 3, the deployment of the test environment is abstracted into a deploy script, which is adapted to the local deployment execution based on the test server and the remote deployment execution of the code server.

在S6中,如图3所示,将测试用例执行抽象为autotest脚本,也适配基于测试服务器的本地部署执行以及代码服务器的远程部署执行。In S6, as shown in Figure 3, the test case execution is abstracted into an autotest script, which is also adapted to the local deployment execution based on the test server and the remote deployment execution of the code server.

在S7中,如图3所示,以deploy脚本和autotest脚本为基础,进行包装抽象,获得自动化测试套件、新环境测试套件、开发测试套件,分别用于进行SAI Thrift自动化测试、新测试环境部署执行SAI THRIFT自动化测试以及开发人员编译版本的自动化测试。In S7, as shown in Figure 3, based on the deploy script and the autotest script, the packaging abstraction is performed to obtain automated test suites, new environment test suites, and development test suites, which are respectively used for SAI Thrift automated testing and new test environment deployment. Execute SAI THRIFT automated tests as well as automated tests of developer-compiled versions.

进一步,在本实施例中,使用自动化测试套件进行SAI Thrift自动化测试具体为:Further, in this embodiment, using the automated test suite to perform the SAI Thrift automated test is specifically:

自动化编译工程,定时进行工程的编译,获得编译的镜像,将编译的镜像推送到指定的位置存储;Automatically compile the project, compile the project regularly, obtain the compiled image, and push the compiled image to the specified location for storage;

自动化测试任务,调用deploy脚本完成镜像的部署;Automate test tasks and call deploy scripts to complete image deployment;

调用autotest脚本进行自动化测试,生成自动化测试结果;Call the autotest script for automated testing and generate automated test results;

分析自动化测试结果,生成自动化测试报告,并通过邮件或其他工具推送给相关人员。Analyze automated test results, generate automated test reports, and send them to relevant personnel via email or other tools.

进一步,在本实施例中,当测试服务器存储资源充足时,使用新环境测试套件进行新测试环境部署执行SAI THRIFT自动化测试具体为:Further, in this embodiment, when the storage resources of the test server are sufficient, using the new environment test suite to deploy the new test environment and execute the SAI THRIFT automated test is specifically:

从编译服务器中获取LoadJenkinsImage脚本,使用LoadJenkinsImage脚本,将自动编译的镜像和编译生成的saithrift中间文件下载到版本控制工具的代码目录,再拷贝到测试服务器;Obtain the LoadJenkinsImage script from the compilation server, use the LoadJenkinsImage script to download the automatically compiled image and the saithrift intermediate file generated by the compilation to the code directory of the version control tool, and then copy it to the test server;

在测试服务器上,执行deploy脚本,执行镜像的部署;On the test server, execute the deploy script to deploy the image;

在测试服务器上,调用autotest脚本,执行自动化测试,获得自动化测试结果;On the test server, call the autotest script, execute the automated test, and obtain the automated test result;

分析自动化测试结果,确认对代码目录做的修改,对基本功能无影响。Analyze the automated test results and confirm that the changes made to the code directory have no effect on the basic functions.

进一步,在本实施例中,当测试服务器存储资源紧张时,使用新环境测试套件进行新测试环境部署执行SAI THRIFT自动化测试具体为:Further, in this embodiment, when the storage resources of the test server are short, using the new environment test suite to deploy the new test environment and execute the SAI THRIFT automated test is specifically:

从编译服务器中获取LoadJenkinsImage脚本,使用LoadJenkinsImage脚本,将编译的镜像和编译生成的saithrift中间文件下载到版本控制工具的代码目录;Obtain the LoadJenkinsImage script from the compilation server, and use the LoadJenkinsImage script to download the compiled image and the saithrift intermediate file generated by the compilation to the code directory of the version control tool;

在代码服务器上,远程调用执行deploy脚本,执行镜像的部署;On the code server, remotely call and execute the deploy script to deploy the image;

在代码服务器上,远程调用autotest脚本,执行自动化测试,获得自动化测试结果;On the code server, remotely call the autotest script, execute automated tests, and obtain automated test results;

分析自动化测试结果,确认对代码目录做的修改,对基本功能无影响。Analyze the automated test results and confirm that the changes made to the code directory have no effect on the basic functions.

进一步,在本实施例中,当测试服务器存储资源紧张时,使用开发测试套件进行开发人员编译版本的自动化测试具体为:Further, in this embodiment, when the storage resources of the test server are in short supply, using the development test suite to perform the automated test of the compiled version of the developer is specifically:

使用代码管理服务器,修改指定的代码,针对修改的代码进行增量编译,生成镜像;Use the code management server to modify the specified code, perform incremental compilation for the modified code, and generate an image;

从编译服务器中获取LoadJenkinsImage脚本,调用LoadJenkinsImage脚本,将生成的镜像和编译生成的saithrift中间文件整理到一个文件夹中;Obtain the LoadJenkinsImage script from the compilation server, call the LoadJenkinsImage script, and organize the generated image and the compiled saithrift intermediate files into a folder;

在代码服务器上,调用deploy脚本,将生成的镜像部署到测试服务器和测试设备;On the code server, call the deploy script to deploy the generated image to the test server and test equipment;

在代码服务器上,调用autotest脚本,执行自动化测试,获得自动化测试结果;On the code server, call the autotest script, execute the automated test, and obtain the automated test result;

分析自动化测试结果,确认对代码目录做的修改,对基本功能无影响。Analyze the automated test results and confirm that the changes made to the code directory have no effect on the basic functions.

进一步,在本实施例中,当测试服务器存储资源充足时,使用开发测试套件进行开发人员编译版本的自动化测试具体为:Further, in this embodiment, when the storage resources of the test server are sufficient, using the development test suite to perform the automated test of the compiled version of the developer is specifically:

使用代码管理服务器,修改指定的代码,针对修改的代码进行增量编译,生成镜像;Use the code management server to modify the specified code, perform incremental compilation for the modified code, and generate an image;

从编译服务器中获取LoadJenkinsImage脚本,调用LoadJenkinsImage脚本,将生成的镜像和编译生成的saithrift中间文件整理到一个文件夹中,并打包压缩文件夹后拷贝到测试服务器;Obtain the LoadJenkinsImage script from the compilation server, call the LoadJenkinsImage script, organize the generated image and the compiled saithrift intermediate files into a folder, package and compress the folder and copy it to the test server;

在测试服务器上,执行deploy脚本,执行镜像的部署;On the test server, execute the deploy script to deploy the image;

在测试服务器上,调用autotest脚本,执行自动化测试,获得自动化测试结构;On the test server, call the autotest script, execute the automated test, and obtain the automated test structure;

分析自动化测试结果,确认对代码目录做的修改,对基本功能无影响。Analyze the automated test results and confirm that the changes made to the code directory have no effect on the basic functions.

以上,参照图2~3描述了根据本发明实施例的SAI THRIFT自动化测试方法,本发明具有极好的通用性,将三种场景的测试验证需求在一套测试框架中进行了支持,基于一套通用的deploy和autotest脚本,形成了三个测试套件——自动化测试套件、新环境测试套件、开发测试套件。自动化测试验证任务调用自动化验证套件,可保证工程代码的质量;在新环境部署SAI THRIFT测试框架时,调用新环境测试套件,可快速部署SAI THRIFT测试环境;进行工程开发或者问题定位修改场景,准备进行代码提交前,可调用开发测试套件,使用生成的镜像进行测试验证,确认新增代码对已有功能无影响。本发明可保证SAI THRIFT测试的稳定性,有效提高SAI开发维护的效率。The SAI THRIFT automated testing method according to the embodiment of the present invention is described above with reference to FIGS. 2 to 3. The present invention has excellent versatility, and supports the test verification requirements of three scenarios in a set of test frameworks. A set of common deploy and autotest scripts to form three test suites - automated test suites, new environment test suites, and development test suites. The automated test verification task invokes the automated verification suite to ensure the quality of the engineering code; when deploying the SAI THRIFT test framework in the new environment, the new environment test suite is invoked to quickly deploy the SAI THRIFT test environment; for engineering development or problem location, modify the scenario and prepare Before submitting the code, you can call the development test suite and use the generated image for test verification to confirm that the new code has no effect on the existing functions. The present invention can ensure the stability of the SAI THRIFT test and effectively improve the efficiency of SAI development and maintenance.

需要说明的是,在本说明书中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包含……”限定的要素,并不排除在包括要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that, in this specification, the terms "comprising", "comprising" or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements , but also other elements not expressly listed or inherent to such a process, method, article or apparatus. Without further limitation, an element defined by the phrase "comprises..." does not preclude the presence of additional identical elements in the process, method, article, or device that includes the element.

尽管本发明的内容已经通过上述优选实施例作了详细介绍,但应当认识到上述的描述不应被认为是对本发明的限制。在本领域技术人员阅读了上述内容后,对于本发明的多种修改和替代都将是显而易见的。因此,本发明的保护范围应由所附的权利要求来限定。While the content of the present invention has been described in detail by way of the above preferred embodiments, it should be appreciated that the above description should not be construed as limiting the present invention. Various modifications and alternatives to the present invention will be apparent to those skilled in the art upon reading the foregoing. Accordingly, the scope of protection of the present invention should be defined by the appended claims.

Claims (8)

1. An SAI THRIFT automatic test method, comprising the steps of:
creating a coding and compiling server for taking charge of a system mirror image used for compiling;
creating an automatic test server for triggering timing compilation and timing automatic test execution;
carrying out abstract analysis on requirements of SAI thread automated testing, deployment and execution SAI THRIFT automated testing of a new testing environment and automated testing of a developer compiling version to obtain three execution actions of mirror image construction, testing environment deployment and test case execution;
the mirror image construction can be automatically compiled and constructed or independently compiled and constructed by developers;
deploying and abstracting the test environment to form a deployment script, and adapting to local deployment execution based on a test server and remote deployment execution of a code server;
abstracting the test case execution into an autotest script, and adapting to local deployment execution based on the test server and remote deployment execution of the code server;
and packaging and abstracting on the basis of the deployment script and the autotest script to obtain an automatic test suite, a new environment test suite and a development test suite, wherein the automatic test suites are respectively used for carrying out the SAI Thrift automatic test, the new test environment deployment execution SAI THRIFT automatic test and the automatic test of the developer compiling version.
2. The automated SAI THRIFT test method of claim 1, wherein the automated compilation build is executed periodically by the code server, with timed triggering of compilation tasks by Jenkins persistent integration tools.
3. The automated SAI THRIFT test method of claim 1, wherein the developer autonomic compilation constructs compilation only modified files in an incremental compilation.
4. The automated test method SAI THRIFT of claim 1, wherein performing the SAI thread automated test using the automated test kit specifically comprises:
the method comprises the steps of automatically compiling a project, regularly compiling the project, obtaining a compiled mirror image, and pushing the compiled mirror image to a specified position for storage;
the automatic test task calls the deployment script to complete the deployment of the mirror image;
calling the autotest script to perform automatic testing, and generating an automatic testing result;
and analyzing the automatic test result, generating an automatic test report, and pushing the report to related personnel through mails or other tools.
5. The automated testing method SAI THRIFT of claim 1, wherein when the test server storage resources are sufficient, performing the new test environment deployment execution SAI THRIFT automated testing using the new environment test suite specifically comprises:
acquiring a LoadJenkins image script from the compiling server, downloading an automatically compiled mirror image and a saitthrift intermediate file generated by compiling to a code directory of a version control tool by using the LoadJenkins image script, and copying the code directory to the testing server;
executing the deployment script and the deployment of the mirror image on the test server;
calling an autotest script on the test server, executing an automatic test, and obtaining an automatic test result;
and analyzing the automatic test result, and confirming the modification of the code directory without influencing the basic function.
6. The automated test method SAI THRIFT as claimed in claim 1, wherein when the test server is in a short storage resource, performing the new test environment deployment execution SAI THRIFT automated testing using the new environment test suite specifically comprises:
acquiring a LoadJenkins image script from the compiling server, and downloading a compiled mirror image and a saitthrift intermediate file generated by compiling to a code directory of a version control tool by using the LoadJenkins image script;
remotely calling and executing the deployment script on the code server, and executing the deployment of the mirror image;
remotely calling an autotest script on the code server, executing an automatic test, and obtaining an automatic test result;
and analyzing the automatic test result, and confirming the modification of the code directory without influencing the basic function.
7. The automated test method SAI THRIFT of claim 1, wherein when the test server is in a short storage resource state, using the development test suite to perform automated testing of the compiled version of the developer is specifically:
modifying the specified code by using a code management server, and performing incremental compilation aiming at the modified code to generate a mirror image;
acquiring a LoadJenkins image script from the compiling server, calling the LoadJenkins image script, and arranging the generated mirror image and the saitthrift intermediate file generated by compiling into a folder;
calling the deployment script on the code server, and deploying the generated mirror image to the test server and the test equipment;
calling the autotest script on the code server, executing an automatic test, and obtaining an automatic test result;
and analyzing the automatic test result, and confirming the modification of the code catalog without influencing the basic function.
8. The automated test method SAI THRIFT of claim 1, wherein when the test server has sufficient storage resources, the automated testing of the compiled version of the developer using the development test suite is performed by:
modifying the specified code by using a code management server, and performing incremental compilation aiming at the modified code to generate a mirror image;
acquiring a LoadJenkins image script from the compiling server, calling the LoadJenkins image script, arranging the generated mirror image and the saitthrift intermediate file generated by compiling into a folder, packaging and compressing the folder, and copying the folder to the testing server;
executing the deployment script and the deployment of the mirror image on the test server;
calling the autotest script on the test server, executing an automatic test, and obtaining an automatic test structure;
and analyzing the automatic test result, and confirming the modification of the code directory without influencing the basic function.
CN202210501979.5A 2022-05-10 2022-05-10 SAI THRIFT automatic test method Pending CN114780431A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210501979.5A CN114780431A (en) 2022-05-10 2022-05-10 SAI THRIFT automatic test method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210501979.5A CN114780431A (en) 2022-05-10 2022-05-10 SAI THRIFT automatic test method

Publications (1)

Publication Number Publication Date
CN114780431A true CN114780431A (en) 2022-07-22

Family

ID=82436648

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210501979.5A Pending CN114780431A (en) 2022-05-10 2022-05-10 SAI THRIFT automatic test method

Country Status (1)

Country Link
CN (1) CN114780431A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8196112B1 (en) * 2008-02-15 2012-06-05 Amazon Technologies, Inc. Systems and methods for testing widgets in computer environments
US20130174117A1 (en) * 2011-12-29 2013-07-04 Christina Watters Single development test environment
CN109358858A (en) * 2018-09-19 2019-02-19 网易(杭州)网络有限公司 Automated deployment method, apparatus, medium and electronic device
CN110399307A (en) * 2019-07-31 2019-11-01 网宿科技股份有限公司 A test method, test platform and target server
CN112765043A (en) * 2021-03-16 2021-05-07 上饶市中科院云计算中心大数据研究院 Automatic testing method and device based on docker
CN113407451A (en) * 2021-06-23 2021-09-17 深圳市商汤科技有限公司 Test method, device, equipment, storage medium and program product

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8196112B1 (en) * 2008-02-15 2012-06-05 Amazon Technologies, Inc. Systems and methods for testing widgets in computer environments
US20130174117A1 (en) * 2011-12-29 2013-07-04 Christina Watters Single development test environment
CN109358858A (en) * 2018-09-19 2019-02-19 网易(杭州)网络有限公司 Automated deployment method, apparatus, medium and electronic device
CN110399307A (en) * 2019-07-31 2019-11-01 网宿科技股份有限公司 A test method, test platform and target server
CN112765043A (en) * 2021-03-16 2021-05-07 上饶市中科院云计算中心大数据研究院 Automatic testing method and device based on docker
CN113407451A (en) * 2021-06-23 2021-09-17 深圳市商汤科技有限公司 Test method, device, equipment, storage medium and program product

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
徐星;李银桥;刘学锋;毛建华;: "企业开发、测试环境快速部署方案的设计与实现", 工业控制计算机, no. 03, 25 March 2018 (2018-03-25) *

Similar Documents

Publication Publication Date Title
CN110096425B (en) A kind of automatic testing method, device and storage medium based on QT development mode
US9760343B2 (en) Application builder based on metadata
CA3094320A1 (en) Unified test automation system
CN106406960B (en) A method for rapid software deployment in linux environment
CN109933522A (en) A test method, test system and storage medium for an automated use case
CN109086051B (en) Application component deployment method and device and computer storage medium
US20240143468A1 (en) System and methods for testing microservices
CN111324522A (en) Automatic test system and method
CN107832207A (en) Interface performance test method, apparatus, storage medium and computer equipment
US10606586B2 (en) Application architecture generation
CN108319460A (en) Method and device for generating application program installation package, electronic equipment and storage medium
CN111506322A (en) Automatic integrated construction development deployment platform and method
WO2017041499A1 (en) Software upgrade method and system, and computer-readable storage medium
EP3447635A1 (en) Application architecture generation
CN106649073A (en) Test method and device based on dynamic script template
CN113220337A (en) Version construction method and device, computer equipment and storage medium
CN109933536A (en) A method and system for intelligent integrated automated testing
CN113687858A (en) Configuration file checking method and device, electronic equipment and storage medium
CN112395184A (en) Information acquisition method, equipment and computer storage medium
CN113704081A (en) Automatic testing method and system for application program compatibility
US10459698B2 (en) Framework for generating adapters in an integrated development environment
CN112445513A (en) Installation package processing method and device
CN113485726B (en) Application environment delivery method and device
CN114780431A (en) SAI THRIFT automatic test method
CN111125149A (en) Hive-based data acquisition method and device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Country or region after: China

Address after: 3 / F, 665 Zhangjiang Road, China (Shanghai) pilot Free Trade Zone, Pudong New Area, Shanghai

Applicant after: Yunhe Zhiwang (Shanghai) Technology Co.,Ltd.

Address before: 311203 floor 12, building 2, Purple Orange International Center, No. 39, Jincheng Road, Xiaoshan District, Hangzhou, Zhejiang Province

Applicant before: Hangzhou yunhezhi Network Technology Co.,Ltd.

Country or region before: China

CB02 Change of applicant information