Skip to main content



      Home
Home » Eclipse Projects » RCP Testing Tool » Code coverage with JaCoCo Plugin (Jenkins)
Code coverage with JaCoCo Plugin (Jenkins) [message #1693182] Wed, 22 April 2015 05:59 Go to next message
Eclipse UserFriend
Hi!

How can I get code coverage information using Jenkins with the RCPTT Runner Maven plugin? I would like to use the Jenkins JaCoCo plugin:
https://wiki.jenkins-ci.org/display/JENKINS/JaCoCo+Plugin

But it needs information like this:

https://wiki.jenkins-ci.org/download/attachments/60918960/screenshot_039.png?version=1&modificationDate=1383160909000

Where can I get these informations?

Thanks
András

[Updated on: Wed, 22 April 2015 06:07] by Moderator

Re: Code coverage with JaCoCo Plugin (Jenkins) [message #1693188 is a reply to message #1693182] Wed, 22 April 2015 06:24 Go to previous messageGo to next message
Eclipse UserFriend
Hello,

This issue was already discussed here.
Quote:
I added the following argument to my launch configuration:

-javaagent:e:\RCPTT\Coverage\JacocoAgent\jacocoagent.jar=destfile=e:\RCPTT\Coverage\test.exec

When I start the AUT, the destination file is created and filled during the test. After execution, the file can be imported as coverage session to Eclipse/EclEmma to have the results in the known view in Eclipse.

Please try this and let me know if it helps!
Re: Code coverage with JaCoCo Plugin (Jenkins) [message #1693262 is a reply to message #1693188] Wed, 22 April 2015 13:54 Go to previous messageGo to next message
Eclipse UserFriend
Hi!

It is not working for me. The AUT is not launching for me. I get the following error message:
RCPTT: Failed to Launch AUT: IncQueryAUT cause Process was terminated while waiting for AUT startup data

My VM Arguments look like this:
-Dosgi.requiredJavaVersion=1.6 -Xms40m -Xmx512m -XX:MaxPermSize=128m -javaagent:c:\Development\Szakdolgozat\jacocoagent.jar=destfile=c:\Development\Szakdolgozat\test.exec

I copied jacocoagent.jar to that folder.

What can be the problem?
Re: Code coverage with JaCoCo Plugin (Jenkins) [message #1693455 is a reply to message #1693262] Fri, 24 April 2015 07:00 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

If you remove -javaagent:c:\Development\Szakdolgozat\jacocoagent.jar=destfile=c:\Development\Szakdolgozat\test.exec is AUT successfully launched?

Please attach AUT console.log.

I've downloaded archive from here http://www.eclemma.org/jacoco/ and extract the whole directory to /Users/olgayurchuk/codecoverage/ and now the following vm argument works fine for me:

-javaagent:/Users/olgayurchuk/codecoverage/jacoco-0.7.5-20150410.145015-6/lib/jacocoagent.jar=destfile=/Users/olgayurchuk/codecoverage/test.exec

[Updated on: Fri, 24 April 2015 07:05] by Moderator

Re: Code coverage with JaCoCo Plugin (Jenkins) [message #1693542 is a reply to message #1693455] Fri, 24 April 2015 17:32 Go to previous messageGo to next message
Eclipse UserFriend
Hi!

I'm configuring Jenkins on Linux.

I am using the maven plugin, my pom.xml looks like this:
<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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <!-- Change groupId, artifactId and version -->
  <artifactId>rcpttTests</artifactId>
  <groupId>IncQueryProject</groupId>
  <version>1.0.0</version>  
  <packaging>rcpttTest</packaging>

  <!-- Change properies below to your values -->
  <properties>
    <autPath>/usr/eclipse-IncQuery-AUT/</autPath>
    <runnerPath>/usr/rcptt.runner-incubation-1.5.6-N201504182315.zip</runnerPath>
  </properties>
  
  <build>
    <plugins>
      <plugin>
        <groupId>com.xored.ci4rcptt</groupId>
        <artifactId>ci4rcptt-maven-plugin</artifactId>
        <version>1.5.6-SNAPSHOT</version>
        <extensions>true</extensions>
        <configuration>
          <aut>
            <explicit>${autPath}</explicit>
			<vmArgs> 
				<vmArg>-javaagent:/usr/jacoco/lib/jacocoagent.jar=destfile=/usr/test/test.exec</vmArg>  
			</vmArgs> 
          </aut>
          <runner>
            <explicit>${runnerPath}</explicit>
          </runner>
        </configuration>
      </plugin>
    </plugins>
  </build>


  
  <pluginRepositories>
    <pluginRepository>
      <id>xored-releases</id>
      <name>Xored Maven repository</name>
      <url>http://maven.xored.com/nexus/content/repositories/ci4rcptt-snapshots/</url>
    </pluginRepository>
  </pluginRepositories>

</project>


Now, the test.exec file is created, but it contains nothing. It's an empty file.
I have added this file to "Path to exec files" as you can see in the picture in first comment, but no coverege data is generated. What is wrong with my configuration?

Thanks,
András
Re: Code coverage with JaCoCo Plugin (Jenkins) [message #1693724 is a reply to message #1693542] Mon, 27 April 2015 18:20 Go to previous messageGo to next message
Eclipse UserFriend
Can anyone help me? I still have the problem. Sad
Re: Code coverage with JaCoCo Plugin (Jenkins) [message #1694710 is a reply to message #1693724] Thu, 07 May 2015 05:54 Go to previous message
Eclipse UserFriend
Hi,

As I understand, you've already managed to run test project on Jenkins and get test results (HTML-report etc.). But when you tried to add JaCoCo agent to VMArguments of AUT, tests run successfully but test.exec with code coverage results was empty (Zero bytes). Please correct me if I'm wrong.

Could you please attach HTML report from your Jenkins server? Did any test pass there?

You've mentioned that you have an error
RCPTT: Failed to Launch AUT: IncQueryAUT cause Process was terminated while waiting for AUT startup data

Could you please attach AUT console log with that error. Is this problem reproducible on Jenkins or in IDE?

Did you try to open JaCoCo report with EclEmma Coverage View in Eclipse with AUT sources?

I've done the following steps and it worked fine for me:

  1. Install EclEmma to Eclipse from http://update.eclemma.org/
  2. Download JaCoCo agent from here http://www.eclemma.org/jacoco/
  3. Extract file to some folder (for me it was /Users/username/codecoverage/jacoco-0.7.5-20150410.145015-6/lib/jacocoagent.jar)
  4. Import, Build my AUT Project and Run (So I have valid project in Eclipse workspace)
  5. Added to pom the following lines:
              <aut>
              <explicit>/Users/username/Downloads/rcptt-gerrit-47289</explicit>
              <vmArgs>
              <vmArg>-javaagent:/Users/username/Downloads/jacoco-0.7.5-20150410.145015-6/lib/jacocoagent.jar=destfile=/Users/username/test.exec</vmArg>
              </vmArgs>
              </aut> 

  6. Run test job on Jenkins
  7. File -> Import -> Coverage Session -> Choose /Users/username/test.exec -> Select all sources
  8. See coverage details

Have you done the same steps? Please try and let me know what was the result.
Could you please attach test.exec after that?


[Updated on: Thu, 07 May 2015 05:54] by Moderator

Previous Topic:Error from plug-in: "org.eclipse.core.resources".
Next Topic:interaction with running script on AUT
Goto Forum:
  


Current Time: Fri Jun 20 16:47:44 EDT 2025

Powered by FUDForum. Page generated in 0.10676 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top