[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN112685323A - Method for realizing self-defined end-to-end test case compiling - Google Patents

Method for realizing self-defined end-to-end test case compiling Download PDF

Info

Publication number
CN112685323A
CN112685323A CN202110079387.4A CN202110079387A CN112685323A CN 112685323 A CN112685323 A CN 112685323A CN 202110079387 A CN202110079387 A CN 202110079387A CN 112685323 A CN112685323 A CN 112685323A
Authority
CN
China
Prior art keywords
test
plug
planning
sonobuoy
mirror image
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
CN202110079387.4A
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.)
Inspur Cloud Information Technology Co Ltd
Original Assignee
Inspur Cloud Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Inspur Cloud Information Technology Co Ltd filed Critical Inspur Cloud Information Technology Co Ltd
Priority to CN202110079387.4A priority Critical patent/CN112685323A/en
Publication of CN112685323A publication Critical patent/CN112685323A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

The invention provides a method for realizing self-defined end-to-end test case compiling, which belongs to the technical field of cloud computing and comprises the following steps: a) planning Gitlab to perform end-to-end test case version management; b) planning Sonobuoy to generate an end-to-end test plug-in; c) planning Sonobuoy to execute an end-to-end test; d) planning Golang packages to manage test cases of different components; e) planning Docker constructs an end-to-end test image. The working efficiency of the test engineer is improved, and the test engineer can better know the tested project and improve the technical level of the test engineer.

Description

