Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Building Jenkins+Jmeter+Ant automatic Test Environment under Windows

2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

1.JDK\ Jmeter\ Ant installation: 1.1. Install JDK:

Double-click the jdk-7u80-windows-x64.exe installation and install it to the C:\ ProgramFiles\ Java directory by default

1.2. Install Jmeter:

On my computer-E disk (it is recommended to be consistent with the documentation, otherwise you need to modify the configuration file), create a new apache folder, and then extract the apache-jmeter-3.0.rar to the current directory.

1.3. Install Ant:

Copy apache-Ant-1.9.7.rar to the E:\ apache directory and extract it to the current directory

two。 Environment variable configuration: 2.1. Configure the Java environment variable:

Turn on my computer-- properties-- advanced-- environment variables:

Create new system variables JAVA_HOME and CLASSPATH:

Variable name: JAVA_HOME variable value: C:\ ProgramFiles\ Java\ jdk1.7.0

Variable name: CLASSPATH variable value:.;% JAVA_HOME%\ lib\ dt.jar;%JAVA_HOME%\ lib\ tools.jar

Select the environment variable named "Path" in the "system variable", double-click the variable, add the absolute path of the bin directory in the JDK installation path to the value of the Path variable, and separate the semicolon of the half corner from the existing path.

Variable name: Path variable value:% JAVA_HOME%\ bin;%JAVA_HOME%\ jre\ bin

Test whether the configuration of environment variables is successful: enter "JAVAC" in the DOS command line window and output help information as the configuration is correct.

2.2. Configure the Jmeter environment variable:

Create a new system variable:

Variable name: JMETER_HOME, variable value: e:\ apache\ apache-jmeter-3.0

Add% JMETER_HOME%\ bin;%JMETER_HOME%\ lib\ ext\ ApacheJMeter_core.jar;%JMETER_HOME%\ lib\ jorphan.jar;%JMETER_HOME%\ lib\ logkit-2.0.jar; to the system variable PATH to verify that cmd is configured to run successfully enter jmeter-v (with a space between jmeter and-v)

2.3. Configure Ant environment variables

Create a new system variable: ANT_HOME:E:\ apache\ apache-Ant-1.9.7, which is your ANT installation path

Add the following at the end of the environment variable PATH:;% ANT_HOME%\ bin pay attention to the semicolon before it. If there is no semicolon at the end of the PATH, you can add it and remove it if there is any.

2.4. Local debugging uses Ant to build and run Jmeter

Jmeter saves a file in .csv format by default, so we should first set the contents of the bin/jmeter.properties file, modify the jmeter.properties file jmeter.save.saveservice.output_format=xml;, remove the comments (#), and change csv to xml.

Create a new workspace folder under the apache directory, then create a new wms_test folder under the workspace folder, then create 3 new jmx,report,res folders under the wms_test folder, and finally create a new html,jtl folder under the report folder

Copy build.xml to the wms_test folder (if the actual configuration directory is not consistent with the documentation, modify build.xml), and copy the interface test file written in jmeter. JMX to the jmx folder.

Under the wms_test folder, go to the command prompt window, enter Ant, view the running interface, and prompt success to indicate that the Ant build and run Jmeter operation was successful.

3. Installation and configuration of Jenkins: 3.1. Jenkins installation:

Double-click the jenkins.msi file to install, and after installation, type localhost:8080 in the browser to view the Jenkins page.

3.2. Jenkins plug-in installation:

Automatic installation: after logging in to jenkins, click system Management-plug-ins Management to enter the plug-ins page, and then click "optional plug-ins". In the upper right corner, you can filter a plug-in you want, and you can install and update the plug-ins.

Manual installation: click system Management-plug-in Management: advanced, click "Select File" to find the previously downloaded installation package with the .hpi suffix name, select the installation package, then click "upload", and then wait for it to be installed.

3.3. Jenkins configuration: 3.3.1.Jenkins global settin

After logging in to jenkins, click system Administration-system Settings

Configure Jenkins Location

Configuration item

Value

Jenkins URL

Http://IP:8080/

System administrator email address

Test@yuncang.com

Configure Extended E-mail Notification

Configuration item

Value

SMTP server

Smtp.exmail.qq.com (corporate mailbox used by the company)

Default user E-mail suffix

@ yuncang.com

Use SMTP Authentication

User Name

Test@yuncang.com

Password

Test123456

Use SSL

SMTP port

four hundred and sixty five

Charset

UTF-8

Default Content Type

HTML (text/html)

Default Recipients

XXX@yuncang.com (fill in the address of the recipient of the email, used by multiple addresses; separated)

Default Subject

Build Notification: ${PROJECT_NAME}-${BUILD_STATUS}-Build # ${BUILD_NUMBER}!

Default Content

Customize the content of the message

Configure Mail Notification

Configuration item

Value

SMTP server

Smtp.exmail.qq.com

User default mail suffix

@ yuncang.com

Use SMTP authentication

User name

Test@yuncang.com

Password

Test123456

Use the SSL protocol

SMTP port

four hundred and sixty five

Reply-To Address

Test@yuncang.com

Character set

UTF-8

Test the configuration by sending a test email

Zhouwen@nryuncang.com (enter the address of the recipient of the test message)

After the configuration is complete, click Test configuration to see if the test email is successful enough.

3.3.2.GlobalTool Configuration

After logging in to jenkins, click system Management-Global Tool Configuration:

Configure JDK environment: click "JDK installation" to configure JDK name and directory

Configure Ant environment: click "Ant installation" to configure Ant name and directory

3.3.3. Project configuration

After logging in to jenkins, click system Management-plug-in Management: enter the project name "wms_test", select "build a free-style software project" and click OK to save.

After the project is completed, configure the project: after logging in to jenkins, click on the new project-- configure: configure.

Configuration item

Value

General

Discard old builds

Maintain the number of days to build

one hundred

Maintain the maximum number of builds

ten

Source code management

Build trigger

Build the environment

Construction

Invoke Ant

Ant Version

Apache-ant-1.9.7

Build File

E:\ apache\ workspace\ wms_test\ build.xml

Manipulate Publish HTML reports after building

HTML directory to archive

E:\ apache\ workspace\ wms_test\ report\ html

Index page [s]

TestReport.html

Report title

HTML Report

Keep past HTML report

Always link to last build

Manipulate E-mail Notification after building

Recipients

Test@yuncang.com

Email notifications are sent every time an unstable build is made

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report