I was able to generate a report with per-test mapping for my functional tests, but the snapshot printer does not reflect this mapping.
Am referring to https://community.atlassian.com/t5/Clover-questions/Is-there-a-supported-way-to-extract-the-source-file-to-relevant/qaq-p/301804 where I had seen it working. The snapshot printer gave "All files" section and "Hitting tests" which listed each source file being hit by its respective test cases.
I do not see it happening anymore. Am using a merged database to snapshot. The sections exist but under "All files" I see test java file names instead of product java file names. In fact, in the entire snapshot printer output, I do not see a single source code file names at all. All file names are just test names. Am using clover-4.4.1.jar for all my operations.
Has anything changed or am I missing something obvious @Marek Parfianowicz ?
1. As a first step please check if Clover correctly recognised your application and test classes. In the HTML report you shall see all business logic on the 'Application code' tab and all test classes on the 'Test code' tab.
2. Next, please check if you correctly collected per-test code coverage data. In the HTML report, pick few classes and check if you have correct tests listed in the 'Tests hitting this class' dialog.
3. Also please check if you don't have too many tests failing. The reason is that by default Clover discards per-test code coverage from failed tests. You can change this setting, however. See 'includeFailedTestCoverage' option for <clover-report> (an Ant task) or clover:clover (Maven goal).
Once everything is OK, please try check how the clover:snapshot works.
4. Try to create coverage snapshots from individual modules, i.e. skip the database merge step. Do you see correct content there? If not, maybe coverage recording files are missing? They're usually named clover.db<some_hash> and clover.db<some_long_hash>.s
5. Finally, please test the merge task. Ensure you've provided all clover.db database files and coverage recording files.
Step 4 was the clue.
Seems that the issue is due to the below TAG in my pom.xml
Since I was giving a different path for test clover database, the clover:snapshot goal was not taking the command line override (neither -Dmaven.clover.cloverMergeDatabase nor -Dmaven.clover.cloverDatabase helped) to specify the merged database to be snapshotted.
To workaround the problem, I have created a local variable in pom and using that to override. During clover:merge and clover:clover, I do not pass the override and hence the report is generated correctly. During clover:snapshot, I pass the override and point it to the merged database.
Accepting this as answer since it led me to it.
The most frequent issues are:
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...
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