Why clover cannot correlate test with previously executed test method.

Dmitry Suslov September 27, 2012

Hi,

I'm integrating Clover tests optimization feature into Hadoop core projects and have issue with some tests which are not optimized and included into each tests run with following messages:

[INFO] Including 'org/apache/hadoop/fs/TestFcLocalFsPermission.java' in the test run because Clover cannot correlate it with previously executed test method.

This is only one example there are 46 such classes.

The Clover version 3.0.2 and Maven clover plugin version 3.0.5 are used

What can be the cause of this issue?

Below is profile sample which is defined in parent maven pom :

<profile>

<id>clover.optimize</id>

<activation>

<activeByDefault>false</activeByDefault>

<property>

<name>clover.optimize</name>

</property>

</activation>

<properties>

<cloverLicenseLocation>${user.home}/.clover.license</cloverLicenseLocation>

<clover.snapshot>${project.basedir}/.clover/clover.snapshot</clover.snapshot>

</properties>

<build>

<plugins>

<plugin>

<groupId>com.atlassian.maven.plugins</groupId>

<artifactId>maven-clover2-plugin</artifactId>

<configuration>

<outputDirectory>${project.build.directory}/clover</outputDirectory>

<licenseLocation>${cloverLicenseLocation}</licenseLocation>

<snapshot>${clover.snapshot}</snapshot>

<includesAllSourceRoots>true</includesAllSourceRoots>

<singleCloverDatabase>true</singleCloverDatabase>

<instrumentation>method</instrumentation>

</configuration>

<executions>

<execution>

<id>clover</id>

<goals>

<goal>setup</goal>

<goal>optimize</goal>

<goal>snapshot</goal>

</goals>

</execution>

</executions>

</plugin>

<plugin>

<groupId>org.codehaus.mojo</groupId>

<artifactId>groovy-maven-plugin</artifactId>

<version>1.4</version>

<executions>

<execution>

<phase>process-test-classes</phase>

<goals>

<goal>execute</goal>

</goals>

<configuration>

<source>

def tests = project.properties['test'];

log.info("Tests to run: " + tests);

if (tests != null &amp;&amp; tests.length() == 0) {

log.info("No tests to run");

project.properties['skipTests'] = 'true';

}

</source>

</configuration>

</execution>

</executions>

</plugin>

</plugins>

</build>

</profile>


1 answer

0 votes
Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 8, 2012

Hi Dmitry

A debug message:

Including 'org/apache/hadoop/fs/TestFcLocalFsPermission.java' in the test run because Clover cannot correlate it with previously executed test method.

means that information about this test case has not been found in optimization snapshot (new test case?) and thus Clover decided to include it in tests.

Possible reasons:

1) You have run first build without Clover and next second build with -Pclover.optimize without cleaning a workspace. As a result, only a subset of classes was instrumented and registered in clover.db.

2) By default test optimization snapshot is recreated every 10 runs. The TestFcLocalFsPermission is a new class which was created after snapshot creation and as a consequence, snaphsot does not contain information about it.

Solution:

Deleting optimization snapshot and running full test should solve the problem.

Regards
Marek

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events