我用 jenkins+jmeter+maven 搭建接口测试环境,测试脚本在 maven 项目里,jmx 文件。
maven 项目路径:/usr/jsx/apitest
测试脚本上传路径:/usr/jsx/apitest/src/test/jmeter
旧脚本:查询书籍.jmx
新脚本:查询书籍 1.jmx , 查询书籍 2.jmx,即旧脚本重命名为查询书籍 1,再上传查询书籍 2
等 jenkins 构建后发现以上 3 个脚本都参与测试并生成测试报告,请哪位可以帮忙分析?

jenkins 控制台日志:

由用户 jsx 启动
构建中 在工作空间 /var/lib/jenkins/workspace/接口测试_maven 中
Updating http://svn.91sph.com/svn/sph/server-service at revision '2018-08-15T17:26:39.567 +0800' --quiet
Using sole credentials build/****** in realm ‘http://svn.91sph.com:80 VisualSVN Server’
At revision 21852

Using sole credentials build/****** in realm ‘http://svn.91sph.com:80 VisualSVN Server’
No emails were triggered.
[接口测试_maven] $ /bin/sh -xe /tmp/jenkins3620995785132239360.sh


T E S T S

Running jsx.apitest.AppTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 sec

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[JENKINS] Recording test results
[WARNING] Attempt to (de-) serialize anonymous class hudson.maven.reporters.SurefireArchiver$2; see: https://jenkins.io/redirect/serialization-of-anonymous-classes/
[WARNING] Attempt to (de-) serialize anonymous class hudson.maven.reporters.BuildInfoRecorder$1; see: https://jenkins.io/redirect/serialization-of-anonymous-classes/
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ apitest ---
[INFO]
[INFO] >>> jmeter-maven-plugin:2.1.0:jmeter (jmeter-tests) > :configure @ apitest >>>
[INFO]
[INFO] --- jmeter-maven-plugin:2.1.0:configure (configure) @ apitest ---
[INFO] -------------------------------------------------------
[INFO] Configuring JMeter...
[INFO] -------------------------------------------------------
[INFO]
[INFO] <<< jmeter-maven-plugin:2.1.0:jmeter (jmeter-tests) < :configure @ apitest <<<
[INFO]
[INFO]
[INFO] --- jmeter-maven-plugin:2.1.0:jmeter (jmeter-tests) @ apitest ---
[INFO]

[INFO] -------------------------------------------------------
[INFO] P E R F O R M A N C E T E S T S
[INFO] -------------------------------------------------------
[INFO] Invalid value detected for . Setting pause to 0...
[INFO]

[INFO]

[INFO] Executing test: 查询书籍.jmx
[INFO] Writing log file to: /usr/jsx/apitest/target/jmeter/logs/查询书籍.jmx.log
[INFO] Creating summariser


[INFO] Created the tree successfully using /usr/jsx/apitest/target/jmeter/testFiles/查询书籍.jmx
[INFO] Starting the test @ Wed Aug 15 17:28:18 CST 2018 (1534325298704)
[INFO] Waiting for possible Shutdown/StopTestNow/Heapdump message on port 4445
[INFO] summary = 3 in 00:00:01 = 2.3/s Avg: 384 Min: 31 Max: 612 Err: 2 (66.67%)
[INFO] Tidying up ... @ Wed Aug 15 17:28:20 CST 2018 (1534325300077)
[INFO] ... end of run
[INFO] Completed Test: 查询书籍.jmx
[INFO]

[INFO] Executing test: 查询书籍 1.jmx
[INFO] Writing log file to: /usr/jsx/apitest/target/jmeter/logs/查询书籍 1.jmx.log
[INFO] Creating summariser
[INFO] Created the tree successfully using /usr/jsx/apitest/target/jmeter/testFiles/查询书籍 1.jmx
[INFO] Starting the test @ Wed Aug 15 17:28:20 CST 2018 (1534325300924)
[INFO] Waiting for possible Shutdown/StopTestNow/Heapdump message on port 4445
[INFO] summary = 3 in 00:00:01 = 4.0/s Avg: 207 Min: 31 Max: 554 Err: 2 (66.67%)
[INFO] Tidying up ... @ Wed Aug 15 17:28:21 CST 2018 (1534325301757)
[INFO] ... end of run
[INFO] Completed Test: 查询书籍 1.jmx
[INFO]

[INFO] Executing test: 查询书籍 2.jmx
[INFO] Writing log file to: /usr/jsx/apitest/target/jmeter/logs/查询书籍 2.jmx.log
[INFO] Creating summariser
[INFO] Created the tree successfully using /usr/jsx/apitest/target/jmeter/testFiles/查询书籍 2.jmx
[INFO] Starting the test @ Wed Aug 15 17:28:22 CST 2018 (1534325302625)
[INFO] Waiting for possible Shutdown/StopTestNow/Heapdump message on port 4445
[INFO] summary = 3 in 00:00:01 = 3.8/s Avg: 219 Min: 32 Max: 571 Err: 2 (66.67%)
[INFO] Tidying up ... @ Wed Aug 15 17:28:23 CST 2018 (1534325303513)
[INFO] ... end of run
[INFO] Completed Test: 查询书籍 2.jmx
[INFO]
[INFO] --- xml-maven-plugin:1.0-beta-3:transform (default) @ apitest ---
Warning: Running an XSLT 1.0 stylesheet with an XSLT 2.0 processor
[INFO] Transforming file: /usr/jsx/apitest/target/jmeter/results/20180815-查询书籍 2.jtl
[INFO] Transforming file: /usr/jsx/apitest/target/jmeter/results/20180815-查询书籍.jtl
[INFO] Transforming file: /usr/jsx/apitest/target/jmeter/results/20180815-查询书籍 1.jtl
[INFO] Transformed 3 file(s).
Warning: Running an XSLT 1.0 stylesheet with an XSLT 2.0 processor
[INFO] Transforming file: /usr/jsx/apitest/target/jmeter/results/20180815-查询书籍 2.jtl
[INFO] Transforming file: /usr/jsx/apitest/target/jmeter/results/20180815-查询书籍.jtl
[INFO] Transforming file: /usr/jsx/apitest/target/jmeter/results/20180815-查询书籍 1.jtl
[INFO] Transformed 3 file(s).
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ apitest ---
[INFO] Installing /usr/jsx/apitest/target/apitest-0.0.1-SNAPSHOT.jar to /var/lib/jenkins/.m2/repository/jsx/apitest/0.0.1-SNAPSHOT/apitest-0.0.1-SNAPSHOT.jar
[INFO] Installing /usr/jsx/apitest/pom.xml to /var/lib/jenkins/.m2/repository/jsx/apitest/0.0.1-SNAPSHOT/apitest-0.0.1-SNAPSHOT.pom
[WARNING] Attempt to (de-) serialize anonymous class hudson.maven.reporters.MavenArtifactArchiver$2; see: https://jenkins.io/redirect/serialization-of-anonymous-classes/
[WARNING] Attempt to (de-) serialize anonymous class hudson.maven.reporters.MavenFingerprinter$1; see: https://jenkins.io/redirect/serialization-of-anonymous-classes/
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.654 s
[INFO] Finished at: 2018-08-15T17:28:25+08:00
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[JENKINS] Archiving /usr/jsx/apitest/pom.xml to jsx/apitest/0.0.1-SNAPSHOT/apitest-0.0.1-SNAPSHOT.pom
[JENKINS] Archiving /usr/jsx/apitest/target/apitest-0.0.1-SNAPSHOT.jar to jsx/apitest/0.0.1-SNAPSHOT/apitest-0.0.1-SNAPSHOT.jar
/usr/jsx/apitest/pom.xml is not inside /var/lib/jenkins/workspace/接口测试_maven/usr/jsx/apitest/; will archive in a separate pass
/usr/jsx/apitest/target/apitest-0.0.1-SNAPSHOT.jar is not inside /var/lib/jenkins/workspace/接口测试_maven/usr/jsx/apitest/; will archive in a separate pass
channel stopped
[INFO] Shutdown detected, destroying JMeter process...
[INFO] Shutdown detected, destroying JMeter process...
[INFO] Shutdown detected, destroying JMeter process...
[htmlpublisher] Archiving HTML reports...
[htmlpublisher] Archiving at PROJECT level /usr/jsx/apitest/target/jmeter/html to /var/lib/jenkins/jobs/接口测试_maven/htmlreports/_e7bb9f_e8aea1_e68aa5_e5918a1
[htmlpublisher] Archiving at PROJECT level /usr/jsx/apitest/target/jmeter/html1 to /var/lib/jenkins/jobs/接口测试_maven/htmlreports/_e8afa6_e7bb86_e68aa5_e5918a1
[htmlpublisher] Archiving at PROJECT level /usr/jsx/apitest/target/jmeter/html to /var/lib/jenkins/jobs/接口测试_maven/htmlreports/_e7bb9f_e8aea1_e68aa5_e5918a2
[htmlpublisher] Archiving at PROJECT level /usr/jsx/apitest/target/jmeter/html1 to /var/lib/jenkins/jobs/接口测试_maven/htmlreports/_e8afa6_e7bb86_e68aa5_e5918a2
Email was triggered for: Success
Sending email for trigger: Success
Sending email to: jinshengxun@91sph.com
Finished: SUCCESS


↙↙↙阅读原文可查看相关链接,并与作者交流