Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Why source file of the tested class covered by test can not be found in model.

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] Source file org/apache/hadoop/yarn/server/api/records/impl/pb/HeartbeatResponsePBImpl.java covered by test org.apache.hadoop.yarn.TestRecordFactory.testPbRecordFactory not found in model.

The test class and source of tested class are located in different modules. But I'm using clover configuration that is adjusted for multi-model projects. See below maven profile example.

This is only one example there are 36 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,

1) You wrote:

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

Have you tried to use the latest 3.1.7 version? And what do you exactly mean by statement that Clover 3.0.2 and maven-clover2-plugin 3.0.5 were used - different versions at the same time?

2) Does the HeartbeatResponsePBImpl.java file exist? Did you made some refactoring? A message like below:

Source file org/apache/hadoop/yarn/server/api/records/impl/pb/HeartbeatResponsePBImpl.java covered by test org.apache.hadoop.yarn.TestRecordFactory.testPbRecordFactory not found in model

is printed at DEBUG logging level and it means that some test case is/was related with an application class which does not exist anymore (or was not instrumented) - that's why it is not found in clover.db model.

In case of code refactoring it might be a normal behaviour, because optimization snaphsot is being updated incrementally during test runs, so after some period of time it can contain information about classes, which do not exist anymore.

I suggest the following:

  • remove the optimization snapshot file and execute full test run in order to get up-to-date snapshot
  • configure the <fullRunEvery> attribute and set some reasonable value (default: 10), depending on how intensive code refactoring you're making

Regards
Marek

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira

Jira Cloud Performance Improvements

Hello everyone, I am a product manager in the Jira Cloud team focused on making sure our customers have a delightful experience using our products. Towards that goal, one of the areas which is extr...

165 views 2 9
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you