how to know source of coverage from html report

Hello,
I have a very similar situation as explained in this thread - 

https://answers.atlassian.com/questions/19140849

Our Jenkins server has a job to generate a cloverized build and after that another downstream job to run Junit tests.
After that:
I copy the instrumented jars onto my test host (For eg: TestHost A).
Configure the startup options for the tomcat to have the correct location by using initstring property.
Start tomcat
Then Jenkins runs Selenium Tests and RestApi tests for the application on TestHostA
After the tests have finished, for report generation, I run this command on TestHostA:
C:\clover>java -cp c:\clover\clover-4.0.2.jar com.atlassian.clover.reporters.html.HtmlReporter -i C:\clover_db\clover.db -o C:\clover_db\CloverJul22report
After the report is generated, when I check the Dashboard.html, its coverage numbers look exactly similar to the report for the Junit testcases
Another thing I observed on the command prompt is this error after issuing the report generation command:
ERROR: Failed to render syntax highlights for C:\smbufs1\build_myit\rbuild\bsmap
ps\dev\......The system cannot find the path specified)
This error has been reported I guess before, but I did not find any solution.
So now, my question is, in the report, how do I know that those numbers are from which kind of test - Junit, Selenium, RestAPI. Secondly, why are the report numbers same?
Even after the tests have finished, I see that the .1 files still being generated in the clover_db folder (Is that because the App is still running?)
Thanks,
Sunita

3 answers

0 votes

Hey Sunita, 

 

Clover measures code coverage from every tests which run and accessed application code in any way, in fact it can also measure manual tests, because of how it works. If you want to have separate metrics/reports for separate types of tests run (i.e. JUnit, Integration-Tests, RestAPI Tests) you have to run them in different/separate executions and generate separate reports for single execution time. This can be achieved i.e with configuration of maven-surefire-plugin. I've wrote about it a little bit more here, please refer to that comment. 

 

About the error you're getting. I can't be sure without stacktrace or logs, but please confirm that Clover has access to the application source codes in a path specified by the log message. 

 

Please contact us in case of any troubles.

 

Best regards,

Grzegorz Lewandowski 

Hello Grzegorz,

Thank you for the response. In my initial email, I forgot to mention to you that "C:\smbufs1\build_myit\rbuild\bsmapps\dev\......" is a non-existent path. The path "...smbufs1\build_myit\rbuild\bsmapps\dev\......" is a shared filer where our clover build gets generated and stored.

Which logs can I refer to? I will check those and attach them here. How can I make sure that Clover has access to application source code locally on the Test Host? 

0 votes

Hello,

 

You should be able to configure sources root path using --sourcepath argument, please refer to the documentation for more information.

 

If this won't help, please rise an ticket on https://support.atlassian.com/ and attach logs generated by HtmlReporter command with --debug argument. 

 

Cheers,

Grzegorz Lewandowski

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Monday 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...

515 views 0 9
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