problems with maven2 project and JUnit reports

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

problems with maven2 project and JUnit reports

Lars Burgess
Hello,

I'm currently using hudson with several maven2 projects. After upgrading from version 1.126 to 1.129, all of the projects which run JUnit tests fail after the integration-test phase with the following message:

[HUDSON] Recording test results
[HUDSON] Archiving /usr/local/hudson/.hudson/jobs/Platform-Trunk/workspace/platform-trunk/client-plugin/pom.xml
[HUDSON] Archiving /usr/local/hudson/.hudson/jobs/Platform-Trunk/workspace/platform-trunk/client-plugin/target/client- plugin-0.8.19-SNAPSHOT.jar
[HUDSON] Archiving /usr/local/hudson/.hudson/jobs/Platform-Trunk/workspace/platform-trunk/client-plugin/target/client-plugin-0.8.19-SNAPSHOT-sources.jar
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Test reports were found but none of them are new. Did tests run? For example, /usr/local/hudson/.hudson/jobs/Platform-Trunk/workspace/platform-trunk/client-plugin/target/surefire-reports/TEST- net.mobio.qname.LocalNameMapTest.xml is 0 seconds old

[INFO] ------------------------------------------------------------------------
[INFO] Trace
hudson.tasks.junit.AbortException: Test reports were found but none of them are new. Did tests run? For example, /usr/local/hudson/.hudson/jobs/Platform-Trunk/workspace/platform-trunk/client-plugin/target/surefire-reports/TEST- net.mobio.qname.LocalNameMapTest.xml is 0 seconds old

at hudson.tasks.junit.TestResult.<init>(TestResult.java:90)
at hudson.maven.reporters.SurefireArchiver.postExecute(SurefireArchiver.java:67)
at hudson.maven.PluginManagerInterceptor.postExecute (PluginManagerInterceptor.java:111)
at hudson.maven.agent.PluginManagerInterceptor$1MojoConfig.callPost(PluginManagerInterceptor.java:102)
at hudson.maven.agent.PluginManagerInterceptor.executeMojo(PluginManagerInterceptor.java :133)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:534)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java :475)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:454)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java :306)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:140)
at org.apache.maven.lifecycle.LifecycleExecutorInterceptor.execute(LifecycleExecutorInterceptor.java:35)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:327)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:120)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:263)
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:585)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java :315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at hudson.maven.agent.Main.launch(Main.java:89)
at hudson.maven.MavenBuild$Builder.call(MavenBuild.java:172)
at hudson.maven.MavenBuild$Builder.call (MavenBuild.java:140)
at hudson.remoting.UserRequest.perform(UserRequest.java:69)
at hudson.remoting.UserRequest.perform(UserRequest.java:23)
at hudson.remoting.Request$2.run(Request.java:178)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask (ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 25 seconds
[INFO] Finished at: Thu Aug 16 10:33:06 PDT 2007
[INFO] Final Memory: 12M/29M
[INFO] ------------------------------------------------------------------------
finished: FAILURE
I'm running "clean deploy" as my mvn targets. Is there something that I need to change in the latest versions?

Cheers,
Lars
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problems with maven2 project and JUnit reports

Kohsuke Kawaguchi
Administrator

I noticed that you say your tests are run at integration-test phase, not
the usual test phase. Maybe that's related to this issue.

How do you run Surefire as integration-test? Would it be possible for
you to create a sample project (with a POM and a single test case) that
reproduces this problem?

Lars Burgess wrote:

> Hello,
>
> I'm currently using hudson with several maven2 projects. After upgrading
> from version 1.126 to 1.129, all of the projects which run JUnit tests fail
> after the integration-test phase with the following message:
>
> [HUDSON] Recording test results
> [HUDSON] Archiving
> /usr/local/hudson/.hudson/jobs/Platform-Trunk/workspace/platform-trunk/client-plugin/pom.xml
> [HUDSON] Archiving
> /usr/local/hudson/.hudson/jobs/Platform-Trunk/workspace/platform-trunk/client-plugin/target/client-plugin-0.8.19-SNAPSHOT.jar
> [HUDSON] Archiving
> /usr/local/hudson/.hudson/jobs/Platform-Trunk/workspace/platform-trunk/client-plugin/target/client-plugin-0.8.19-SNAPSHOT-sources.jar
> [INFO] ------------------------------------------------------------------------
> [ERROR] FATAL ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] Test reports were found but none of them are new. Did tests
> run? For example,
> /usr/local/hudson/.hudson/jobs/Platform-Trunk/workspace/platform-trunk/client-plugin/target/surefire-reports/TEST-net.mobio.qname.LocalNameMapTest.xml
> is 0 seconds old
>
> [INFO] ------------------------------------------------------------------------
> [INFO] Trace
> hudson.tasks.junit.AbortException: Test reports were found but none of
> them are new. Did tests run? For example,
> /usr/local/hudson/.hudson/jobs/Platform-Trunk/workspace/platform-trunk/client-plugin/target/surefire-reports/TEST-net.mobio.qname.LocalNameMapTest.xml
> is 0 seconds old
>
> at hudson.tasks.junit.TestResult.<init>(TestResult.java:90)
> at hudson.maven.reporters.SurefireArchiver.postExecute(SurefireArchiver.java:67)
> at hudson.maven.PluginManagerInterceptor.postExecute(PluginManagerInterceptor.java:111)
> at hudson.maven.agent.PluginManagerInterceptor$1MojoConfig.callPost(PluginManagerInterceptor.java:102)
> at hudson.maven.agent.PluginManagerInterceptor.executeMojo(PluginManagerInterceptor.java:133)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:534)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:475)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:454)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:306)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:140)
> at org.apache.maven.lifecycle.LifecycleExecutorInterceptor.execute(LifecycleExecutorInterceptor.java:35)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:327)
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:120)
> at org.apache.maven.cli.MavenCli.main(MavenCli.java:263)
> 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:585)
> at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
> at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
> at hudson.maven.agent.Main.launch(Main.java:89)
> at hudson.maven.MavenBuild$Builder.call(MavenBuild.java:172)
> at hudson.maven.MavenBuild$Builder.call(MavenBuild.java:140)
> at hudson.remoting.UserRequest.perform(UserRequest.java:69)
> at hudson.remoting.UserRequest.perform(UserRequest.java:23)
> at hudson.remoting.Request$2.run(Request.java:178)
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
> at java.lang.Thread.run(Thread.java:595)
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 25 seconds
> [INFO] Finished at: Thu Aug 16 10:33:06 PDT 2007
> [INFO] Final Memory: 12M/29M
> [INFO] ------------------------------------------------------------------------
> finished: FAILURE
>
> I'm running "clean deploy" as my mvn targets. Is there something that I need
> to change in the latest versions?
>
> Cheers,
> Lars
>

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problems with maven2 project and JUnit reports

Lars Burgess
In reply to this post by Lars Burgess
Thanks for the reply. Actually I just tried the latest release (1.130) and my project is now not failing as it did in version 1.129. 
Did something get fixed? Also, I went ahead and created a simple maven project so you can see how I'm running junit tests in the
integration-test phase. Let me know if the attachment didn't work and I can send it directly.

Cheers,
Lars


>Date: Sat, 18 Aug 2007 21:35:03 -0700
>From: Kohsuke Kawaguchi <[hidden email]>
>Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg=sha1; boundary="------------ms020600040909060209010905"
>Subject: problems with maven2 project and JUnit reports

>I noticed that you say your tests are run at integration-test phase, not 
>the usual test phase. Maybe that's related to this issue.

>How do you run Surefire as integration-test? Would it be possible for
>you to create a sample project (with a POM and a single test case) that
>reproduces this problem?

On 8/16/07, Lars Burgess <[hidden email]> wrote:
Hello,

I'm currently using hudson with several maven2 projects. After upgrading from version 1.126 to 1.129, all of the projects which run JUnit tests fail after the integration-test phase with the following message:

[HUDSON] Recording test results
[HUDSON] Archiving /usr/local/hudson/.hudson/jobs/Platform-Trunk/workspace/platform-trunk/client-plugin/pom.xml
[HUDSON] Archiving /usr/local/hudson/.hudson/jobs/Platform-Trunk/workspace/platform-trunk/client-plugin/target/client-
plugin-0.8.19-SNAPSHOT.jar
[HUDSON] Archiving /usr/local/hudson/.hudson/jobs/Platform-Trunk/workspace/platform-trunk/client-plugin/target/client-plugin-0.8.19-SNAPSHOT-sources.jar
[INFO] ------------------------------------------------------------------------

