You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "EJ Ciramella (JIRA)" <ji...@codehaus.org> on 2007/02/14 19:48:21 UTC

[jira] Created: (MNG-2826) Integration-test target runs integration tests twice

Integration-test target runs integration tests twice
----------------------------------------------------

                 Key: MNG-2826
                 URL: http://jira.codehaus.org/browse/MNG-2826
             Project: Maven 2
          Issue Type: Bug
          Components: Bootstrap & Build
    Affects Versions: 2.0.4
         Environment: Win XP
            Reporter: EJ Ciramella


So we have two types of tests, unit and integration.

What we've attempted to do is bind the integration-test lifecycle to the
"test" phase but ONLY run the *Utest.java tests when "integration-test"
was specified.

What happens is, by default, the "test" goal works fine, but when you
specify "integration-test" it runs the *Utest.java tests twice.

I'll attach the logs shortly...

Here's the important part from the log:

[INFO]
------------------------------------------------------------------------
----
[INFO] Building Reward Engine
[INFO]    task-segment: [integration-test]
[INFO]
------------------------------------------------------------------------
----
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [surefire:test]
[INFO] Surefire report directory:
E:\work\LTY-P000039\rewardEngine\..\reportsdirectory

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

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

[INFO] [jar:jar]
[INFO] Building jar:
E:\work\LTY-P000039\rewardEngine\target\rewardEngine-1.0-SNAPSHOT.jar
[INFO] Preparing javadoc:javadoc
[WARNING] Removing: javadoc from forked lifecycle, to prevent recursive
invocation.
[INFO] No goals needed for project - skipping
[INFO] [javadoc:javadoc {execution: default}]
39 warnings
[INFO] [surefire:test {execution: surefire-iTest}]
[INFO] Surefire report directory:
E:\work\LTY-P000039\rewardEngine\..\reportsdirectory

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running com.upromise.common.reward.RewardEngineITest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 24.123
sec

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

[INFO] [surefire:test {execution: surefire-iTest}]
[INFO] Surefire report directory:
E:\work\LTY-P000039\rewardEngine\..\reportsdirectory

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running com.upromise.common.reward.RewardEngineITest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 25.23
sec

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


Here are the details of my pom:

I'm having a problem binding our integration tests to the
integration-test lifecycle goal.
 
Can anyone explain why this would happen twice?
 
Here's my pom:
 
<?xml version="1.0" encoding="ISO-8859-1"?>
 
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>lty</groupId>
    <artifactId>app</artifactId>
    <version>1.0-SNAPSHOT</version>
  </parent>
  <artifactId>rewardEngine</artifactId>
  <packaging>jar</packaging>
  <version>1.0-SNAPSHOT</version>
  <description>Module to calculate rewards</description>
  <name>Reward Engine</name>
  <url>http://www.upromise.com</url>
  
 <build>
  <resources>
   <resource>
    <directory>src/main/resources</directory>
    <filtering>true</filtering>
   </resource>
  </resources>
  <plugins>
   <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <configuration>
     <reportsDirectory>../reportsdirectory</reportsDirectory>
     <systemProperties>
      <property>
       <name>common.properties</name>
       <value>${work.dir}/common.properties</value>
      </property>
      <property>
       <name>java.util.logging.config.file</name>
       <value>
        ${work.dir}/utils/src/main/conf/logging.properties</value>
      </property>
      <property>
       <name>rewardEngineITest.testData.file</name>
       <value>
 
${work.dir}/rewardEngine/src/test/resources/xml/RewardEngineITestData.xm
l</value>
      </property>
      <property>
       <name>rewardEngine.config.file</name>
       <value>
 
