Why clover cannot correlate test with previously executed test method.

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

This widget could not be displayed.

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
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in Teamwork

What teamwork quotes inspire you?

Hey everyone! My name is Natalie and I'm an editor of the Atlassian Blog and I've got a question for you: What's your favorite quote about teamwork?  We've compiled a list here, along with...

196 views 18 7
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you