jmeter + ant + git + jenkins do automation interfaces

 

First, the paper describes ant + jmeter + jenkins + git interfaces using automated testing framework   

 

Second, here briefly under use jmeter a (very brief)

 

1, the new test plan ----> select the thread group

 

 

 

 

 

2, right thread group selected CSV Data Set Config

 

 

 

 

 

 

 

 

3, filename enter the login interface file path, encoding using GB2312, otherwise the situation will be garbled when adjusting Interface

Variable Names variable name for the csv file, csv there are several columns, here to write the names of several variables

 

 

 

 

                    Figure I

 

 

 

 

 

                   Figure II

 

4, right thread group add http request

 

 

 

 

5, jmeter} by $ {indication variable names used herein $ {caseName} indication csv in EXAMPLE name

 

 

 

 

 

6, because the back of the interface need to use token, so the token extractor to extract a regular expression when you log

 

 

 

 

 

7, token after the acquisition, the token into a global variable

 

 

 

 

 

8, the global variable declaration after the token added to the interface information needed to use the head manager

 

 

 

 

9, csv file There are several use cases, the thread group will cycle times

 

 

 

 

10, add after the tree view click on operating results, you can see all the use cases csv file are executed

 

 

 

 

Three, Jenkins created project

 

1, New

 

 

 

 

2. Enter a project name, select free-style software project

 

 

 

3. Construction Construction of trigger selection timing, where write 08 * * * 8:00 every morning regular implementation

 

 

 

 

4, select ANT build environment

 

 

 

 

5, built using xml build

 

 

 

 

6, after the build operation to send mail

 

 

 

 

7, source code management options Git, git address input

 

 

 

 

8, jenkins building did not and associated use cases, jenkins does not know the success or failure of the implementation of the use case, if it is not operating, it will test the use case have failed, but jenkins build status remains to be successful, so you can not play a monitoring effect, lost the meaning of the interface automated testing, so there was the following passage shell script.

The following main use shell scripts that have not failed to determine the use cases, use case fails jenkins build state also fails, use cases successfully, jenkins build state also successful.

 

 

 

 

Four, Git configuration

 

1, Git where linux performed keygen -t-RSA -C SSH "[email protected]"

 

 

 

 

2, into the /root/.ssh directory using the read command cat id_rsa.pub content (as follows) arranged to GitHub

 

 

 

 

3, log on GitHub, locate and open the "settings" in the personal account there, enter "SSH and GPG keys":

 

 

 

 

 

 

 

 

 

 

 

 

 

 

4. Once configured, executed on the server git clone, verify that the configuration is successful, the next chart appears the word configuration is successful

 

 

 

 

5, the private key is added to Jenkins, select private key, enter the username, the private key, the private key as follows:

 

 

 

 

 

 

 

 

 

 

 

 

6. Once configured, just select the source configuration management user name

 

 

 

 

7, after the above-configured, ready to use, immediately choose to build, build displays after completing a specific building details

 

 

 

 

 

 

 

 

 

8, whether to build build succeeded or failed send email Upon completion, the success or failure to timely know

 

 

 

9, see the report which details can locate specific use cases of failure, combined with the contents of the request and the response time to find out the cause of the failure of the use case

 

 

 

 

10, see the interface response time, response time can be seen that each interface specifically how much, whether the need to optimize

 

 

 

Guess you like

Origin www.cnblogs.com/yanpan/p/11496095.html