${work.dir}/rewardEngine/src/main/resources/xml/EngineConfiguration.xml<
/value>
      </property>
            </systemProperties>
     <includes>
      <include>**/*UTest.java</include>
     </includes>     
    </configuration>
   </plugin>
  </plugins>
 </build>
 <dependencies>
   
  <dependency>
    <groupId>lty</groupId>
    <artifactId>lty-model</artifactId>
    <version>1.0-SNAPSHOT</version>
  </dependency>
  
  <dependency>
   <groupId>lty</groupId>
   <artifactId>lty-utils</artifactId>
   <version>1.0-SNAPSHOT</version>
  </dependency>
  
 </dependencies>
 
 
 <profiles>
  <profile>
    <id>itest-blah</id>   
    <activation>
    <property>
     <name>rewardEngine.iTest</name>
    </property>
    </activation>
   <build>
    <plugins>
     <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-surefire-plugin</artifactId>
      <executions>   
       <execution>
        <id>surefire-iTest</id>
        <phase>integration-test</phase>
        <goals>
         <goal>test</goal>
        </goals>
        <configuration>
         <forkMode>pertest</forkMode>       
         <includes>
          <include>**/*ITest.java</include>
         </includes>
        </configuration>
       </execution>
      </executions>
     </plugin>
    </plugins>
   </build>
  </profile>
 </profiles> 
  
</project>



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (MNG-2826) Integration-test target runs integration tests twice

Posted by "Kenney Westerhof (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-2826?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kenney Westerhof closed MNG-2826.
---------------------------------

    Resolution: Won't Fix

This is not a bug nor an issue; this should've been asked on the users list.

what you're doing is declaring the surefire plugin's test goal again, when it is already defined
implicitly in the test phase.

If you have tests you do not want to execute during the normal test phase, you should exclude them
from the execution;

Define an <execution>, phase test, goal test, outside of the profile.
Add excludes to **/*ITest.java (inside a <configuration> tag in the <execution> tag) or whatever your integration test classes are.

Then update the execution for the integration test profile and add an includes there for **/*ITest.

Surefire will run twice, once in the test phase, once in the integration-test phase, but executing different
tests.



