bash Jenkins 失败:找到了测试报告,但没有一个是新的。测试运行了吗?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/38780778/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 14:59:25  来源:igfitidea点击:

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

linuxbashjenkinsjunitreport

提问by wadestrikers

I'm testing the Jenkins jUnit plugin with a manual jUnit Xml file. And I get following info from console output

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

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

失败:找到了测试报告,但没有一个是新的。测试运行了吗?

I've searched the solution for this problem but none of them solve my confuse. I try to run a shell script. Since I'm pretty new to this(might have a lot of errors). Here is a piece of my shell script.

我已经搜索了这个问题的解决方案,但没有一个能解决我的困惑。我尝试运行一个 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

I don't really know how to access Jenkins to touch the file.(one of the solution to "failed: Test reports were found but none of them are new. Did tests run?").

我真的不知道如何访问 Jenkins 来触摸文件。(“失败的解决方案之一:找到了测试报告,但没有一个是新的。测试运行了吗?”)。

<?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>

Any help will be appreciated. Thank You!

任何帮助将不胜感激。谢谢你!

回答by Stefan Hanke

(copied from my comment)

(复制自我的评论)

Source. There is a timestamp check but looks like it works on file timestamps (last modified) and uses a jitter of 3000 (presumably milliseconds). The JUnit plugin is ignoring test XML output that is older than the buildtime of the current build minus 3 seconds. If the test run and the JUnit plugin run are more than 3 seconds apart, the plugin will ignore the files.

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