Quantcast

maven-osgi-test-plugin Test Suite build failure

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

maven-osgi-test-plugin Test Suite build failure

hoshang.varshney
This post has NOT been accepted by the mailing list yet.
Hi
I am trying to run Plugin UI test cases (written using WindowTester). I have used tycho to generate POMs for the source projects, test cases & test suite. I am able to run the test cases using m2eclipse plugin in Eclipse but not from command line. Both ways, I have maven 3.0. beta2 as maven version. I am getting the following error


[ERROR] Failed to execute goal org.sonatype.tycho:maven-osgi-test-plugin:0.9.0:t
est (default-test) on project com.abcd.soa.test.suite: There are test failures.

Please refer to C:\ws_hari\com.abcd.soa.test.suite\target\surefire-reports for t
he individual test results.
-> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o
rg.sonatype.tycho:maven-osgi-test-plugin:0.9.0:test (default-test) on project co
m.abcd.soa.test.suite: There are test failures.

Please refer to C:\ws_hari\com.abcd.soa.test.suite\target\surefire-reports for t
he individual test results.
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:148)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:87)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:79)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:86)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:58)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu
ild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:252)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:100)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:443)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:166)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:130)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
352)
Caused by: org.apache.maven.plugin.MojoFailureException: There are test failures
.

Please refer to C:\ws_hari\com.abcd.soa.test.suite\target\surefire-reports for t
he individual test results.
        at org.codehaus.tycho.osgitest.TestMojo.execute(TestMojo.java:391)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
BuildPluginManager.java:110)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:144)
        ... 19 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureExc
eption
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command

[ERROR]   mvn <goals> -rf :com.abcd.soa.test.suite


My Test Suite POM is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <artifactId>ws_hari</artifactId>
    <groupId>com.abcd.tools.soa</groupId>
    <version>0.0.1-SNAPSHOT</version>
  </parent>
  <groupId>com.abcd.tools.soa</groupId>
  <artifactId>com.abcd.soa.test.suite</artifactId>
  <version>1.0.0</version>
  <packaging>eclipse-test-plugin</packaging>
<build> 
<testSourceDirectory>src</testSourceDirectory> 
<plugins> 
<plugin> 
<groupId>org.sonatype.tycho</groupId> 
<artifactId>maven-osgi-test-plugin</artifactId> 
<version>0.9.0</version> 
<configuration> 
<argLine>-Xmx512M</argLine> 
<useUIHarness>true</useUIHarness> 
<useUIThread>true</useUIThread> 
<testSuite>com.abcd.soa.test.suite</testSuite> 
<testClass>com.abcd.soa.test.suite.AllTests</testClass> 
</configuration> 
</plugin> 
</plugins> 
</build>
<dependencies>
        <dependency>
                <groupId>com.abcd.tools.soa</groupId>
                <artifactId>com.abcd.soa.ui.tests</artifactId>
                <version>1.0.0</version>
               
        </dependency>
</dependencies>

</project>

Any more info required, please specify!
I found the same error on this forum at this link http://software.2206966.n2.nabble.com/maven-osgi-test-plugin-Test-Suite-does-not-run-td4962750.html
But the solution doesn't apply in my case (as there are no typos)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: maven-osgi-test-plugin Test Suite build failure

tychotychonofuba
In fact (but i am not a tycho-guru) that tests where executed, but one of them failed.
Maven/Tycho tell you that you can see the surefire-reports by following this path :
C:\ws_hari\com.abcd.soa.test.suite\target\surefire-reports.
It will be some kind of xml's files, and .txt files describing the problem.

But i actually experience the same problem. If one test fail i don't know how to tell tycho to continue the test cycle. I believe that the classic behavior of tycho is to stop runing  if a testCase fail, and i think it could be your problem too. If i remember i found somethings about it on Internet. If i find it back i will tell you.

I you think it's the same problem for you, the first one who solved the problem tell the other one how to solve it ;)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: maven-osgi-test-plugin Test Suite build failure

Tobias Oberlies
The -fae option should work: http://www.sonatype.com/books/mvnref-book/reference/writing-plugins-sect-failure.html

Please ask future questions on the new mailing list: [hidden email]

Regards
Tobias

