3 Replies Latest reply on Aug 24, 2011 6:06 AM by aslak

    Incorrect code coverage with Arquillian + Drone (WebDriver) + Jacoco

    vineet.reynolds

      I'm currently using Arquillian 1.0.0.CR2, with Arquillian Drone 1.0.0.CR1 (to inject WebDriver instances), and the Arquillian Jacoco extension v1.0.0.Alpha1.

       

      As one would correctly infer, my JUnit test classes are annotated with @RunAsClient, to allow Arquillian to inject WebDriver instances to be injected into my tests. The tests are run at the client, with the deployment occuring on a remote Glassfish instance, and I am using the Maven Failsafe plugin to run this in my build. This necessitates the Jacoco instrumentation and collection be done remotely on the server, with the coverage data being sent back to the client.

       

      Unfortunately, no coverage data is obtained at the client. I've noticed the following:

      • JacocoArchiveAppender succesfully adds the required archives as arquillian-jacoco.jar, to the deployed archive.
      • The ApplicationArchiveInstrumenter class also appears to successfully instrument the classes in the deployment.
      • The openStream method of the InstrumenterAsset class also appears to successfully instrument the classes. The Asset being instrumented however, is the locally available client classes in the surefire booter JAR file. None of these clients would evidently be exercised by the tests.
      • The createRuntime method of the StartCoverageData class does not appear to be executed. I've had to use remote debugging to verify this as no logger is used in the class, but I could be wrong.
      • The writeCoverageData method of  the ShutdownCoverageData does not appear to be executed.
      • The storeCoverageData method of the CoverageDataReceiver class also does not appear to be executed.

       

      Based on the above, I could only conclude that the Arquillian Jacoco extension does not produce the coverage data for remote deployments with locally executed tests. I would like to know if this is a limitation, or a bug?

       

      PS: My tests are bit complex, so I'd like to know if anyone requires a testcase to work with.