Configuring database location for integration tests

Hello,

I try to run clover for both integration tests and unit tests. The integration tests are in a seperate module and run after the module of the source code.

I configured in the pom properties the location of the clover.db file and in the clover-report the location of the source file.

1. Does the clover.db contains only source file information or coverage information as well? If it should contain coverage information, how to configure clover to produce clover.db file for module with source files located in another module?

2. At the end of run I get the message: "Processed 0 test case results from 13 results files"

Why it doesn't locate the test file?

Thanks for support.

Nava Polak Onik.

HP.

2 answers

1 accepted

Accepted Answer
0 votes

Hi Nava,

Does the clover.db contains only source file information or coverage information as well?

The Clover Database (clover.db) contains information about code structure (packages, files, classes, methods, statements etc). It does not keep coverage information - coverage is stored in separate files which are named like:

  • clover.db<some_hash>, clover.db<some_hash>.1 - they contain global coverage data
  • clover.db<even_longer_hash>.s - they contain per-test coverage data

More details here: CLOVER/Managing+the+Coverage+Database

When rendering an HTML report, Clover reads content of source files from location(s) as was found during instrumentation. You can point to different source location by using <clover-report>/<sourcepath> (for Ant).

How to configure clover to produce clover.db file for module with source files located in another module?

I don't think that it's necessary, actually. You can either:

  • instrument every module separately (thus creating separate clover.db files for each module) or
  • use a single database for all modules (the <singleCloverDatabase> parameter for clover2:setup)

Next you have to run your code ensuring that all instrumented classes are able to find their corresponding databases. How to achieve this depends on your project and environment setup, there are plenty options available. See the "Decision Matrix" on CLOVER/Using+Clover+in+various+environment+configurations page.

At the end of run I get the message: "Processed 0 test case results from 13 results files". Why it doesn't locate the test file?

I would need more details to answer this question. The most probably it just did not found a corresponding test class in the Clover Database (clover.db). For instance, in case when you've used wrong clover.db for reporting. Or in case when your integration tests are not compatible with JUnit/TestNG and test names (in test reports in XML files) do not contain information about test class.

Feel free to create a support ticket at: support.atlassian.com(attaching your pom.xml, build logs, Clover databases, Clover report etc). I'll be happy to investigate it further.

Cheers
Marek

Thank you, I configured a single database and it worked fine for me.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday in Featured Groups

Tuesday tips & tricks: What is the Atlassian Community?

It's officially Tuesday, which means it's officially time for another tip to help you better navigate this space we call the Atlassian Community. 😄 I got a great question from community member, Sa...

127 views 6 8
View post

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