I am trying to setup code coverage for a large project and I would like to have some questions answered
The current setup for our product is as follows
- If there are lot of engineers who do manual tests, will the code coverage generated by clover include manual tests as well(jacoco agent capture manual test coverage without any instrumentation, want to understand what is the case with clover) or coverage is just from the instrumented tests?
Clover can record global coverage generated by manual testing, but application code needs to be instrumented prior it. If you want per-test coverage you need to hack Clover a little bit to indicate manual test scenarios boundaries, please take a look at this tutorial.
- The applications servers are located in DMZ and sit behind apache webservers, apache routes the requests to appservers(tomcat in this case), if I were to deploy instrumented source code as rpm's to appserver, will enabling "System Property in the Java task that starts the WebServer" as listed inhttps://confluence.atlassian.com/display/CLOVER/Using+Distributed+Per-test+Coverage+with+Clover-for-Ant#UsingDistributedPer-testCoveragewithClover-for-Ant-SettingaSystemPropertyintheJavataskthatstartstheWebServer allow me capture to code coverage even if the tests are hitting apache webservers endpoint(assuming the coverage is being generated correctly). The JUNIT/API tests are executed from jenkins which is located in company internal network, the tests will be pointed to apache's endpoint.
I'm not sure if I understood the question correctly, but for Clover there's no difference if some parts of the application exists in other networks. Clover bases on instrumented code execution, but if you want to collect per-test coverage in distributed environment like one you've described you have to follow the linked tutorial.
Hi @Grzegorz Lewandowski,
Let me elaborate a bit on second bullet point, when the tests are executed they hit the apache front door, how will the appservers which have instrumented application code deployed generate coverage? DO i have to open the port on the apache as well? just like how it is on application server so test coverage metrics are generated? My confusion is if tests(clover server jvm) have a port open and appserver(clover client jvm) also have a port open, and if there is apache webserver in between tests jvm and appserver jvm how will the per-test code coverage be generated?
Clover in distributed mode setups it's own services. It uses GNU CAJO library for that purpose. Generally speaking, it will open a port to listen to test JVM (client) connections. If you're using any firewall it shall be whitelisted, but you don't have to do anything on the Apache Server side (beside deploying instrumented version of an application and setting up proper JVM flags - please follow the tutorial for that). Clover will determine if it runs on client (test) or server (application) JVM and make its own requests accordingly marking beginning and ending of a test
Thanks @Grzegorz Lewandowski, the bigger problem I have is there is nothing to deploy on Apache Webserver which sits between the LoadBalancer and App Servers, except for config files. The instrumented code is only deployed to app-servers, which is exactly why i am confused on how i should proceed with this kinda of setup. The documentation link doesn't help me in situations i just described, any help is very very appreciated
Also @Grzegorz Lewandowski, if there is anything I can do to get in touch with Atlassian support and do a quick phone call(we are willing to pay for support if its needed) Please let me know, we want to have code coverage in place of for our kinda of setup. Thanks you.
So as far as I understood Apache Server doesn't have any application code deployed, it's merely a router. If that's the case I don't see any reason to enable Clover on it. Clover works source code level. What it means, it instruments source code, which needs to be compiled afterward. In runtime every time (instrumented) application code is executed, Clover coverage gathering instructions are being executed as well causing code coverage data to be collected. You can read about it here.
Regarding Atlassian Support, you can create issue at http://support.atlassian.com
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...
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!
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