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

0 votes

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
Community showcase
Published 11 hours ago in Jira Ops

Jira Ops Early Access Program Update #1: Announcing our next feature and a new integration

Thanks for signing up for Jira Ops! I’m Matt Ryall, leader for the Jira Ops product team at Atlassian. Since this is a brand new product, we’ll be delivering improvements quickly and sharing updates...

158 views 0 5
Read article

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