Method for realizing self-defined end-to-end test case compiling
Technical Field
The invention relates to the technical field of cloud computing, in particular to a method for realizing self-defined end-to-end test case compiling.
Background
In recent years, cloud computing and various related technologies are vigorously developed, and the field of cloud computing is changing day by day. With the security, reliability and efficiency of cloud computing platforms in mind, more and more governments, enterprises and other various organizations choose to deploy their applications onto the cloud platforms. With the rapid development of cloud computing technology, verification and testing of cloud computing related software plays an increasingly important role in the reliability and safety of the software in the development and deployment processes of the cloud computing software. Because the cloud computing software is high in complexity and mostly has a distributed architecture, the testing difficulty is higher compared with other software. Especially, in the field of end-to-end testing in cloud computing, the method adopted by the traditional testing is still manual testing, the automation level is low, the time consumption is long, and the multiplexing cannot be realized.
The cloud computing platform is a distributed system and needs to work with other systems in various environments, and end-to-end testing plays an important role in such distributed systems. In this case, it needs to be checked in all aspects to ensure accurate interaction between different platforms and environments. The end-to-end test refers to that the application program and the dependent system are tested together during testing, and the smooth interaction between the front end and the back end of the program or between the upstream and the downstream is ensured, so that the closed loop is realized on the service, and the use requirements of customers are met.
Gitlab is an open source Git warehouse management software, and the version management of software projects can be realized by combining Git with the Gitlab.
Kubernets is an open source application for managing containers on multiple hosts in a cloud platform. Kubernets aims to make deploying containerized applications simple and efficient, and provides a mechanism for application deployment, planning, updating, and maintenance.
Docker is an open source application container engine that allows developers to package their applications and dependencies into a portable image and then distribute them to any popular Linux or Windows machine. The containers are completely sandboxed without any interface between them.
Sonobuoy is a kubernets cluster diagnostic tool. Sonobuoy can more easily understand the state of a kubernets cluster by running a series of configuration tests in an accessible and non-destructive manner.
The go test command is a program that tests code according to certain conventions and organizations. Within the package directory, all source files with a _ test. go suffix, when executing a go build, are not built into a part of the package, they are part of the go test. go test command will traverse all the functions meeting the naming rule in the _ test.
Disclosure of Invention
In order to solve the technical problems, the invention provides a method for realizing self-defined end-to-end test case compiling, which can simplify the operation of testers, realize the automation and the reuse of end-to-end test in a code mode, save the time and the labor cost and improve the working efficiency.
The technical scheme of the invention is as follows:
a method for realizing self-defined end-to-end test case compiling,
the method comprises the following steps:
a) planning Gitlab for end-to-end test case version management
b) Planning Sonobuoy to generate end-to-end test plug-in
c) Planning Sonobuoy to perform end-to-end testing
d) Planning Golang package to manage test cases of different components
e) Planning Docker constructs an end-to-end test image.
Further, in the above-mentioned case,
a) a user newly builds a folder corresponding to the test component under the project, then newly builds a star-go file under the folder, writes a test case in the star-go file, and submits a code to a gitlab warehouse after writing;
b) compiling the end-to-end test item by using go test to generate a binary file for testing;
c) using docker to make the binary file of the test generated in the last step into a mirror image, and packaging the required components;
d) and creating a Sonobuoy plug-in and running the mirror image created in the previous step. The end-to-end test case written by the tester is executed, and the execution result is output according to the corresponding format.
Further, in the above-mentioned case,
gitlab configuration
c) Creating a code repository as an item repository for end-to-end testing
d) End-to-end test cases are written according to test requirements, and codes are submitted to a mirror repository.
Docker configuration
d) Writing Dockerfile
e) Packaging binary test files, configuration files and corresponding components into a mirror image
f) Making mirror images and marking corresponding labels, and selecting whether to push the mirror images to a mirror image warehouse according to requirements
Sonobuoy configuration
a) Generating an add-in definition file by using a sonobuy gen plugin command;
b) running an end-to-end test by using a plug-in definition file and a docker mirror image;
c) and generating a test result and storing the test result to the local.
Further, in the above-mentioned case,
the end-to-end test item is written by using Go language; the functions of each folder and the files are as follows:
1) go.mod and go.sum files are files required for recording project dependent components;
2) e2e _ test.go and e2e.go are end-to-end test master files;
3) the api folder is used for storing the api of the component to be tested;
4) the components folder is used for placing test cases of different components;
5) the utils are used for storing tools required by executing the test cases;
6) and storing end-to-end test item dependencies under the vendor.
The function of the main functions of the test case template is as follows:
1) descripte: classifying one or more test cases to describe a behavior or a method;
2) context: adding conditional statements to cover various conditions as completely as possible;
3) it: the contained code is a test case.
The Sonobutoy commands function as follows:
1) the sonobuoy gen plugin is used for generating a yaml file for pulling up an end-to-end test plug-in;
-name is the plug-in name, -image is the mirror image of the executing plug-in;
2) the sonobuoy run is used to execute plug-ins for end-to-end testing; -p is the name of the plug-in
Image-pull-policy is a mirror pull policy.
The invention has the advantages that
The invention realizes a method for compiling the user-defined end-to-end test case on kubernets, and provides a whole set of solution for end-to-end test. The end-to-end test is changed from the prior manual test into the prior automatic test, the test multiplexing is realized, the working efficiency of a test engineer is improved, and the test engineer can better understand the tested project and improve the technical level of the test engineer.
Drawings
FIG. 1 is a schematic workflow diagram of the present invention;
fig. 2 is a schematic diagram of a file structure.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer and more complete, the technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention, and based on the embodiments of the present invention, all other embodiments obtained by a person of ordinary skill in the art without creative efforts belong to the scope of the present invention.
The invention provides an integrated solution of end-to-end test based on the sonobuoy and the golang test.
The workflow is shown in fig. 1. The flow of the user-defined end-to-end test case compiling method is as follows:
a) and a user newly builds a folder corresponding to the test component under the project, then newly builds a star-go file under the folder, writes a test case in the star-go file, and submits a code to a gitlab warehouse after writing. The file structure is shown in fig. 2.
b) Compiling end-to-end test items using go test to generate binary files for testing
c) Using docker to make the binary file of the test generated in the last step into a mirror image, and packaging the required components
d) And creating a Sonobuoy plug-in and running the mirror image created in the previous step. The end-to-end test case written by the tester is executed, and the execution result is output according to the corresponding format.
Gitlab configuration
e) Creating a code repository as an item repository for end-to-end testing
f) End-to-end test case is compiled according to test requirements, and codes are submitted to a mirror repository
(II) Docker configuration
g) Writing Dockerfile
h) Packaging binary test files, configuration files and corresponding components into a mirror image
i) Making mirror images and marking corresponding labels, and selecting whether to push the mirror images to a mirror image warehouse according to requirements
(III) Sonobuoy configuration
a) Generating plug-in definition file using the Sonobuoy gen plugin command
b) An end-to-end test is run using the plug-in definition file and the docker image.
c) And generating a test result and storing the test result to the local.
End-to-end test item structure
The end-to-end test project is written by using Go language, and the project structure is shown in fig. 2. The functions of each folder and the files are as follows:
the go.mod and go.sum files are files required to record project dependent components.
2, e2e _ test.go and e2e.go are end-to-end test master files
The api folder is used for storing the api of the component to be tested
The components folder is used for placing test cases of different components.
Utils for storing tools required for executing test cases
End-to-end test item dependency for storage under vendor
End-to-end test case template sample
Figure BDA0002908683910000071
As shown above for the test case template, the main functions function as follows:
descripte: classifying one or more test cases to describe a behavior or a method
Context: adding conditional statements to cover various conditions as completely as possible
And 3, It: the code contained is a test case
Sonobuoy production and startup plug-in example
Figure BDA0002908683910000072
The Sonobutoy commands function as follows:
sonobuoy gen plugin is used to generate the yaml file that pulls up the end-to-end test plug-in. - -name
Is the plug-in name, image is the mirror image of the executing plug-in.
Sonobuoy run was used to execute the plug-ins for end-to-end testing. -p is the name of the plug-in
Image-pull-policy is a mirror pull policy.
The above description is only a preferred embodiment of the present invention, and is only used to illustrate the technical solutions of the present invention, and not to limit the protection scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (8)