[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Test reports were found but none of them are new. Did tests run? For example, /usr/local/hudson/.hudson/jobs/Platform-Trunk/workspace/platform-trunk/client-plugin/target/surefire-reports/TEST-
net.mobio.qname.LocalNameMapTest.xml is 0 seconds old

[INFO] ------------------------------------------------------------------------
[INFO] Trace
hudson.tasks.junit.AbortException: Test reports were found but none of them are new. Did tests run? For example, /usr/local/hudson/.hudson/jobs/Platform-Trunk/workspace/platform-trunk/client-plugin/target/surefire-reports/TEST-
net.mobio.qname.LocalNameMapTest.xml is 0 seconds old

at hudson.tasks.junit.TestResult.<init>(TestResult.java:90)
at hudson.maven.reporters.SurefireArchiver.postExecute(SurefireArchiver.java:67)
at hudson.maven.PluginManagerInterceptor.postExecute
(PluginManagerInterceptor.java:111)
at hudson.maven.agent.PluginManagerInterceptor$1MojoConfig.callPost(PluginManagerInterceptor.java:102)
at hudson.maven.agent.PluginManagerInterceptor.executeMojo (PluginManagerInterceptor.java
:133)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:534)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle (DefaultLifecycleExecutor.java
:475)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:454)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures (DefaultLifecycleExecutor.java
:306)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute( DefaultLifecycleExecutor.java:140)

at org.apache.maven.lifecycle.LifecycleExecutorInterceptor.execute(LifecycleExecutorInterceptor.java:35)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:327)
at org.apache.maven.DefaultMaven.execute
(DefaultMaven.java:120)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:263)
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:585)
at org.codehaus.classworlds.Launcher.launchEnhanced (Launcher.java
:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at hudson.maven.agent.Main.launch(Main.java:89)
at hudson.maven.MavenBuild$Builder.call(MavenBuild.java:172)
at hudson.maven.MavenBuild$Builder.call
(MavenBuild.java:140)
at hudson.remoting.UserRequest.perform(UserRequest.java:69)
at hudson.remoting.UserRequest.perform(UserRequest.java:23)
at hudson.remoting.Request$2.run(Request.java:178)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask
(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
[INFO] ------------------------------------------------------------------------

[INFO] Total time: 25 seconds
[INFO] Finished at: Thu Aug 16 10:33:06 PDT 2007
[INFO] Final Memory: 12M/29M
[INFO] ------------------------------------------------------------------------
finished: FAILURE
I'm running "clean deploy" as my mvn targets. Is there something that I need to change in the latest versions?

Cheers,
Lars


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

sample.zip (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problems with maven2 project and JUnit reports

Lars Burgess
I spoke too soon, I'm still getting failures in Hudson v1.130. It's interesting, the build passed the first time, but now all successive builds are failing with the original hudson.tasks.junit.AbortException.

-Lars


On 8/20/07, Lars Burgess <[hidden email]> wrote:
Thanks for the reply. Actually I just tried the latest release (
1.130) and my project is now not failing as it did in version 1.129. 
Did something get fixed? Also, I went ahead and created a simple maven project so you can see how I'm running junit tests in the

integration-test phase. Let me know if the attachment didn't work and I can send it directly.

Cheers,
Lars


>Date: Sat, 18 Aug 2007 21:35:03 -0700
>From: Kohsuke Kawaguchi <[hidden email]>
>Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg=sha1; boundary="------------ms020600040909060209010905"
>Subject: problems with maven2 project and JUnit reports


>I noticed that you say your tests are run at integration-test phase, not 
>the usual test phase. Maybe that's related to this issue.

>How do you run Surefire as integration-test? Would it be possible for

>you to create a sample project (with a POM and a single test case) that
>reproduces this problem?

On 8/16/07, Lars Burgess <[hidden email]> wrote:
Hello,

I'm currently using hudson with several maven2 projects. After upgrading from version 1.126 to 1.129, all of the projects which run JUnit tests fail after the integration-test phase with the following message:

[HUDSON] Recording test results
[HUDSON] Archiving /usr/local/hudson/.hudson/jobs/Platform-Trunk/workspace/platform-trunk/client-plugin/pom.xml
[HUDSON] Archiving /usr/local/hudson/.hudson/jobs/Platform-Trunk/workspace/platform-trunk/client-plugin/target/client-

plugin-0.8.19-SNAPSHOT.jar
[HUDSON] Archiving /usr/local/hudson/.hudson/jobs/Platform-Trunk/workspace/platform-trunk/client-plugin/target/client-plugin-0.8.19-SNAPSHOT-sources.jar
[INFO] ------------------------------------------------------------------------


[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Test reports were found but none of them are new. Did tests run? For example, /usr/local/hudson/.hudson/jobs/Platform-Trunk/workspace/platform-trunk/client-plugin/target/surefire-reports/TEST-

net.mobio.qname.LocalNameMapTest.xml is 0 seconds old

[INFO] ------------------------------------------------------------------------
[INFO] Trace
hudson.tasks.junit.AbortException: Test reports were found but none of them are new. Did tests run? For example, /usr/local/hudson/.hudson/jobs/Platform-Trunk/workspace/platform-trunk/client-plugin/target/surefire-reports/TEST-

net.mobio.qname.LocalNameMapTest.xml is 0 seconds old

at hudson.tasks.junit.TestResult.<init>(TestResult.java:90)
at hudson.maven.reporters.SurefireArchiver.postExecute(SurefireArchiver.java:67)
at
hudson.maven.PluginManagerInterceptor.postExecute
(PluginManagerInterceptor.java:111)
at hudson.maven.agent.PluginManagerInterceptor$1MojoConfig.callPost(PluginManagerInterceptor.java:102)
at hudson.maven.agent.PluginManagerInterceptor.executeMojo
(PluginManagerInterceptor.java
:133)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:534)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle
(DefaultLifecycleExecutor.java
:475)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:454)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures
(DefaultLifecycleExecutor.java
:306)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute (
DefaultLifecycleExecutor.java:140)

at org.apache.maven.lifecycle.LifecycleExecutorInterceptor.execute(LifecycleExecutorInterceptor.java:35)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:327)
at org.apache.maven.DefaultMaven.execute
(DefaultMaven.java:120)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:263)
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:585)
at org.codehaus.classworlds.Launcher.launchEnhanced
(Launcher.java
:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at hudson.maven.agent.Main.launch(Main.java:89)
at hudson.maven.MavenBuild$Builder.call(MavenBuild.java:172)
at hudson.maven.MavenBuild$Builder.call

(MavenBuild.java:140)
at hudson.remoting.UserRequest.perform(UserRequest.java:69)
at hudson.remoting.UserRequest.perform(UserRequest.java:23)
at hudson.remoting.Request$2.run(Request.java:178)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask

(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
[INFO] ------------------------------------------------------------------------


[INFO] Total time: 25 seconds
[INFO] Finished at: Thu Aug 16 10:33:06 PDT 2007
[INFO] Final Memory: 12M/29M
[INFO] ------------------------------------------------------------------------
finished: FAILURE

I'm running "clean deploy" as my mvn targets. Is there something that I need to change in the latest versions?

Cheers,
Lars



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problems with maven2 project and JUnit reports

Kohsuke Kawaguchi
Administrator
In reply to this post by Lars Burgess

Thanks. I got the attachment. If I can ask you one more favor, if you
could file an issue for this, that would be really appreciated.

Lars Burgess wrote:

> Thanks for the reply. Actually I just tried the latest release (1.130)
> and my project is now not failing as it did in version 1.129.
> Did something get fixed? Also, I went ahead and created a simple maven
> project so you can see how I'm running junit tests in the
> integration-test phase. Let me know if the attachment didn't work and
> I can send it directly.
>
> Cheers,
> Lars
>
>
>>Date: Sat, 18 Aug 2007 21:35:03 -0700
>>From: Kohsuke Kawaguchi <[hidden email]>
>>Content-Type: multipart/signed;
> protocol="application/x-pkcs7-signature"; micalg=sha1;
> boundary="------------ms020600040909060209010905"
>>Subject: problems with maven2 project and JUnit reports
>
>>I noticed that you say your tests are run at integration-test phase, not
>>the usual test phase. Maybe that's related to this issue.
>
>>How do you run Surefire as integration-test? Would it be possible for
>>you to create a sample project (with a POM and a single test case) that
>>reproduces this problem?
>
>
> On 8/16/07, Lars Burgess <[hidden email]> wrote:
>>
>> Hello,
>>
>> I'm currently using hudson with several maven2 projects. After upgrading
>> from version 1.126 to 1.129, all of the projects which run JUnit tests
>> fail after the integration-test phase with the following message:
>>
>> [HUDSON] Recording test results
>> [HUDSON] Archiving /usr/local/hudson/.hudson/jobs/Platform-Trunk/workspace/platform-trunk/client-plugin/pom.xml
>> [HUDSON] Archiving /usr/local/hudson/.hudson/jobs/Platform-Trunk/workspace/platform-trunk/client-plugin/target/client-
>> plugin-0.8.19-SNAPSHOT.jar
>> [HUDSON] Archiving /usr/local/hudson/.hudson/jobs/Platform-Trunk/workspace/platform-trunk/client-plugin/target/client-plugin-0.8.19-SNAPSHOT-sources.jar
>> [INFO] ------------------------------------------------------------------------
>>
>> [ERROR] FATAL ERROR
>> [INFO] ------------------------------------------------------------------------
>> [INFO] Test reports were found but none of them are new. Did tests run? For example, /usr/local/hudson/.hudson/jobs/Platform-Trunk/workspace/platform-trunk/client-plugin/target/surefire-reports/TEST-
>> net.mobio.qname.LocalNameMapTest.xml is 0 seconds old
>>
>> [INFO] ------------------------------------------------------------------------
>> [INFO] Trace
>> hudson.tasks.junit.AbortException: Test reports were found but none of them are new. Did tests run? For example, /usr/local/hudson/.hudson/jobs/Platform-Trunk/workspace/platform-trunk/client-plugin/target/surefire-reports/TEST-
>> net.mobio.qname.LocalNameMapTest.xml is 0 seconds old
>>
>> at hudson.tasks.junit.TestResult.<init>(TestResult.java:90)
>> at hudson.maven.reporters.SurefireArchiver.postExecute(SurefireArchiver.java:67)
>> at hudson.maven.PluginManagerInterceptor.postExecute
>> (PluginManagerInterceptor.java:111)
>> at hudson.maven.agent.PluginManagerInterceptor$1MojoConfig.callPost(PluginManagerInterceptor.java:102)
>> at hudson.maven.agent.PluginManagerInterceptor.executeMojo(PluginManagerInterceptor.java
>> :133)
>> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:534)
>> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java
>> :475)
>> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:454)
>> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java
>> :306)
>> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273)
>> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:140)
>>
>> at org.apache.maven.lifecycle.LifecycleExecutorInterceptor.execute(LifecycleExecutorInterceptor.java:35)
>> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:327)
>> at org.apache.maven.DefaultMaven.execute
>> (DefaultMaven.java:120)
>> at org.apache.maven.cli.MavenCli.main(MavenCli.java:263)
>> 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:585)
>> at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java
>> :315)
>> at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>> at hudson.maven.agent.Main.launch(Main.java:89)
>> at hudson.maven.MavenBuild$Builder.call(MavenBuild.java:172)
>> at hudson.maven.MavenBuild$Builder.call
>> (MavenBuild.java:140)
>> at hudson.remoting.UserRequest.perform(UserRequest.java:69)
>> at hudson.remoting.UserRequest.perform(UserRequest.java:23)
>> at hudson.remoting.Request$2.run(Request.java:178)
>> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask
>> (ThreadPoolExecutor.java:650)
>> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>> at java.lang.Thread.run(Thread.java:595)
>> [INFO] ------------------------------------------------------------------------
>>
>> [INFO] Total time: 25 seconds
>> [INFO] Finished at: Thu Aug 16 10:33:06 PDT 2007
>> [INFO] Final Memory: 12M/29M
>> [INFO] ------------------------------------------------------------------------
>> finished: FAILURE
>>
>> I'm running "clean deploy" as my mvn targets. Is there something that I
>> need to change in the latest versions?
>>
>> Cheers,
>> Lars
>>
>
>
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problems with maven2 project and JUnit reports

