java 由于未找到 Junit 测试报告,Jenkins 构建失败:实习框架
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/32573325/
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
Jenkins build fail due to Junit test report not found : Intern Framework
提问by 8785krs
My jenkins version is 1.608 and JUnit plugin is 1.2beta 4. When I run the test locally I can see that the reports are correctly generated but when I run the build it fails [also I dont see the reports in the folder].
The folder structure looks like workspace/java/src/proj/test/test1/*.xml.
Not sure what the problem is. This was fine until last week. The jenkins configurations also gives shows an error in the Publish Junit test report section ‘src\proj\test\test1\report.xml' doesn't match anything: ‘src' exists but not ‘src\proj\test\test1\report.xml'
我的 jenkins 版本是 1.608,JUnit 插件是 1.2beta 4。当我在本地运行测试时,我可以看到报告正确生成,但是当我运行构建时它失败了[我也没有在文件夹中看到报告]。文件夹结构看起来像workspace/java/src/proj/test/test1/*.xml.
不确定是什么问题。这很好,直到上周。jenkins 配置也给出了在 Publish Junit 测试报告部分显示错误‘src\proj\test\test1\report.xml' doesn't match anything: ‘src' exists but not ‘src\proj\test\test1\report.xml'
Error-
错误-
Build step 'Execute Windows batch command' marked build as failure
Recording test results
ERROR: Publisher hudson.tasks.junit.JUnitResultArchiver aborted due to exception
hudson.AbortException: No test report files were found. Configuration error?
at hudson.tasks.junit.JUnitParser$ParseResultCallable.invoke(JUnitParser.java:116)
at hudson.tasks.junit.JUnitParser$ParseResultCallable.invoke(JUnitParser.java:92)
at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2688)
at hudson.remoting.UserRequest.perform(UserRequest.java:121)
at hudson.remoting.UserRequest.perform(UserRequest.java:49)
at hudson.remoting.Request.run(Request.java:325)
at hudson.remoting.InterceptingExecutorService.call(InterceptingExecutorService.java:68)
at java.util.concurrent.FutureTask.run(FutureTask.java:274)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1157)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:627)
at hudson.remoting.Engine.run(Engine.java:69)
at java.lang.Thread.run(Thread.java:798)
at ......remote call to tm1w08perf11-5000(Native Method)
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1360)
at hudson.remoting.UserResponse.retrieve(UserRequest.java:221)
at hudson.remoting.Channel.call(Channel.java:753)
at hudson.FilePath.act(FilePath.java:978)
at hudson.FilePath.act(FilePath.java:967)
at hudson.tasks.junit.JUnitParser.parseResult(JUnitParser.java:89)
at hudson.tasks.junit.JUnitResultArchiver.parse(JUnitResultArchiver.java:121)
at hudson.tasks.junit.JUnitResultArchiver.perform(JUnitResultArchiver.java:138)
at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:74)
at hudson.tasks.BuildStepMonitor.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:761)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:721)
at hudson.model.Build$BuildExecution.post2(Build.java:183)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:670)
at hudson.model.Run.execute(Run.java:1766)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:374)
采纳答案by Seth
I'm not sure if it will help you but this worked fine for me when I encountered the same issue:
我不确定它是否会帮助你,但是当我遇到同样的问题时,这对我来说很好用:
No test report files were found in Hudson with NUnit
What you need to do to fix this: Place the *.xml-folder in the workspace-folder of Hudson and modify "Publish NUnit test result report" in a way that only the name of your *.xml-folder is given, not the absolute path.
你需要做些什么来解决这个问题:将 *.xml-folder 放在 Hudson 的工作区文件夹中,并以只给出 *.xml-folder 的名称的方式修改“发布 NUnit 测试结果报告”,而不是绝对路径。