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

how to know source of coverage from html report

Sunita A July 22, 2015

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
Grzegorz Lewandowski
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 24, 2015

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

0 votes
Sunita A July 23, 2015

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
Grzegorz Lewandowski
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 23, 2015

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 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events