在Linux下部署Jmeter:
在Jenkins下创建任务:
General
======
丢弃旧的构建
策略: Log Rotation
保持构建的天数:1
保持构建的最大个数:5
构建触发器
=======
定时构建
日程表:0 7 * * *
构建
===
执行Windows 批处理命令
命令:del "F:ToolsJenkinsworkspacejtl"TestReport$.jtl
Invoke Ant
Ant Version: Default
Targets: run
构建后操作
=======
Publish HTML reports
Reports
HTML directory to archive: F:ToolsJenkinsworkspacehtml
Index page[s]: *.html
Index page title[s](Optional)
Report title: HTML Report
Publish Performance test result report
Source data files(autodetects format): F:ToolsJenkinsworkspacejtl*.jtl
Performance display: Performance Per Test Case Mode 打钩
Show Throught Chart
Exclude response time of errored samples
Fail build when result files are not present 打钩
Select graphed metric: Average Response Time
Select evaluation mode: Standard Mode
Editable Email Notification
Project Recipient List:
多个邮件接收者用逗号隔开
Project Reply-To List: $DEFAULT_REPLYTO
Content Type: HTML (text/html)
Default Subject: 接口自动化测试邮件
Default Content:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>${ENV, var="JOB_NAME"}-第${BUILD_NUMBER}次构建日志</title>
</head>
<body leftmargin="8" marginwidth="0" topmargin="8" marginheight="4"
offset="0">
<div>
<table width="95%" cellpadding="0" cellspacing="0"
style="font-size: 11pt; font-family: Tahoma, Arial, Helvetica, sans-serif">
<tr>
<th align="center" colspan="2"><br />
<h2>构建信息</h2>
</th>
</tr>
<tr>
<td>
<ul>
<li>项目名称 : ${PROJECT_NAME}</li><br />
<li>详细测试报告 : <a href="${PROJECT_URL}HTML_Report">${PROJECT_URL}HTML_Report</a></li><br />
<li>触发原因: ${CAUSE}</li><br />
<li>项目 Url : <a href="${PROJECT_URL}">${PROJECT_URL}</a></li><br />
</ul>
</td>
<td>${JELLY_SCRIPT,template="html"}<br/>
</tr>
<tr>
<td colspan="2" align="center"><br />
<!--h2>HTML_Report</h2-->
</td>
</tr>
<tr>
<td colspan="2" align="center">
<div>${FILE ,path="F:/Tools/Jenkins/workspace/html/TestReport.html"}</div>
</td>
</tr>
</table>
</div>
</body>
</html>