1.Jekins全局工具配置
系统管理->全剧共举配置
(1)JDK配置
(2)Ant配置
2.Jekins新建任务
(2)配置构建->Invoker Ant
配置完成后点击保存。
3.开始测试
(1)立即构建
(2)构建成功查看控制台日志
Started by user ***
Running as SYSTEM
[EnvInject] - Loading node environment variables.
Building in workspace C:\Program Files (x86)\Jenkins\workspace\LyhTest
No emails were triggered.
[TestScript] $ cmd.exe /C "F:\apache-ant-1.10.5\bin\ant.bat -file build.xml && exit %%ERRORLEVEL%%"
Buildfile: F:\apache-jmeter-3.1\TestScript\build.xml
[echo] F:\apache-jmeter-3.1\TestReport\test\jtl\TestReport201906261052.jtl
[echo] F:\apache-jmeter-3.1\TestReport\test\html\index.html
run:
[echo] F:\apache-jmeter-3.1\TestReport\test\jtl\TestReport201906261052.jtl
[echo] F:\apache-jmeter-3.1\TestReport\test\html\index.html
test:
[jmeter] Executing test plan: F:\apache-jmeter-3.1\TestScript\test.jmx ==> F:\apache-jmeter-3.1\TestReport\test\jtl\TestReport201906261052.jtl
[jmeter] Writing log file to: F:\apache-jmeter-3.1\bin\jmeter.log
[jmeter] Creating summariser <summary>
[jmeter] Created the tree successfully using F:\apache-jmeter-3.1\TestScript\test.jmx
[jmeter] Starting the test @ Wed Jun 26 10:52:49 CST 2019 (1561517569711)
[jmeter] Waiting for possible Shutdown/StopTestNow/Heapdump message on port 4445
[jmeter] summary = 10 in 00:00:00 = 20.5/s Avg: 34 Min: 10 Max: 192 Err: 0 (0.00%)
[jmeter] Tidying up ... @ Wed Jun 26 10:52:50 CST 2019 (1561517570303)
[jmeter] ... end of run
[echo] F:\apache-jmeter-3.1\TestReport\test\jtl\TestReport201906261052.jtl
[echo] F:\apache-jmeter-3.1\TestReport\test\html\index.html
report:
[xslt] Processing F:\apache-jmeter-3.1\TestReport\test\jtl\TestReport201906261052.jtl to F:\apache-jmeter-3.1\TestReport\test\html\index.html
[xslt] Loading stylesheet F:\apache-jmeter-3.1\extras\jmeter-results-detail-report_21.xsl
BUILD SUCCESSFUL
Total time: 12 seconds
[htmlpublisher] Archiving HTML reports...
[htmlpublisher] Archiving at PROJECT level F:\apache-jmeter-3.1\TestReport\test\html to C:\Program Files (x86)\Jenkins\jobs\LyhTest\htmlreports\HTML_20Report
Email was triggered for: Always
Sending email for trigger: Always
Sending email to: 18611628487@163.com
Error sending to the following VALID addresses: 18611628487@163.com
Finished: SUCCESS
可以在Jekins中实现报告的显示和邮件发送等,后续再进行分享。