maven

2015-07-07 17 views
5

ile junit plug-in testleri için kod kapsamı Aşağıda, ürün birim testlerim için maste pom dosya profilim bulunuyor. Cip takma testlerimiz var. Bu pom dosya yapılandırmaları bana herhangi bir yerde jacoco kod kapsama dosyasını (.exec) vermiyor. Lütfen herhangi bir yerde yanlış varsa bana yardım edin. Teşekkür ederizmaven

<profile> 
     <id>unit-tests</id> 
     <modules> 
      <module>../../../test/com.xxxx.tools.comms.test.utilities</module> 

      <!-- product related unit tests 
      <module>../../../test/com.xxxx.comms.product.test</module> 
      <module>../../../test/com.xxxx.comms.product.mas.test</module>--> 
      <module>../../../test/com.xxxx.comms.product.iv.test</module> 
     </modules> 

     <properties> 
      <!-- Properties to enable jacoco code coverage analysis --> 
      <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin> 
      <sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis> 
     </properties> 

     <build> 
      <plugins> 
       <plugin> 
        <groupId>org.jacoco</groupId> 
        <artifactId>jacoco-maven-plugin</artifactId> 
        <version>0.7.2.201409121644</version> 
        <configuration> 
         <!-- Where to put jacoco coverage report --> 
         <destFile>C:/Userdata/product/GIT/Team/coverage/product1/jacoco/12.exec</destFile> 
        </configuration> 
        <executions> 
         <execution> 
          <id>jacoco-initialize</id> 
          <goals> 
           <goal>prepare-agent</goal> 
          </goals> 

         </execution> 
         <execution> 
          <id>jacoco-site</id> 
          <phase>package</phase> 
          <goals> 
           <goal>report</goal> 
          </goals> 
         </execution> 
        </executions> 
       </plugin> 
      </plugins> 
     </build> 
    </profile> 


<build> 
     <plugins> 
      <!-- Use of Tycho --> 
      <plugin> 
       <groupId>org.eclipse.tycho</groupId> 
       <artifactId>tycho-maven-plugin</artifactId> 
       <version>${tycho-version}</version> 
       <extensions>true</extensions> 
      </plugin> 

      <plugin> 
       <groupId>org.eclipse.tycho</groupId> 
       <artifactId>tycho-surefire-plugin</artifactId> 
       <version>${tycho-version}</version> 
       <configuration> 
        <includes> 
         <include>**/Tests*.java,**/*Tests.java,**/*TestCase.java,**/Test*.java,**/*Test.java</include> 
        </includes> 
        <argLine>${argLine}</argLine> 
        <useUIHarness>true</useUIHarness> 
        <!-- Kill test JVM if tests take more than 1 minute to finish --> 
        <forkedProcessTimeoutInSeconds>600</forkedProcessTimeoutInSeconds> 
        <testFailureIgnore>true</testFailureIgnore> 
       </configuration> 

      </plugin> 

      <!-- Configuration of target platforms --> 
      <plugin> 
       <groupId>org.eclipse.tycho</groupId> 
       <artifactId>target-platform-configuration</artifactId> 
       <version>${tycho-version}</version> 
       <configuration> 
        <pomDependencies>consider</pomDependencies> 
        <resolver>p2</resolver> 
        <environments> 
         <environment> 
          <os>win32</os> 
          <ws>win32</ws> 
          <arch>x86</arch> 
         </environment> 
        </environments> 
       </configuration> 
      </plugin> 

     </plugins> 

     <pluginManagement> 
      <plugins> 
       <plugin> 
        <groupId>org.eclipse.tycho</groupId> 
        <artifactId>tycho-packaging-plugin</artifactId> 
        <version>${tycho-version}</version> 
        <configuration> 
         <!-- workaround for TYCHO-349 or TYCHO-313 --> 
         <strictVersions>false</strictVersions> 
        </configuration> 
       </plugin> 

       <plugin> 
        <groupId>org.eclipse.tycho</groupId> 
        <artifactId>tycho-compiler-plugin</artifactId> 
        <version>${tycho-version}</version> 
        <configuration> 
         <source>${jdk.version}</source> 
         <target>${jdk.version}</target> 
        </configuration> 
       </plugin> 

      </plugins> 
     </pluginManagement> 
    </build> 
+0

Sizin kesin konfigürasyonunuz nedir? Jacoco ajanını etkinleştirmek için çatal bıçakla en iyi şekilde konfigüre etmelisiniz. – SpaceTrucker

+0

yukarıda eklenmiş eklenti yapılandırmamı bulabilirsiniz. Ama bunu varsayılan olarak çatalın doğru olduğunu ve forkCount = 1 –

+0

olduğunu görüyorum Ana suçlu sanırım tycho-surefire pugin kullanıyor. İnternette bunun hakkında bazı bilgiler var, ama her zaman bir sürü şey gibi görünüyor. Bunlara bir göz atabilirsiniz: https://intellectualcramps.wordpress.com/2012/03/22/jacoco-tycho-and-coverage-reports/, http://stackoverflow.com/questions/8944223/how-do -i-make-jenkins-sonar-ve-jacoco-eklenti-birlikte-tutulması-tutulması-tyc, http://mdwhatever.free.fr/index.php/2011/09/quality-analysis-on -eclipse-eklentileri-tycho-sonar-jacoco-ve-swtbot /, https://github.com/SonarSource/sonar-examples/tree/master/projects/tycho – SpaceTrucker

cevap

1

Sorun kaynağım var.
Suçlu, tycho-surefire-plugin yapılandırmasında <argLine> parametresidir.
Bu param varsa, jacoco dosyası oluşturulmaz. Onu kaldırdım ve şimdi .exec dosyası oluşturuldu.
Daha fazla bilgi bulunabilir tycho-surefire argLine causes no jacaco.exec