1. A method for realizing self-defined end-to-end test case compiling is characterized in that,
the method comprises the following steps:
a) planning Gitlab for end-to-end test case version management
b) Planning Sonobuoy to generate end-to-end test plug-in
c) Planning Sonobuoy to perform end-to-end testing
d) Planning Golang package to manage test cases of different components
e) Planning Docker constructs an end-to-end test image.
2. The method of claim 1,
a) a user newly builds a folder corresponding to the test component under the project, then newly builds a star-go file under the folder, writes a test case in the star-go file, and submits a code to a gitlab warehouse after writing;
b) compiling the end-to-end test item by using go test to generate a binary file for testing;
c) using docker to make the binary file of the test generated in the last step into a mirror image, and packaging the required components;
d) and creating a Sonobuoy plug-in and running the mirror image created in the previous step. The end-to-end test case written by the tester is executed, and the execution result is output according to the corresponding format.
3. The method of claim 2,
gitlab configuration
a) Creating a code repository as an item repository for end-to-end testing
b) End-to-end test cases are written according to test requirements, and codes are submitted to a mirror repository.
4. The method of claim 2,
docker configuration
a) Writing Dockerfile
b) Packaging binary test files, configuration files and corresponding components into a mirror image
c) And (4) making a mirror image and marking a corresponding label, and selecting whether to push the mirror image to a mirror image warehouse or not according to needs.
5. The method of claim 2,
sonobuoy configuration
a) Generating an add-in definition file by using a sonobuy gen plugin command;
b) running an end-to-end test by using a plug-in definition file and a docker mirror image;
c) and generating a test result and storing the test result to the local.
6. The method of claim 2,
the end-to-end test item is written by using Go language; the functions of each folder and the files are as follows:
1) go.mod and go.sum files are files required for recording project dependent components;
2) e2e _ test.go and e2e.go are end-to-end test master files;
3) the api folder is used for storing the api of the component to be tested;
4) the components folder is used for placing test cases of different components;
5) the utils are used for storing tools required by executing the test cases;
6) and storing end-to-end test item dependencies under the vendor.
7. The method of claim 6,
the function of the main functions of the test case template is as follows:
1) descripte: classifying one or more test cases to describe a behavior or a method;
2) context: adding conditional statements to cover various conditions as completely as possible;
3) it: the contained code is a test case.
8. The method of claim 5,
the Sonobutoy commands function as follows:
1) the sonobuoy gen plugin is used for generating a yaml file for pulling up an end-to-end test plug-in; -name is the plug-in name, -image is the mirror image of the executing plug-in;
2) the sonobuoy run is used to execute plug-ins for end-to-end testing; p is the plug-in name-image-pull-policy is the mirror pull policy.
CN202110079387.4A 2021-01-21 2021-01-21 Method for realizing self-defined end-to-end test case compiling Pending CN112685323A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110079387.4A CN112685323A (en) 2021-01-21 2021-01-21 Method for realizing self-defined end-to-end test case compiling

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110079387.4A CN112685323A (en) 2021-01-21 2021-01-21 Method for realizing self-defined end-to-end test case compiling