Lars Burgess
In reply to this post by Lars Burgess
Sure thing, I've filed issue #751.

Cheers,
Lars

>Kohsuke Kawaguchi wrote:
>Thanks. I got the attachment. If I can ask you one more favor, if you
>could file an issue for this, that would be really appreciated.

On 8/20/07, Lars Burgess <[hidden email]> wrote:
Thanks for the reply. Actually I just tried the latest release (1.130
) and my project is now not failing as it did in version 1.129. 
Did something get fixed? Also, I went ahead and created a simple maven project so you can see how I'm running junit tests in the

integration-test phase. Let me know if the attachment didn't work and I can send it directly.

Cheers,
Lars


>Date: Sat, 18 Aug 2007 21:35:03 -0700
>From: Kohsuke Kawaguchi <[hidden email]>
>Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg=sha1; boundary="------------ms020600040909060209010905"
>Subject: problems with maven2 project and JUnit reports


>I noticed that you say your tests are run at integration-test phase, not 
>the usual test phase. Maybe that's related to this issue.

>How do you run Surefire as integration-test? Would it be possible for

>you to create a sample project (with a POM and a single test case) that
>reproduces this problem?

On 8/16/07, Lars Burgess <[hidden email]> wrote:
Hello,

I'm currently using hudson with several maven2 projects. After upgrading from version 1.126 to 1.129, all of the projects which run JUnit tests fail after the integration-test phase with the following message:

[HUDSON] Recording test results
[HUDSON] Archiving /usr/local/hudson/.hudson/jobs/Platform-Trunk/workspace/platform-trunk/client-plugin/pom.xml
[HUDSON] Archiving /usr/local/hudson/.hudson/jobs/Platform-Trunk/workspace/platform-trunk/client-plugin/target/client-

plugin-0.8.19-SNAPSHOT.jar
[HUDSON] Archiving /usr/local/hudson/.hudson/jobs/Platform-Trunk/workspace/platform-trunk/client-plugin/target/client-plugin-0.8.19-SNAPSHOT-sources.jar
[INFO] ------------------------------------------------------------------------


[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Test reports were found but none of them are new. Did tests run? For example, /usr/local/hudson/.hudson/jobs/Platform-Trunk/workspace/platform-trunk/client-plugin/target/surefire-reports/TEST-

net.mobio.qname.LocalNameMapTest.xml is 0 seconds old

[INFO] ------------------------------------------------------------------------
[INFO] Trace
hudson.tasks.junit.AbortException: Test reports were found but none of them are new. Did tests run? For example, /usr/local/hudson/.hudson/jobs/Platform-Trunk/workspace/platform-trunk/client-plugin/target/surefire-reports/TEST-

net.mobio.qname.LocalNameMapTest.xml is 0 seconds old

at hudson.tasks.junit.TestResult.<init>(TestResult.java:90)
at hudson.maven.reporters.SurefireArchiver.postExecute(SurefireArchiver.java:67)
at
hudson.maven.PluginManagerInterceptor.postExecute
(PluginManagerInterceptor.java:111)
at hudson.maven.agent.PluginManagerInterceptor$1MojoConfig.callPost(PluginManagerInterceptor.java:102)
at hudson.maven.agent.PluginManagerInterceptor.executeMojo
(PluginManagerInterceptor.java
:133)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:534)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle
(DefaultLifecycleExecutor.java
:475)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:454)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures
(DefaultLifecycleExecutor.java
:306)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute (
DefaultLifecycleExecutor.java:140)

at org.apache.maven.lifecycle.LifecycleExecutorInterceptor.execute(LifecycleExecutorInterceptor.java:35)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:327)
at org.apache.maven.DefaultMaven.execute
(DefaultMaven.java:120)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:263)
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:585)
at org.codehaus.classworlds.Launcher.launchEnhanced
(Launcher.java
:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at hudson.maven.agent.Main.launch(Main.java:89)
at hudson.maven.MavenBuild$Builder.call(MavenBuild.java:172)
at hudson.maven.MavenBuild$Builder.call

(MavenBuild.java:140)
at hudson.remoting.UserRequest.perform(UserRequest.java:69)
at hudson.remoting.UserRequest.perform(UserRequest.java:23)
at hudson.remoting.Request$2.run(Request.java:178)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask

(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
[INFO] ------------------------------------------------------------------------


[INFO] Total time: 25 seconds
[INFO] Finished at: Thu Aug 16 10:33:06 PDT 2007
[INFO] Final Memory: 12M/29M
[INFO] ------------------------------------------------------------------------
finished: FAILURE

I'm running "clean deploy" as my mvn targets. Is there something that I need to change in the latest versions?

Cheers,
Lars



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problems with maven2 project and JUnit reports

Erik Ramfelt
I wonder if this is similar to a problem that Im seeing right now. Im
testing some simple behvaiour with the JUnit test publisher to see how
it behaves with different data (as data XSLT'ed from NUnit). Ive set
up a very simple JUnit report which is copied by the hudson job and
then evaluted by the test task.

The first time I run it after Ive restarted the hudson (through
winstone) it works fine and the tests are reported properly. But the
next time I build, I get the above console output and the build fails
until I restart the winstone.

I expected that the test task would read the junit report again iff
the file was updated in the build. But some how Hudson believes that
the file hasnt been updated. Or how does the test task determine if
the file is new and that it should read the results?


The shell script looks like this:
------------------------------------------
date
ls -l
rm ./junit-report.xml
cp /home/erik/coding/test/nunittests/reports/junit-report.xml .
touch junit-report.xml
ls -l
sleep 61
date
------------------------------------------

The console output looks like this:
------------------------------------------
started
[workspace] $ /bin/sh -xe /tmp/hudson65207.sh
+ date
tis aug 21 14:34:50 CEST 2007
+ ls -l
total 4
-rw-r--r-- 1 hudson hudson 1131 2007-08-21 14:30 junit-report.xml
+ rm ./junit-report.xml
+ cp /home/erik/coding/test/nunittests/reports/junit-report.xml .
+ touch junit-report.xml
+ ls -l
total 4
-rw-r--r-- 1 hudson hudson 1131 2007-08-21 14:34 junit-report.xml
+ sleep 61
+ date
tis aug 21 14:35:51 CEST 2007
Recording test results
Test reports were found but none of them are new. Did tests run? For
example, /home/hudson/./data/jobs/NUnit
tests/workspace/junit-report.xml is 0 seconds old

finished: FAILURE
------------------------------------------


The junit report looks like this:
------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<testsuite name="UnitTests" time="0.404" tests="4" errors="" failures="1">
  <testcase classname="UnitTests"
name="MainClassTest.TestPropertyValue" time="0.146">
  </testcase>
  <testcase classname="UnitTests"
name="MainClassTest.TestMethodUpdateValue" time="0.001">
  </testcase>
  <testcase classname="UnitTests" name="MainClassTest.TestFailure" time="0.092">
    <failure><![CDATA[
                            MESSAGE: ]]><![CDATA[  Expected failure
  Expected: 30
  But was:  20
]]><![CDATA[
                            +++++++++++++++++++
                            STACK TRACE: ]]><![CDATA[  at
UnitTests.MainClassTest.TestFailure () [0x00000]
  at <0x00000> <unknown method>
  at (wrapper managed-to-native)
System.Reflection.MonoMethod:InternalInvoke (object,object[])
  at System.Reflection.MonoMethod.Invoke (System.Object obj,
BindingFlags invokeAttr, System.Reflection.Binder binder,
System.Object[] parameters, System.Globalization.CultureInfo culture)
[0x00000]
]]></failure>
  </testcase>
  <testcase classname="UnitTests" name="" time="0.001">
  </testcase>
</testsuite>
------------------------------------------

Regards
//Erik


On 8/20/07, Lars Burgess <[hidden email]> wrote:

> Sure thing, I've filed issue #751.
>
> Cheers,
> Lars
>
> >Kohsuke Kawaguchi wrote:
> >Thanks. I got the attachment. If I can ask you one more favor, if you
>
> >could file an issue for this, that would be really appreciated.
>
>
>
> On 8/20/07, Lars Burgess <[hidden email] > wrote:
> > Thanks for the reply. Actually I just tried the latest release (1.130
> > ) and my project is now not failing as it did in version 1.129.
> > Did something get fixed? Also, I went ahead and created a simple maven
> project so you can see how I'm running junit tests in the
> >
> > integration-test phase. Let me know if the attachment didn't work and I
> can send it directly.
> >
> >
> > Cheers,
> > Lars
> >
> >
> > >Date: Sat, 18 Aug 2007 21:35:03 -0700
> > >From: Kohsuke Kawaguchi <
> >
> > [hidden email]>
> > >Content-Type: multipart/signed;
> protocol="application/x-pkcs7-signature"; micalg=sha1;
> boundary="------------ms020600040909060209010905"
> > >Subject: problems with maven2 project and JUnit reports
> >
> >
> >
> >
> > >I noticed that you say your tests are run at integration-test phase, not
> > >the usual test phase. Maybe that's related to this issue.
> >
> > >How do you run Surefire as integration-test? Would it be possible for
> >
> >
> > >you to create a sample project (with a POM and a single test case) that
> > >reproduces this problem?
> >
> >
> >
> > On 8/16/07, Lars Burgess < [hidden email]> wrote:
> > > Hello,
> > >
> > > I'm currently using hudson with several maven2 projects. After upgrading
> from version 1.126 to 1.129, all of the projects which run JUnit tests fail
> after the integration-test phase with the following message:
> > >
> > > [HUDSON] Recording test results
> > > [HUDSON] Archiving
> /usr/local/hudson/.hudson/jobs/Platform-Trunk/workspace/platform-trunk/client-plugin/pom.xml
> > > [HUDSON] Archiving
> /usr/local/hudson/.hudson/jobs/Platform-Trunk/workspace/platform-trunk/client-plugin/target/client-
> > >
> > >
> > > plugin-0.8.19-SNAPSHOT.jar
> > > [HUDSON] Archiving
> /usr/local/hudson/.hudson/jobs/Platform-Trunk/workspace/platform-trunk/client-plugin/target/client-plugin-0.8.19-SNAPSHOT-sources.jar
> > > [INFO]
> ------------------------------------------------------------------------
> > >
> > >
> > >
> > > [ERROR] FATAL ERROR
> > > [INFO]
> ------------------------------------------------------------------------
> > > [INFO] Test reports were found but none of them are new. Did tests run?
> For example,
> /usr/local/hudson/.hudson/jobs/Platform-Trunk/workspace/platform-trunk/client-plugin/target/surefire-reports/TEST-
> > >
> > >
> > > net.mobio.qname.LocalNameMapTest.xml is 0 seconds old
> > >
> > > [INFO]
> ------------------------------------------------------------------------
> > > [INFO] Trace
> > > hudson.tasks.junit.AbortException: Test reports were
> found but none of them are new. Did tests run? For example,
> /usr/local/hudson/.hudson/jobs/Platform-Trunk/workspace/platform-trunk/client-plugin/target/surefire-reports/TEST-
> > >
> > >
> > > net.mobio.qname.LocalNameMapTest.xml is 0 seconds old
> > >
> > > at hudson.tasks.junit.TestResult.<init>(TestResult.java:90)
> > > at
> hudson.maven.reporters.SurefireArchiver.postExecute(SurefireArchiver.java:67)
> > >
> > > at
> > > hudson.maven.PluginManagerInterceptor.postExecute
> > > (PluginManagerInterceptor.java:111)
> > > at
> hudson.maven.agent.PluginManagerInterceptor$1MojoConfig.callPost(PluginManagerInterceptor.java:102)
> > > at
> hudson.maven.agent.PluginManagerInterceptor.executeMojo
> > >
> > > (PluginManagerInterceptor.java
> > > :133)
> > > at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:534)
> > > at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle
> > >
> > > (DefaultLifecycleExecutor.java
> > > :475)
> > > at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:454)
> > > at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures
> > >
> > > (DefaultLifecycleExecutor.java
> > > :306)
> > > at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273)
> > > at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute
> > > (
> > > DefaultLifecycleExecutor.java:140)
> > >
> > > at
> org.apache.maven.lifecycle.LifecycleExecutorInterceptor.execute(LifecycleExecutorInterceptor.java:35)
> > > at
> org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:327)
> > >
> > >
> > > at org.apache.maven.DefaultMaven.execute
> > > (DefaultMaven.java:120)
> > > at
> org.apache.maven.cli.MavenCli.main(MavenCli.java:263)
> > > 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:585)
> > > at org.codehaus.classworlds.Launcher.launchEnhanced
> > >
> > > (Launcher.java
> > > :315)
> > > at
> org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
> > > at hudson.maven.agent.Main.launch(Main.java:89)
> > > at
> hudson.maven.MavenBuild$Builder.call(MavenBuild.java:172)
> > > at hudson.maven.MavenBuild$Builder.call
> > >
> > >
> > > (MavenBuild.java:140)
> > > at
> hudson.remoting.UserRequest.perform(UserRequest.java:69)
> > > at
> hudson.remoting.UserRequest.perform(UserRequest.java:23)
> > > at hudson.remoting.Request$2.run(Request.java:178)
> > > at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask
> > >
> > >
> > > (ThreadPoolExecutor.java:650)
> > > at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
> > > at java.lang.Thread.run(Thread.java:595)
> > > [INFO]
> ------------------------------------------------------------------------
> > >
> > >
> > >
> > > [INFO] Total time: 25 seconds
> > > [INFO] Finished at: Thu Aug 16 10:33:06 PDT 2007
> > > [INFO] Final Memory: 12M/29M
> > > [INFO]
> ------------------------------------------------------------------------
> > > finished: FAILURE
> > >
> > >
> > >
> > > I'm running "clean deploy" as my mvn targets. Is there something that I
> need to change in the latest versions?
> > >
> > > Cheers,
> > > Lars
> > >
> >
> >
> >
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problems with maven2 project and JUnit reports