> -----Original Message-----
> From: tychotychonofuba [mailto:[hidden email]]
> Sent: 08 April 2011 12:17
> To: [hidden email]
> Subject: [Tycho Users] Re: maven-osgi-test-plugin Test Suite build failure
>
> In fact (but i am not a tycho-guru) that tests where executed, but one of
> them failed.
> Maven/Tycho tell you that you can see the surefire-reports by following
> this
> path :
> C:\ws_hari\com.abcd.soa.test.suite\target\surefire-reports.
> It will be some kind of xml's files, and .txt files describing the
> problem.
>
> But i actually experience the same problem. If one test fail i don't know
> how to tell tycho to continue the test cycle. I believe that the classic
> behavior of tycho is to stop runing  if a testCase fail, and i think it
> could be your problem too. If i remember i found somethings about it on
> Internet. If i find it back i will tell you.
>
> I you think it's the same problem for you, the first one who solved the
> problem tell the other one how to solve it ;)
>
>
> --
> View this message in context: http://software.2206966.n2.nabble.com/maven-
> osgi-test-plugin-Test-Suite-build-failure-tp6213771p6253162.html
> Sent from the Tycho Users mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: maven-osgi-test-plugin Test Suite build failure

tychotychonofuba
Here are my answers :

    1) What do you need to configure on the maven-osgi-test-plugin? Tests are automatically executed if the packaging type is eclipse-test-plugin.


I try your solution, but sadly in fact if I don't put in the build-section of the parent pom a reference to the maven-osgi-test-plugin i don't have any reports of my tests (In normal time, they are in surefire-report a folder created inside each target folder). Maybe I forgot something ?
 


    2) In all projects I use, the .target file is contained in a separate Eclipse project. Do you have any experience with the Tycho build if the .target file is contained in any of the source projects? Where do you usually store the .target file?


Our target file is inside a project named release with all the configurations files to work with headless build. I let you see below the complete description of my actual workflow.

1) First I checkout a project named "release" which contains:
- the psf files (team project set eclipse file) which contain the list of all required projects and their source locations (SVN or CVS).
- a build-automation directory containing:
   - Ant4eclipse libraries required to parse and checkout project from .psf files
   - the ws directory where the real projects will be checkout and compiled and in which we already have a pseudo project "target.platform" that describes the target platform to use to build our product

Here is the description of the tree:
 [-] release
  |  [-] build-automation
  |   |   [-] Ant4eclipse
  |   |   [-] ws
  |   |     |  [-] target.platform
  |   |     |      -f- pom.xml
  |   |     |      -f- mytargetfile.target  
  |   |    -f- build.xml
  |  -f- projects-cvs.psf
  |  -f- projects-svn.psf

2) I use Ant4eclipse in an Ant task (build.xml) to parse the psf and checkout (with antSvn or antCvs ) all the needed projects into the build-automation/ws folder

3) I use generate-poms target in order to create the parent pom and all the children pom.xml files for each checked out projects.

4) Then I want to configure Tycho to use the  .target file (inside ws/target.platform/mytargetfile.target) to build my projects.
In order to do that, I found out (looking at how m2eclipse project uses Tycho) that I needed to add the following lines to the parent pom (generated during step 3) :
  <plugin>
       <groupId>org.sonatype.tycho</groupId>
       <artifactId>target-platform-configuration</artifactId>
       <version>0.10.0</version>
       <configuration>
          <resolver>p2</resolver>
          <target>
            <artifact>
                <groupId>[...]</groupId>
                <artifactId>target-platform</artifactId>
                <version>0.0.1-SNAPSHOT</version>
                <classifier>mytargetfile</classifier>                 
            </artifact>
          </target>
          <ignoreTychoRepositories>true</ignoreTychoRepositories>
       </configuration>
  </plugin>
 
Whitout those lines, creation of the target platform automatically fail.

5) I also need to add to configure testing:
<plugin>
         <groupId>org.sonatype.tycho</groupId>
         <artifactId>maven-osgi-test-plugin</artifactId>
         <version>0.10.0</version>
 </plugin>
Whitout there is no sure-fire report folder in targets subfolder of the test-projects. So the test doesnt export any result.
 

6) After that i can start compiling my sources, running osgi test, and export the result to sonar for reporting.

My main problem is having to edit the parent pom during the step 4). Mattias Holmqvist and Igor Fedorenko seems to use generate-poms only initially, but i can't do that because we define the projects
in project team set files (psf) so i need to work with the psf in order to be up2date with the project.
 

Thanks for the quick answer.
Hope i will be in the good mailing list this time ;)
Regards
Loading...