Publications (1)

Publication Number Publication Date
CN112685323A true CN112685323A (en) 2021-04-20

Family

ID=75458823

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110079387.4A Pending CN112685323A (en) 2021-01-21 2021-01-21 Method for realizing self-defined end-to-end test case compiling

Country Status (1)

Country Link
CN (1) CN112685323A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117539791A (en) * 2023-12-09 2024-02-09 广州翼辉信息技术有限公司 Automatic test system of embedded software

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090307763A1 (en) * 2008-06-05 2009-12-10 Fiberlink Communications Corporation Automated Test Management System and Method
US20180089066A1 (en) * 2016-09-23 2018-03-29 American Express Travel Related Services Company, Inc. Software testing management
CN108874650A (en) * 2017-05-09 2018-11-23 上海秦苍信息科技有限公司 A kind of continuous integrating automated testing method
CN111273960A (en) * 2020-01-20 2020-06-12 山东汇贸电子口岸有限公司 Method for realizing cloud native MIPS architecture container cloud
CN111679965A (en) * 2020-04-23 2020-09-18 平安国际智慧城市科技股份有限公司 Automatic testing method and device, computer equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090307763A1 (en) * 2008-06-05 2009-12-10 Fiberlink Communications Corporation Automated Test Management System and Method
US20180089066A1 (en) * 2016-09-23 2018-03-29 American Express Travel Related Services Company, Inc. Software testing management
CN108874650A (en) * 2017-05-09 2018-11-23 上海秦苍信息科技有限公司 A kind of continuous integrating automated testing method
CN111273960A (en) * 2020-01-20 2020-06-12 山东汇贸电子口岸有限公司 Method for realizing cloud native MIPS architecture container cloud
CN111679965A (en) * 2020-04-23 2020-09-18 平安国际智慧城市科技股份有限公司 Automatic testing method and device, computer equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
CORMAC: ""validating kubernets cluster conformance with sonobuoy"", 《HTTPS://CORMACHOGAN.COM/2019/07/24/VALIDATING-KUBERNETS-CLUSTER-CONFORMANCE-WITH-SONOBUOY/》, 25 July 2019 (2019-07-25), pages 1 - 16 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117539791A (en) * 2023-12-09 2024-02-09 广州翼辉信息技术有限公司 Automatic test system of embedded software
CN117539791B (en) * 2023-12-09 2024-04-30 广州翼辉信息技术有限公司 Automatic test system of embedded software

Similar Documents

Publication Publication Date Title
Warren The renaissance of legacy systems: method support for software-system evolution
US8949772B1 (en) Dynamic model based software application development
US8706771B2 (en) Systems and methods for analyzing and transforming an application from a source installation to a target installation
US7694272B2 (en) Method, a language and a system for the definition and implementation of software solutions by using a visualizable computer executable modeling language
US8589864B2 (en) Automating the creation of an application provisioning model
CN103744647B (en) A kind of Java workflow development system and method based on workflow visualization toolkit
US8832125B2 (en) Extensible event-driven log analysis framework
CN112435072A (en) Model creating method and device, electronic equipment and storage medium
CN111881056A (en) Automatic test framework and test method
CN112685323A (en) Method for realizing self-defined end-to-end test case compiling
Salam et al. Advanced Framework for Automated Testing of Mobile Applications
JP2011515755A (en) Development method and apparatus for reserved component container base software
US20130111431A1 (en) Validation of a system model including an activity diagram
Koop et al. The provenance of workflow upgrades
CN114356430B (en) DAG dependent configuration tool based on airflow scheduling system
US20220413843A1 (en) Combining model-driven applications and canvas-type applications with application lifecycle management
Vagliano et al. Tool integration in the aerospace domain: A case study
Brandão et al. Towards aspects identification in business process through process mining
US11775293B1 (en) Deploying a static code analyzer based on program synthesis from input-output examples
Barrios et al. PLM Migration in the era of big data and IoT: Analysis of information system and data topology
Carrozza et al. Integrating mdt in an industrial process in the air traffic control domain
CN118378719B (en) Machine learning workflow construction method
Zanon The SimTG simulation modeling framework a domain specific language for space simulation
Wölfl Data management in certified avionics systems
Nagar et al. MetaPSS: An Automation Framework for Generation of Portable Stimulus Model

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