Erik Ramfelt
I found the problem with my setup (when copying the juint report files
into the workspace using a shell script at start of the build). If the
JUnit report last modified time is the same as the time the build
started then the JUnit result archiver will not read the test reports.
(The build is faster than 1 second)

Perhaps the JUnit result archiver could check if the unit test report
is equal or newer than the build time then it will import the test
reports. ie if the report time is older than when the build started it
will not read the report. Or is this a bad idea?


My work around for this problem looks like this for the shell script:
sleep 1
cp /home/erik/coding/test/nunittests/reports/junit-report.xml .
touch junit-report.xml

regards
//Erik

On 8/21/07, Erik Ramfelt <[hidden email]> wrote:

> I wonder if this is similar to a problem that Im seeing right now. Im
> testing some simple behvaiour with the JUnit test publisher to see how
> it behaves with different data (as data XSLT'ed from NUnit). Ive set
> up a very simple JUnit report which is copied by the hudson job and
> then evaluted by the test task.
>
> The first time I run it after Ive restarted the hudson (through
> winstone) it works fine and the tests are reported properly. But the
> next time I build, I get the above console output and the build fails
> until I restart the winstone.
>
> I expected that the test task would read the junit report again iff
> the file was updated in the build. But some how Hudson believes that
> the file hasnt been updated. Or how does the test task determine if
> the file is new and that it should read the results?
>
>
> The shell script looks like this:
> ------------------------------------------
> date
> ls -l
> rm ./junit-report.xml
> cp /home/erik/coding/test/nunittests/reports/junit-report.xml .
> touch junit-report.xml
> ls -l
> sleep 61
> date
> ------------------------------------------
>
> The console output looks like this:
> ------------------------------------------
> started
> [workspace] $ /bin/sh -xe /tmp/hudson65207.sh
> + date
> tis aug 21 14:34:50 CEST 2007
> + ls -l
> total 4
> -rw-r--r-- 1 hudson hudson 1131 2007-08-21 14:30 junit-report.xml
> + rm ./junit-report.xml
> + cp /home/erik/coding/test/nunittests/reports/junit-report.xml .
> + touch junit-report.xml
> + ls -l
> total 4
> -rw-r--r-- 1 hudson hudson 1131 2007-08-21 14:34 junit-report.xml
> + sleep 61
> + date
> tis aug 21 14:35:51 CEST 2007
> Recording test results
> Test reports were found but none of them are new. Did tests run? For
> example, /home/hudson/./data/jobs/NUnit
> tests/workspace/junit-report.xml is 0 seconds old
>
> finished: FAILURE
> ------------------------------------------
>
>
> The junit report looks like this:
> ------------------------------------------
> <?xml version="1.0" encoding="utf-8"?>
> <testsuite name="UnitTests" time="0.404" tests="4" errors="" failures="1">
>   <testcase classname="UnitTests"
> name="MainClassTest.TestPropertyValue" time="0.146">
>   </testcase>
>   <testcase classname="UnitTests"
> name="MainClassTest.TestMethodUpdateValue" time="0.001">
>   </testcase>
>   <testcase classname="UnitTests" name="MainClassTest.TestFailure" time="0.092">
>     <failure><![CDATA[
>                             MESSAGE: ]]><![CDATA[  Expected failure
>   Expected: 30
>   But was:  20
> ]]><![CDATA[
>                             +++++++++++++++++++
>                             STACK TRACE: ]]><![CDATA[  at
> UnitTests.MainClassTest.TestFailure () [0x00000]
>   at <0x00000> <unknown method>
>   at (wrapper managed-to-native)
> System.Reflection.MonoMethod:InternalInvoke (object,object[])
>   at System.Reflection.MonoMethod.Invoke (System.Object obj,
> BindingFlags invokeAttr, System.Reflection.Binder binder,
> System.Object[] parameters, System.Globalization.CultureInfo culture)
> [0x00000]
> ]]></failure>
>   </testcase>
>   <testcase classname="UnitTests" name="" time="0.001">
>   </testcase>
> </testsuite>
> ------------------------------------------
>
> Regards
> //Erik
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problems with maven2 project and JUnit reports

Kohsuke Kawaguchi
Administrator
Erik Ramfelt wrote:

> I found the problem with my setup (when copying the juint report files
> into the workspace using a shell script at start of the build). If the
> JUnit report last modified time is the same as the time the build
> started then the JUnit result archiver will not read the test reports.
> (The build is faster than 1 second)
>
> Perhaps the JUnit result archiver could check if the unit test report
> is equal or newer than the build time then it will import the test
> reports. ie if the report time is older than when the build started it
> will not read the report. Or is this a bad idea?
>
>
> My work around for this problem looks like this for the shell script:
> sleep 1
> cp /home/erik/coding/test/nunittests/reports/junit-report.xml .
> touch junit-report.xml
I added error margin in 1.133 so that if the time stamp of the file is
close enough, it will be recorded without an error. But if you copy a
file from elsewhere, you'd have to 'touch' it anyway to set a newer
timestamp.

'sleep 1' won't be necessary.

>
> regards
> //Erik
>
> On 8/21/07, Erik Ramfelt <[hidden email]> wrote:
>> I wonder if this is similar to a problem that Im seeing right now. Im
>> testing some simple behvaiour with the JUnit test publisher to see how
>> it behaves with different data (as data XSLT'ed from NUnit). Ive set
>> up a very simple JUnit report which is copied by the hudson job and
>> then evaluted by the test task.
>>
>> The first time I run it after Ive restarted the hudson (through
>> winstone) it works fine and the tests are reported properly. But the
>> next time I build, I get the above console output and the build fails
>> until I restart the winstone.
>>
>> I expected that the test task would read the junit report again iff
>> the file was updated in the build. But some how Hudson believes that
>> the file hasnt been updated. Or how does the test task determine if
>> the file is new and that it should read the results?
>>
>>
>> The shell script looks like this:
>> ------------------------------------------
>> date
>> ls -l
>> rm ./junit-report.xml
>> cp /home/erik/coding/test/nunittests/reports/junit-report.xml .
>> touch junit-report.xml
>> ls -l
>> sleep 61
>> date
>> ------------------------------------------
>>
>> The console output looks like this:
>> ------------------------------------------
>> started
>> [workspace] $ /bin/sh -xe /tmp/hudson65207.sh
>> + date
>> tis aug 21 14:34:50 CEST 2007
>> + ls -l
>> total 4
>> -rw-r--r-- 1 hudson hudson 1131 2007-08-21 14:30 junit-report.xml
>> + rm ./junit-report.xml
>> + cp /home/erik/coding/test/nunittests/reports/junit-report.xml .
>> + touch junit-report.xml
>> + ls -l
>> total 4
>> -rw-r--r-- 1 hudson hudson 1131 2007-08-21 14:34 junit-report.xml
>> + sleep 61
>> + date
>> tis aug 21 14:35:51 CEST 2007
>> Recording test results
>> Test reports were found but none of them are new. Did tests run? For
>> example, /home/hudson/./data/jobs/NUnit
>> tests/workspace/junit-report.xml is 0 seconds old
>>
>> finished: FAILURE
>> ------------------------------------------
>>
>>
>> The junit report looks like this:
>> ------------------------------------------
>> <?xml version="1.0" encoding="utf-8"?>
>> <testsuite name="UnitTests" time="0.404" tests="4" errors="" failures="1">
>>   <testcase classname="UnitTests"
>> name="MainClassTest.TestPropertyValue" time="0.146">
>>   </testcase>
>>   <testcase classname="UnitTests"
>> name="MainClassTest.TestMethodUpdateValue" time="0.001">
>>   </testcase>
>>   <testcase classname="UnitTests" name="MainClassTest.TestFailure" time="0.092">
>>     <failure><![CDATA[
>>                             MESSAGE: ]]><![CDATA[  Expected failure
>>   Expected: 30
>>   But was:  20
>> ]]><![CDATA[
>>                             +++++++++++++++++++
>>                             STACK TRACE: ]]><![CDATA[  at
>> UnitTests.MainClassTest.TestFailure () [0x00000]
>>   at <0x00000> <unknown method>
>>   at (wrapper managed-to-native)
>> System.Reflection.MonoMethod:InternalInvoke (object,object[])
>>   at System.Reflection.MonoMethod.Invoke (System.Object obj,
>> BindingFlags invokeAttr, System.Reflection.Binder binder,
>> System.Object[] parameters, System.Globalization.CultureInfo culture)
>> [0x00000]
>> ]]></failure>
>>   </testcase>
>>   <testcase classname="UnitTests" name="" time="0.001">
>>   </testcase>
>> </testsuite>
>> ------------------------------------------
>>
>> Regards
>> //Erik
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problems with maven2 project and JUnit reports

Lars Burgess
In reply to this post by Lars Burgess
I still see the problem with 1.133. I think I've identified a few more symptoms. I have the following maven-surefire-plugin
configuration in my base pom:

<plugin>
<groupId>org.apache.maven.plugins </groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/integration/**</exclude>
</excludes>
</configuration>
<executions>
<execution>
<id>surefire-it</id>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<excludes>
<exclude>**/*.bin</exclude>
<exclude>**/*.txt</exclude>
<exclude>**/*.xml</exclude>
</excludes>
<includes>
<include>**/integration/**</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>

Now, this pom is inherited both by projects with and without integration tests. It appears that the projects which don't have integration tests are failing
because hudson detects that no integration tests run, therefore throwing the following message (noted by the "surefire-it" execution below):


[HUDSON] Recording test results
[INFO] [jar:jar]
[INFO] Building jar: /usr/local/hudson/.hudson/jobs/Platform/workspace/trunk/client-plugin/target/client-plugin-0.8.19-SNAPSHOT.jar
[INFO] Preparing source:jar
[WARNING] Removing: jar from forked lifecycle, to prevent recursive invocation.
[INFO] No goals needed for project - skipping
[INFO] [source:jar {execution: default}]
[INFO] Building jar: /usr/local/hudson/.hudson/jobs/Platform/workspace/trunk/client-plugin/target/client-plugin-0.8.19-SNAPSHOT-sources.jar
[INFO] [surefire:test {execution: surefire-it}]
[INFO] Surefire report directory: /usr/local/hudson/.hudson/jobs/Platform/workspace/trunk/client-plugin/target/surefire-reports

-------------------------------------------------------
T E S T S
-------------------------------------------------------
There are no tests to run.

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[HUDSON] Recording test results
[HUDSON] Archiving /usr/local/hudson/.hudson/jobs/Platform/workspace/trunk/client-plugin/pom.xml
[HUDSON] Archiving /usr/local/hudson/.hudson/jobs/Platform/workspace/trunk/client-plugin/target/client-plugin-0.8.19-SNAPSHOT.jar
[HUDSON] Archiving /usr/local/hudson/.hudson/jobs/Platform/workspace/trunk/client-plugin/target/client- plugin-0.8.19-SNAPSHOT-sources.jar
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Test reports were found but none of them are new. Did tests run?
For example, /usr/local/hudson/.hudson/jobs/Platform/workspace/trunk/client-plugin/target/surefire-reports/TEST-net.mobio.qname.LocalNameMapTest.xml is 2 seconds old

[INFO] ------------------------------------------------------------------------
[INFO] Trace
hudson.tasks.junit.AbortException: Test reports were found but none of them are new. Did tests run?
For example, /usr/local/hudson/.hudson/jobs/Platform/workspace/trunk/client-plugin/target/surefire-reports/TEST-net.mobio.qname.LocalNameMapTest.xml is 2 seconds old

at hudson.tasks.junit.TestResult.<init>( TestResult.java:90)
at hudson.maven.reporters.SurefireArchiver.postExecute(SurefireArchiver.java:68)
at hudson.maven.MavenBuild$Builder.postExecute(MavenBuild.java:181)
at hudson.maven.MavenBuilder$Adapter.postExecute (MavenBuilder.java:181)

Shouldn't hudson detect that unit tests ran and use those report files? Let me know if more clarification is necessary.

Regards,
Lars


Date: Thu, 23 Aug 2007 18:33:16 -0700
From: Kohsuke Kawaguchi <[hidden email]>
Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg=sha1; boundary="------------ms060308010309080900040508"
Subject: problems with maven2 project and JUnit reports

Erik Ramfelt wrote:

> I found the problem with my setup (when copying the juint report files
> into the workspace using a shell script at start of the build). If the
> JUnit report last modified time is the same as the time the build
> started then the JUnit result archiver will not read the test reports.
> (The build is faster than 1 second)
>
> Perhaps the JUnit result archiver could check if the unit test report
> is equal or newer than the build time then it will import the test
> reports. ie if the report time is older than when the build started it
> will not read the report. Or is this a bad idea?
>
>
> My work around for this problem looks like this for the shell script:
> sleep 1
> cp /home/erik/coding/test/nunittests/reports/junit-report.xml .
> touch junit-report.xml

I added error margin in 1.133 so that if the time stamp of the file is
close enough, it will be recorded without an error. But if you copy a
file from elsewhere, you'd have to 'touch' it anyway to set a newer
timestamp.

'sleep 1' won't be necessary.

>
> regards
> //Erik
>
> On 8/21/07, Erik Ramfelt < [hidden email]> wrote:
>> I wonder if this is similar to a problem that Im seeing right now. Im
>> testing some simple behvaiour with the JUnit test publisher to see how
>> it behaves with different data (as data XSLT'ed from NUnit). Ive set
>> up a very simple JUnit report which is copied by the hudson job and
>> then evaluted by the test task.
>>
>> The first time I run it after Ive restarted the hudson (through
>> winstone) it works fine and the tests are reported properly. But the
>> next time I build, I get the above console output and the build fails
>> until I restart the winstone.
>>
>> I expected that the test task would read the junit report again iff
>> the file was updated in the build. But some how Hudson believes that
>> the file hasnt been updated. Or how does the test task determine if
>> the file is new and that it should read the results?
>>
>>
>> The shell script looks like this:
>> ------------------------------------------
>> date
>> ls -l
>> rm ./junit-report.xml
>> cp /home/erik/coding/test/nunittests/reports/junit-report.xml .
>> touch junit-report.xml
>> ls -l
>> sleep 61
>> date
>> ------------------------------------------
>>
>> The console output looks like this:
>> ------------------------------------------
>> started
>> [workspace] $ /bin/sh -xe /tmp/hudson65207.sh
>> + date
>> tis aug 21 14:34:50 CEST 2007
>> + ls -l
>> total 4
>> -rw-r--r-- 1 hudson hudson 1131 2007-08-21 14:30 junit-report.xml
>> + rm ./junit-report.xml
>> + cp /home/erik/coding/test/nunittests/reports/junit-report.xml .
>> + touch junit-report.xml
>> + ls -l
>> total 4
>> -rw-r--r-- 1 hudson hudson 1131 2007-08-21 14:34 junit-report.xml
>> + sleep 61
>> + date
>> tis aug 21 14:35:51 CEST 2007
>> Recording test results
>> Test reports were found but none of them are new. Did tests run? For
>> example, /home/hudson/./data/jobs/NUnit
>> tests/workspace/junit-report.xml is 0 seconds old
>>
>> finished: FAILURE
>> ------------------------------------------
>>
>>
>> The junit report looks like this:
>> ------------------------------------------
>> <?xml version="1.0" encoding="utf-8"?>
>> <testsuite name="UnitTests" time="0.404" tests="4" errors="" failures="1">
>> <testcase classname="UnitTests"

>> name="MainClassTest.TestPropertyValue" time="0.146">
>> </testcase>
>> <testcase classname="UnitTests"
>> name="MainClassTest.TestMethodUpdateValue" time="0.001">
>> </testcase>
>> <testcase classname="UnitTests" name="MainClassTest.TestFailure" time=" 0.092">
>> <failure><![CDATA[
>> MESSAGE: ]]><![CDATA[ Expected failure
>> Expected: 30
>> But was: 20
>> ]]><![CDATA[
>> +++++++++++++++++++
>> STACK TRACE: ]]><![CDATA[ at
>> UnitTests.MainClassTest.TestFailure () [0x00000]
>> at <0x00000> <unknown method>
>> at (wrapper managed-to-native)
>> System.Reflection.MonoMethod:InternalInvoke (object,object[])
>> at System.Reflection.MonoMethod.Invoke (System.Object obj,
>> BindingFlags invokeAttr, System.Reflection.Binder binder,
>> System.Object[] parameters, System.Globalization.CultureInfo culture)
>> [0x00000]
>> ]]></failure>
>> </testcase>
>> <testcase classname="UnitTests" name="" time=" 0.001">
>> </testcase>
>> </testsuite>
>> ------------------------------------------
>>
>> Regards
>> //Erik
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
Kohsuke Kawaguchi
Sun Microsystems [hidden email]



On 8/20/07, Lars Burgess <[hidden email]> wrote:
Sure thing, I've filed issue #751.

Cheers,
Lars

>Kohsuke Kawaguchi wrote:
>Thanks. I got the attachment. If I can ask you one more favor, if you

>could file an issue for this, that would be really appreciated.

On 8/20/07, Lars Burgess <[hidden email]> wrote:
Thanks for the reply. Actually I just tried the latest release (
1.130
) and my project is now not failing as it did in version 1.129.
Did something get fixed? Also, I went ahead and created a simple maven project so you can see how I'm running junit tests in the

integration-test phase. Let me know if the attachment didn't work and I can send it directly.


Cheers,
Lars


>Date: Sat, 18 Aug 2007 21:35:03 -0700
>From: Kohsuke Kawaguchi <[hidden email]>
>Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg=sha1; boundary="------------ms020600040909060209010905"
>Subject: problems with maven2 project and JUnit reports



>I noticed that you say your tests are run at integration-test phase, not 
>the usual test phase. Maybe that's related to this issue.

>How do you run Surefire as integration-test? Would it be possible for


>you to create a sample project (with a POM and a single test case) that
>reproduces this problem?

On 8/16/07, Lars Burgess <[hidden email]> wrote:
Hello,

I'm currently using hudson with several maven2 projects. After upgrading from version 1.126 to 1.129, all of the projects which run JUnit tests fail after the integration-test phase with the following message:

[HUDSON] Recording test results
[HUDSON] Archiving /usr/local/hudson/.hudson/jobs/Platform-Trunk/workspace/platform-trunk/client-plugin/pom.xml
[HUDSON] Archiving /usr/local/hudson/.hudson/jobs/Platform-Trunk/workspace/platform-trunk/client-plugin/target/client-


plugin-0.8.19-SNAPSHOT.jar
[HUDSON] Archiving /usr/local/hudson/.hudson/jobs/Platform-Trunk/workspace/platform-trunk/client-plugin/target/client-plugin-0.8.19-SNAPSHOT-sources.jar
[INFO] ------------------------------------------------------------------------



[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Test reports were found but none of them are new. Did tests run? For example, /usr/local/hudson/.hudson/jobs/Platform-Trunk/workspace/platform-trunk/client-plugin/target/surefire-reports/TEST-


net.mobio.qname.LocalNameMapTest.xml is 0 seconds old

[INFO] ------------------------------------------------------------------------
[INFO] Trace
hudson.tasks.junit.AbortException: Test reports were found but none of them are new. Did tests run? For example, /usr/local/hudson/.hudson/jobs/Platform-Trunk/workspace/platform-trunk/client-plugin/target/surefire-reports/TEST-


net.mobio.qname.LocalNameMapTest.xml is 0 seconds old

at hudson.tasks.junit.TestResult.<init>(TestResult.java:90)
at hudson.maven.reporters.SurefireArchiver.postExecute(SurefireArchiver.java:67)
at
hudson.maven.PluginManagerInterceptor.postExecute
(PluginManagerInterceptor.java:111)
at hudson.maven.agent.PluginManagerInterceptor$1MojoConfig.callPost(PluginManagerInterceptor.java:102)
at hudson.maven.agent.PluginManagerInterceptor.executeMojo

(PluginManagerInterceptor.java
:133)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:534)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle

(DefaultLifecycleExecutor.java
:475)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:454)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures

(DefaultLifecycleExecutor.java
:306)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute
(
DefaultLifecycleExecutor.java:140)

at org.apache.maven.lifecycle.LifecycleExecutorInterceptor.execute(LifecycleExecutorInterceptor.java:35)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java :327)

at org.apache.maven.DefaultMaven.execute
(DefaultMaven.java:120)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:263)
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:585)
at org.codehaus.classworlds.Launcher.launchEnhanced

(Launcher.java
:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at hudson.maven.agent.Main.launch(Main.java:89)
at hudson.maven.MavenBuild$Builder.call(MavenBuild.java:172)
at hudson.maven.MavenBuild$Builder.call


(MavenBuild.java:140)
at hudson.remoting.UserRequest.perform(UserRequest.java:69)
at hudson.remoting.UserRequest.perform(UserRequest.java:23)
at hudson.remoting.Request$2.run (Request.java:178)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask


(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run (Thread.java:595)
[INFO] ------------------------------------------------------------------------



[INFO] Total time: 25 seconds
[INFO] Finished at: Thu Aug 16 10:33:06 PDT 2007
[INFO] Final Memory: 12M/29M
[INFO] ------------------------------------------------------------------------
finished: FAILURE


I'm running "clean deploy" as my mvn targets. Is there something that I need to change in the latest versions?

Cheers,
Lars




Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problems with maven2 project and JUnit reports

Kohsuke Kawaguchi
Administrator

This issue was filed as #751 and fixed in 1.135.

Lars Burgess wrote:

> I still see the problem with 1.133. I think I've identified a few more
> symptoms. I have the following maven-surefire-plugin
> configuration in my base pom:
>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-surefire-plugin</artifactId>
> <configuration>
> <excludes>
> <exclude>**/integration/**</exclude>
> </excludes>
> </configuration>
> <executions>
> <execution>
> <id>surefire-it</id>
> <phase>integration-test</phase>
> <goals>
> <goal>test</goal>
> </goals>
> <configuration>
> <excludes>
> <exclude>**/*.bin</exclude>
> <exclude>**/*.txt</exclude>
> <exclude>**/*.xml</exclude>
> </excludes>
> <includes>
> <include>**/integration/**</include>
> </includes>
> </configuration>
> </execution>
> </executions>
> </plugin>
>
> Now, this pom is inherited both by projects with and without
> integration tests. It appears that the projects which don't have
> integration tests are failing
> because hudson detects that no integration tests run, therefore
> throwing the following message (noted by the "surefire-it" execution
> below):
>
>
> [HUDSON] Recording test results
> [INFO] [jar:jar]
> [INFO] Building jar:
> /usr/local/hudson/.hudson/jobs/Platform/workspace/trunk/client-plugin/target/client-plugin-0.8.19-SNAPSHOT.jar
> [INFO] Preparing source:jar
> [WARNING] Removing: jar from forked lifecycle, to prevent recursive invocation.
> [INFO] No goals needed for project - skipping
> [INFO] [source:jar {execution: default}]
> [INFO] Building jar:
> /usr/local/hudson/.hudson/jobs/Platform/workspace/trunk/client-plugin/target/client-plugin-0.8.19-SNAPSHOT-sources.jar
> [INFO] [surefire:test {execution: surefire-it}]
> [INFO] Surefire report directory:
> /usr/local/hudson/.hudson/jobs/Platform/workspace/trunk/client-plugin/target/surefire-reports
>
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> There are no tests to run.
>
> Results :
>
> Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
>
> [HUDSON] Recording test results
> [HUDSON] Archiving
> /usr/local/hudson/.hudson/jobs/Platform/workspace/trunk/client-plugin/pom.xml
> [HUDSON] Archiving
> /usr/local/hudson/.hudson/jobs/Platform/workspace/trunk/client-plugin/target/client-plugin-0.8.19-SNAPSHOT.jar
> [HUDSON] Archiving
> /usr/local/hudson/.hudson/jobs/Platform/workspace/trunk/client-plugin/target/client-plugin-0.8.19-SNAPSHOT-sources.jar
> [INFO] ------------------------------------------------------------------------
> [ERROR] FATAL ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] Test reports were found but none of them are new. Did tests run?
> For example, /usr/local/hudson/.hudson/jobs/Platform/workspace/trunk/client-plugin/target/surefire-reports/TEST-net.mobio.qname.LocalNameMapTest.xml
> is 2 seconds old
>
> [INFO] ------------------------------------------------------------------------
> [INFO] Trace
> hudson.tasks.junit.AbortException: Test reports were found but none of
> them are new. Did tests run?
> For example, /usr/local/hudson/.hudson/jobs/Platform/workspace/trunk/client-plugin/target/surefire-reports/TEST-net.mobio.qname.LocalNameMapTest.xml
> is 2 seconds old
>
> at hudson.tasks.junit.TestResult.<init>(TestResult.java:90)
> at hudson.maven.reporters.SurefireArchiver.postExecute(SurefireArchiver.java:68)
> at hudson.maven.MavenBuild$Builder.postExecute(MavenBuild.java:181)
> at hudson.maven.MavenBuilder$Adapter.postExecute(MavenBuilder.java:181)
>
> Shouldn't hudson detect that unit tests ran and use those report
> files? Let me know if more clarification is necessary.
>
> Regards,
> Lars
>
>
> Date: Thu, 23 Aug 2007 18:33:16 -0700
> From: Kohsuke Kawaguchi <[hidden email]>
> Content-Type: multipart/signed;
> protocol="application/x-pkcs7-signature"; micalg=sha1;
> boundary="------------ms060308010309080900040508"
> Subject: problems with maven2 project and JUnit reports
>
> Erik Ramfelt wrote:
>> I found the problem with my setup (when copying the juint report files
>> into the workspace using a shell script at start of the build). If the
>> JUnit report last modified time is the same as the time the build
>> started then the JUnit result archiver will not read the test reports.
>> (The build is faster than 1 second)
>>
>> Perhaps the JUnit result archiver could check if the unit test report
>> is equal or newer than the build time then it will import the test
>> reports. ie if the report time is older than when the build started it
>> will not read the report. Or is this a bad idea?
>>
>>
>> My work around for this problem looks like this for the shell script:
>> sleep 1
>> cp /home/erik/coding/test/nunittests/reports/junit-report.xml .
>> touch junit-report.xml
>
> I added error margin in 1.133 so that if the time stamp of the file is
> close enough, it will be recorded without an error. But if you copy a
> file from elsewhere, you'd have to 'touch' it anyway to set a newer
> timestamp.
>
> 'sleep 1' won't be necessary.
>
>>
>> regards
>> //Erik
>>
>> On 8/21/07, Erik Ramfelt <[hidden email]> wrote:
>>> I wonder if this is similar to a problem that Im seeing right now. Im
>>> testing some simple behvaiour with the JUnit test publisher to see how
>>> it behaves with different data (as data XSLT'ed from NUnit). Ive set
>>> up a very simple JUnit report which is copied by the hudson job and
>>> then evaluted by the test task.
>>>
>>> The first time I run it after Ive restarted the hudson (through
>>> winstone) it works fine and the tests are reported properly. But the
>>> next time I build, I get the above console output and the build fails
>>> until I restart the winstone.
>>>
>>> I expected that the test task would read the junit report again iff
>>> the file was updated in the build. But some how Hudson believes that
>>> the file hasnt been updated. Or how does the test task determine if
>>> the file is new and that it should read the results?
>>>
>>>
>>> The shell script looks like this:
>>> ------------------------------------------
>>> date
>>> ls -l
>>> rm ./junit-report.xml
>>> cp /home/erik/coding/test/nunittests/reports/junit-report.xml .
>>> touch junit-report.xml
>>> ls -l
>>> sleep 61
>>> date
>>> ------------------------------------------
>>>
>>> The console output looks like this:
>>> ------------------------------------------
>>> started
>>> [workspace] $ /bin/sh -xe /tmp/hudson65207.sh
>>> + date
>>> tis aug 21 14:34:50 CEST 2007
>>> + ls -l
>>> total 4
>>> -rw-r--r-- 1 hudson hudson 1131 2007-08-21 14:30 junit-report.xml
>>> + rm ./junit-report.xml
>>> + cp /home/erik/coding/test/nunittests/reports/junit-report.xml .
>>> + touch junit-report.xml
>>> + ls -l
>>> total 4
>>> -rw-r--r-- 1 hudson hudson 1131 2007-08-21 14:34 junit-report.xml
>>> + sleep 61
>>> + date
>>> tis aug 21 14:35:51 CEST 2007
>>> Recording test results
>>> Test reports were found but none of them are new. Did tests run? For
>>> example, /home/hudson/./data/jobs/NUnit
>>> tests/workspace/junit-report.xml is 0 seconds old
>>>
>>> finished: FAILURE
>>> ------------------------------------------
>>>
>>>
>>> The junit report looks like this:
>>> ------------------------------------------
>>> <?xml version="1.0" encoding="utf-8"?>
>>> <testsuite name="UnitTests" time="0.404" tests="4" errors="" failures="1">
>>>   <testcase classname="UnitTests"
>>> name="MainClassTest.TestPropertyValue" time="0.146">
>>>   </testcase>
>>>   <testcase classname="UnitTests"
>>> name="MainClassTest.TestMethodUpdateValue" time="0.001">
>>>   </testcase>
>>>   <testcase classname="UnitTests" name="MainClassTest.TestFailure"
> time="0.092">
>>>     <failure><![CDATA[
>>>                             MESSAGE: ]]><![CDATA[  Expected failure
>>>   Expected: 30
>>>   But was:  20
>>> ]]><![CDATA[
>>>                             +++++++++++++++++++
>>>                             STACK TRACE: ]]><![CDATA[  at
>>> UnitTests.MainClassTest.TestFailure () [0x00000]
>>>   at <0x00000> <unknown method>
>>>   at (wrapper managed-to-native)
>>> System.Reflection.MonoMethod:InternalInvoke (object,object[])
>>>   at System.Reflection.MonoMethod.Invoke (System.Object obj,
>>> BindingFlags invokeAttr, System.Reflection.Binder binder,
>>> System.Object[] parameters, System.Globalization.CultureInfo culture)
>>> [0x00000]
>>> ]]></failure>
>>>   </testcase>
>>>   <testcase classname="UnitTests" name="" time="0.001">
>>>   </testcase>
>>> </testsuite>
>>> ------------------------------------------
>>>
>>> Regards
>>> //Erik
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
>

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment
Loading...