Tou*_*uko 63 java cobertura playframework jenkins playframework-1.x
我们有一个Play 1.2.4应用程序,我们得到了Jenkins(在Ubuntu上)的应用程序.我们遇到了Cobertura的问题.
运行测试(成功)后,我们偶尔会收到以下错误:
---------------------------------------
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at net.sourceforge.cobertura.util.FileLocker.lock(FileLocker.java:124)
at play.modules.cobertura.CoberturaPlugin$CoberturaPluginShutdownThread.run(Unknown Source)
Caused by: java.nio.channels.OverlappingFileLockException
at sun.nio.ch.FileChannelImpl$SharedFileLockTable.checkList(FileChannelImpl.java:1166)
at sun.nio.ch.FileChannelImpl$SharedFileLockTable.add(FileChannelImpl.java:1068)
at sun.nio.ch.FileChannelImpl.lock(FileChannelImpl.java:824)
at java.nio.channels.FileChannel.lock(FileChannel.java:860)
... 6 more
---------------------------------------
Unable to get lock on /var/lib/jenkins/jobs/project/workspace/cobertura.ser.lock: null
This is known to happen on Linux kernel 2.6.20.
Make sure cobertura.jar is in the root classpath of the jvm
process running the instrumented code. If the instrumented code
is running in a web server, this means cobertura.jar should be in
the web server's lib directory.
Don't put multiple copies of cobertura.jar in different WEB-INF/lib directories.
Only one classloader should load cobertura. It should be the root classloader.
---------------------------------------
lock file could not be deleted
Run Code Online (Sandbox Code Playgroud)
这似乎并没有"打破构建",但在构建的下方,我们得到以下(导致cobertura报告失败)
Publishing Cobertura coverage report...
No coverage results were found using the pattern 'test-result/code-coverage/coverage.xml' relative to '/var/lib/jenkins/jobs/project/workspace'. Did you enter a pattern relative to the correct directory? Did you generate the XML report(s) for Cobertura?
Build step 'Publish Cobertura Coverage Report' changed build result to FAILURE
Run Code Online (Sandbox Code Playgroud)
手动运行后续构建通常会通过.
根据cobertura 1.9.2的Zero代码覆盖率但是测试工作正常,我在play auto-test -command后尝试设置-Dcobertura.use.java.nio = false.
由于这个错误只是偶尔发生,我不完全确定这是否有帮助.但在那之后,我们遇到了播放自动测试挂起的问题:
...
Executing /opt/play-1.2.4/play auto-test "/var/lib/jenkins/jobs/project/workspace" -Dcobertura.use.java.nio=false
[workspace] $ /opt/play-1.2.4/play auto-test "/var/lib/jenkins/jobs/project/workspace" -Dcobertura.use.java.nio=false
<build stuck here for a couple of days>
Run Code Online (Sandbox Code Playgroud)
由于没有什么是完全确定性的,所以在这里说出因果关系有点困难.(这似乎发生在jenkins/server重启后的一两个构建之后)
目前我正在考虑在我们的项目中禁用Cobertura,但如果有人有其他想法,这将是伟大的=)
你设置了吗
%test.play.tmp=none
Run Code Online (Sandbox Code Playgroud)
在你的 application.conf 文件中?
| 归档时间: |
|
| 查看次数: |
3376 次 |
| 最近记录: |