> Integration-test target runs integration tests twice
> ----------------------------------------------------
>
>                 Key: MNG-2826
>                 URL: http://jira.codehaus.org/browse/MNG-2826
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Bootstrap & Build
>    Affects Versions: 2.0.4
>         Environment: Win XP
>            Reporter: EJ Ciramella
>             Fix For: Reviewed Pending Version Assignment
>
>
> So we have two types of tests, unit and integration.
> What we've attempted to do is bind the integration-test lifecycle to the
> "test" phase but ONLY run the *Utest.java tests when "integration-test"
> was specified.
> What happens is, by default, the "test" goal works fine, but when you
> specify "integration-test" it runs the *Utest.java tests twice.
> I'll attach the logs shortly...
> Here's the important part from the log:
> [INFO]
> ------------------------------------------------------------------------
> ----
> [INFO] Building Reward Engine
> [INFO]    task-segment: [integration-test]
> [INFO]
> ------------------------------------------------------------------------
> ----
> [INFO] [resources:resources]
> [INFO] Using default encoding to copy filtered resources.
> [INFO] [compiler:compile]
> [INFO] Nothing to compile - all classes are up to date
> [INFO] [resources:testResources]
> [INFO] Using default encoding to copy filtered resources.
> [INFO] [compiler:testCompile]
> [INFO] Nothing to compile - all classes are up to date
> [INFO] [surefire:test]
> [INFO] Surefire report directory:
> E:\work\LTY-P000039\rewardEngine\..\reportsdirectory
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> There are no tests to run.
> Results :
> Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
> [INFO] [jar:jar]
> [INFO] Building jar:
> E:\work\LTY-P000039\rewardEngine\target\rewardEngine-1.0-SNAPSHOT.jar
> [INFO] Preparing javadoc:javadoc
> [WARNING] Removing: javadoc from forked lifecycle, to prevent recursive
> invocation.
> [INFO] No goals needed for project - skipping
> [INFO] [javadoc:javadoc {execution: default}]
> 39 warnings
> [INFO] [surefire:test {execution: surefire-iTest}]
> [INFO] Surefire report directory:
> E:\work\LTY-P000039\rewardEngine\..\reportsdirectory
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running com.upromise.common.reward.RewardEngineITest
> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 24.123
> sec
> Results :
> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
> [INFO] [surefire:test {execution: surefire-iTest}]
> [INFO] Surefire report directory:
> E:\work\LTY-P000039\rewardEngine\..\reportsdirectory
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running com.upromise.common.reward.RewardEngineITest
> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 25.23
> sec
> Results :
> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 
> Here are the details of my pom:
> I'm having a problem binding our integration tests to the
> integration-test lifecycle goal.
>  
> Can anyone explain why this would happen twice?
>  
> Here's my pom:
>  
> <?xml version="1.0" encoding="ISO-8859-1"?>
>  
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd">
>   <modelVersion>4.0.0</modelVersion>
>   <parent>
>     <groupId>lty</groupId>
>     <artifactId>app</artifactId>
>     <version>1.0-SNAPSHOT</version>
>   </parent>
>   <artifactId>rewardEngine</artifactId>
>   <packaging>jar</packaging>
>   <version>1.0-SNAPSHOT</version>
>   <description>Module to calculate rewards</description>
>   <name>Reward Engine</name>
>   <url>http://www.upromise.com</url>
>   
>  <build>
>   <resources>
>    <resource>
>     <directory>src/main/resources</directory>
>     <filtering>true</filtering>
>    </resource>
>   </resources>
>   <plugins>
>    <plugin>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-surefire-plugin</artifactId>
>     <configuration>
>      <reportsDirectory>../reportsdirectory</reportsDirectory>
>      <systemProperties>
>       <property>
>        <name>common.properties</name>
>        <value>${work.dir}/common.properties</value>
>       </property>
>       <property>
>        <name>java.util.logging.config.file</name>
>        <value>
>         ${work.dir}/utils/src/main/conf/logging.properties</value>
>       </property>
>       <property>
>        <name>rewardEngineITest.testData.file</name>
>        <value>
>  
> ${work.dir}/rewardEngine/src/test/resources/xml/RewardEngineITestData.xm
> l</value>
>       </property>
>       <property>
>        <name>rewardEngine.config.file</name>
>        <value>
>  
> ${work.dir}/rewardEngine/src/main/resources/xml/EngineConfiguration.xml<
> /value>
>       </property>
>             </systemProperties>
>      <includes>
>       <include>**/*UTest.java</include>
>      </includes>     
>     </configuration>
>    </plugin>
>   </plugins>
>  </build>
>  <dependencies>
>    
>   <dependency>
>     <groupId>lty</groupId>
>     <artifactId>lty-model</artifactId>
>     <version>1.0-SNAPSHOT</version>
>   </dependency>
>   
>   <dependency>
>    <groupId>lty</groupId>
>    <artifactId>lty-utils</artifactId>
>    <version>1.0-SNAPSHOT</version>
>   </dependency>
>   
>  </dependencies>
>  
>  
>  <profiles>
>   <profile>
>     <id>itest-blah</id>   
>     <activation>
>     <property>
>      <name>rewardEngine.iTest</name>
>     </property>
>     </activation>
>    <build>
>     <plugins>
>      <plugin>
>       <groupId>org.apache.maven.plugins</groupId>
>       <artifactId>maven-surefire-plugin</artifactId>
>       <executions>   
>        <execution>
>         <id>surefire-iTest</id>
>         <phase>integration-test</phase>
>         <goals>
>          <goal>test</goal>
>         </goals>
>         <configuration>
>          <forkMode>pertest</forkMode>       
>          <includes>
>           <include>**/*ITest.java</include>
>          </includes>
>         </configuration>
>        </execution>
>       </executions>
>      </plugin>
>     </plugins>
>    </build>
>   </profile>
>  </profiles> 
>   
> </project>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira