Jenkins 失败:已找到测试报告,但其中 none 是新的。测试运行了吗?

Jenkins failed: Test reports were found but none of them are new. Did tests run?

我正在使用手动 jUnit Xml 文件测试 Jenkins jUnit 插件。我从控制台输出中得到以下信息

failed: Test reports were found but none of them are new. Did tests run?

我搜索了这个问题的解决方案,但 none 解决了我的困惑。我尝试 运行 一个 shell 脚本。因为我对此很陌生(可能有很多错误)。这是我的 shell 脚本的一部分。

cd /Users/Shared/Jenkins/Home/jobs/jUnitReport
sudo visudo
Jenkins ALL = NOPASSWD: /bin/sh -xe /Users/Shared/Jenkins/tmp/hudson7751940722564747051.sh
touch jUnit.xml

我真的不知道如何访问 Jenkins 来访问文件。("failed: Test reports were found but none of them are new. Did tests run?" 的解决方案之一)。

<?xml version="1.0" encoding="UTF-8"?>
  <testsuites>
  <testsuite name="PerformanceTest" errors="0" skipped="0" tests="2" failures="1" time="10.74" timestamp="2016-05-24T10:23:58">
  <testcase classname="PerformanceTest" name="testSmoothness" time="15" jank-percentage="75">
     <failure message="Too many jank frames." />
  </testcase>
  <testcase classname="PerformanceTest" name="testResponseTime" time="1.3" response-time="0.3">
  </testcase>
 </testsuite>
</testsuites>

如有任何帮助,我们将不胜感激。 谢谢!

(从我的评论中复制)

Source。有一个时间戳检查,但看起来它适用于文件时间戳(最后修改)并使用 3000(大概是毫秒)的抖动。 JUnit 插件忽略比当前构建的构建时间减去 3 秒早的测试 XML 输出。如果测试 运行 和 JUnit 插件 运行 相隔超过 3 秒,插件将忽略这些文件。