我有一个在Jenkins中使用Maven连续构建的项目。当maven-failsafe-plugin:integration-test
阶段运行时,它表示有0个故障和0个错误。但是,当maven-failsafe-plugin:verify
运行时,它会显示“[ERROR]有测试失败。”即:
[INFO] --- maven-failsafe-plugin:2.12:integration-test (default) @ my-container ---
[INFO] Failsafe report directory: /tmp/workspace/.../my-container/target/failsafe-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.xxx.yyy.zzz.MyConfigIT
Apr 27, 2016 4:57:22 PM redis.clients.jedis.JedisSentinelPool initSentinels
INFO: Trying to find master from available Sentinels...
Apr 27, 2016 4:57:22 PM redis.clients.jedis.JedisSentinelPool initSentinels
INFO: Redis master running at 127.0.0.1:6379, starting Sentinel listeners...
Apr 27, 2016 4:57:22 PM redis.clients.jedis.JedisSentinelPool initPool
INFO: Created JedisPool to master at 127.0.0.1:6379
Results :
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0
[JENKINS] Recording test results
[INFO]
[INFO] --- maven-failsafe-plugin:2.12:verify (default) @ my-container ---
[INFO] Failsafe report directory: /tmp/workspace/.../my-container/target/failsafe-reports
[ERROR] There are test failures.
这是双重奇怪的,因为MyConfigIT
中实际上只有一个测试。为什么说它跑2?
此外,当我ls
报告目录时,失败测试的报告有0个字节:
+ ls -al /tmp/workspace/.../target/failsafe-reports
-rw-rw-r--. 1 xoom xoom 0 Apr 29 11:23 com.xxx.yyy.zzz.MyConfigIT.txt
有什么想法吗?