-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Managed container doesn't generate JaCoCo's coverage report #21
Comments
Could you provide a complete example with some java code? How do you run this? |
I have the same issue and found a cause. If you set the argline property of the failsafe-plugin it doesn't work anymore otherwise the coverage is fully available. @aslakknutsen If you want I can upload my showcase project. |
My team is also facing a similar issue. |
@sventorben Finally I have found a solution to get it working. See my linked repository. https://github.com/CSchulz/arquillian-jacoco-showcase
|
@aslakknutsen @sventorben I think it works like expected, if you don't overwrite the argline of the failsafe-plugin. If you want to pass anything to the container (vm) you have to use the arquillian.xml and create there a property javaVmArguments. |
@CSchulz I've done what you said but it doesn't filled any coverage anyway :( @aslakknutsen follow below an quick example I created |
I'm also seeing something like this with a managed Tomcat 7 container. Can someone tell me how Arquillian and JaCoCo are supposed to integrate please? It looks like Arquillian is instrumenting everything offline before packaging everything up into my
section in my I'm also noticing that my Frankly, I have no idea what is going on here. |
Hmm, it looks like the |
OK, so I managed to get my coverage data after all. The steps were:
My Coverage Report in Jenkins still mentions classes that I believe I've excluded - although they all show 0% coverage now - but this must be close to the correct solution. |
I have the same problem, I got a jacoco.exec but no jacoco-it.exec" The difference to our project is:
Could it be the use of embedded wildfly container or is it because I use core 1.1.11 or.... Please note that I made the arquillian-jacoco-example work nicely for Wildfly 8.2.1 managed! |
Speaking as a user who has also beaten my head against the table to get this working...
What matters is the coverage data that has been dumped into your
My integrations tests also pass |
Well I created my Jacoco look like this: <plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${version.jacoco}</version>
<executions>
<execution>
<id>Jacoco-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>Jacoco-prepare-agent-integration</id>
<goals>
<goal>prepare-agent-integration</goal>
</goals>
<configuration>
<destFile>${project.build.directory}/jacoco-it.exec</destFile>
</configuration>
</execution>
</executions>
</plugin> I expected to find a jacoco.exec and a jacoco-it.exec in the target/ folder but only found the jacoco.exec! Note that the "javaVmArguments" only works when using managed container.. I have tried your suggestion, but when looking in the generated "site" it is clear that no "IT" classes is covered. |
So where do you execute the |
I tried a lot of combination but I stopped lokking for the right spot for the report generation when I found that the file wasn't genereated! <execution>
<id>jacoco-site</id>
<phase>verify</phase>
<goals>
<goal>report</goal>
<goal>report-integration</goal>
</goals>
</execution> Here is a snip form the maven output
|
I think this implies that JaCoCo isn't instrumenting your "IT" classes, which would suggest that your |
Tanks, I'll try to add the properties name and see what happens. I'm not sure that I have an answer to Day. |
Thanks again! Now I got the -it file (0 size) but now the Wildfly is stalling it might be something with the managementPort or ..... |
Sorry, but this is JIRA not StackOverflow, and the title of this particular issue is Managed container doesn't generate JaCoCo's coverage reportYou don't have a bug at all - all you have is a configuration issue with an embedded container and I have polluted this issue quite enough already. |
Hi, I hope that can help you : pom.xml with : <properties>
...
<version.arquillian.wildfly.managed>8.2.1.Final</version.arquillian.wildfly.managed>
<version.surefire.plugin>2.19.1</version.surefire.plugin>
<version.wildfly>10.1.0.Final</version.wildfly>
<version.dependency.plugin>2.10</version.dependency.plugin>
<version.jacoco>0.7.4.201502262128</version.jacoco>
<version.arquillian_jacoco>1.0.0.Alpha8</version.arquillian_jacoco>
...
</properties>
...
<profile>
<id>arquillian-wildfly-managed-jacoco</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>${version.dependency.plugin}</version>
<executions>
<execution>
<id>unpack</id>
<phase>process-test-classes</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-dist</artifactId>
<version>${version.wildfly}</version>
<type>zip</type>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${version.surefire.plugin}</version>
<configuration>
<skipTests>false</skipTests>
<systemPropertyVariables>
<arquillian.launch>arquillian-wildfly-managed</arquillian.launch>
<jacoco.agent>${jacoco.agent}</jacoco.agent>
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${version.jacoco}</version>
<executions>
<execution>
<id>jacoco-prepare</id>
<phase>validate</phase>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>jacoco-prepare-it</id>
<phase>validate</phase>
<goals>
<goal>prepare-agent-integration</goal>
</goals>
<configuration>
<propertyName>jacoco.agent</propertyName>
</configuration>
</execution>
<execution>
<id>jacoco-report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>jacoco-report-it</id>
<phase>post-integration-test</phase>
<goals>
<goal>report-integration</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-arquillian-container-managed</artifactId>
<version>${version.arquillian.wildfly.managed}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>org.jacoco.core</artifactId>
<version>${version.jacoco}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.extension</groupId>
<artifactId>arquillian-jacoco</artifactId>
<version>${version.arquillian_jacoco}</version>
<scope>test</scope>
</dependency>
</dependencies>
</profile> and arquillian.xml <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<arquillian xmlns="http://jboss.org/schema/arquillian" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
<container qualifier="arquillian-wildfly-remote"/>
<container qualifier="arquillian-wildfly-managed">
<configuration>
<property name="jbossHome">target/wildfly-10.1.0.Final</property>
<property name="javaVmArguments">-Xmx1024m -Xnoagent -Djava.compiler=NONE -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 ${jacoco.agent}</property>
<property name="allowConnectingToRunningServer">true</property>
</configuration>
</container>
</arquillian>
NOTE : With this you can see IT coverage only on Sonar : mvn test -Parquillian-wildfly-managed-jacoco -e
mvn org.sonarsource.scanner.maven:sonar-maven-plugin:3.1.1:sonar -e NOTE2 : Do not set another properties ${jacoco.agent} in pom.xml that will erase the properties of jacoco plugin. NOTE3 : NOTE2 => Make another profile for test in eclipse / idea or you will get this error :
Resultat in sonar :
|
Thanks guys for all the collaboration. We will make a |
@bartoszmajsak Any news about the howto? Perhaps a not finished one? |
Will get it here by the end of the week |
Sorry i can't find that howto. Any news? Thanks. |
Any update on how to ? |
is there any HowTo created? |
any updates on the howto? |
Arquillian runs nicely but integration tests aren't covered by report when managed container is used. Follow below my configurations:
The text was updated successfully, but these errors were encountered: