Hi all,

I have redesign Jacoco coverage generation a bit to support for coverage
merging functionality. Now coverage data dump into
$basedir/target/jacoco/coverage directory at the time of report generation,
jacoco coverage data files are merged back to a single file
(jacoco-data-merge.exec) and report will be generated using this merged
data file.

To merge multiple module test coverage data files. You can use pom file
with exec-maven-plugin to execute
org.wso2.carbon.automation.engine.frameworkutils.TestCoverageGenerator
class. This will generate merged report at
 $basedir/target/jacoco/coverage/index.html.

I will write a comprehensive document on applying Jacoco coverage to
products.

Thanks,
Krishantha.

On Wed, May 6, 2015 at 10:46 AM, Krishantha Samaraweera <[email protected]
> wrote:

> Hi Nuwan,
>
> You can't use TestCoverageGenerator anymore (We need to remove this class
> as well) . The merged report should be generated at the last test module
> with got executed as we merge all coverage data to common file.
>
> May be we can think of introducing pom file to do merging. If this option
> is not user friendly.
>
> Thanks,
> Krishantha.
>
> On Wed, May 6, 2015 at 10:24 AM, Nuwan Wimalasekara <[email protected]>
> wrote:
>
>> Hi Krishantha,
>> I am getting below error when merging the coverage reports.
>> generateReports implementation is missing in CodeCoverageUtils. report
>> module use
>> the org.wso2.carbon.integration.common.utils.coverage.TestCoverageGenerator
>> to aggregate results.
>>
>> Exception in thread "main" java.lang.NoSuchMethodError:
>> org.wso2.carbon.automation.engine.frameworkutils.CodeCoverageUtils.generateReports(Ljava/util/List;)V
>> at
>> org.wso2.carbon.integration.common.utils.coverage.TestCoverageGenerator.main(TestCoverageGenerator.java:36)
>>
>> Thanks,
>> Nuwanw
>>
>> On Tue, May 5, 2015 at 9:47 PM, Nuwan Wimalasekara <[email protected]>
>> wrote:
>>
>>> Yes. The correct implementation
>>> is 
>>> org.wso2.carbon.automation.extensions.servers.carbonserver.CarbonServerExtension.
>>> We will remove the CarbonServerExtension from utils to  get rid of
>>> conflicts.
>>>
>>> Thanks,
>>> Nuwanw
>>>
>>> On Tue, May 5, 2015 at 9:27 PM, Krishantha Samaraweera <
>>> [email protected]> wrote:
>>>
>>>> Hi Nuwan,
>>>>
>>>> You should remove
>>>> org.wso2.carbon.integration.common.extensions.carbonserver.CarbonServerExtension
>>>> not the
>>>> org.wso2.carbon.automation.extensions.servers.carbonserver.CarbonServerExtension.
>>>>
>>>> Thanks,
>>>> Krishantha.
>>>>
>>>> On Wed, May 6, 2015 at 9:47 AM, Nuwan Wimalasekara <[email protected]>
>>>> wrote:
>>>>
>>>>> Hi
>>>>> We should
>>>>> remove 
>>>>> org.wso2.carbon.automation.extensions.servers.carbonserver.CarbonServerExtension
>>>>> from extensions. Then all the tests module should refer the correct class.
>>>>>
>>>>> Thanks,
>>>>> Nuwanw
>>>>>
>>>>> On Tue, May 5, 2015 at 8:49 PM, Krishantha Samaraweera <
>>>>> [email protected]> wrote:
>>>>>
>>>>>> Hi Waruna,
>>>>>>
>>>>>> On Wed, May 6, 2015 at 9:12 AM, Waruna Perera <[email protected]>
>>>>>> wrote:
>>>>>>
>>>>>>> Hi Krishantha,
>>>>>>>
>>>>>>> And we need to update Automation.xml to use following class instead
>>>>>>> of one from utils.
>>>>>>>
>>>>>>
>>>>>> Please remove the CarbonServerExtension class at utils. Its was
>>>>>> deprecated in last release and moved to test extensions to support for
>>>>>> carbon kernel startup.
>>>>>>
>>>>>> Need to completely get rid of this extension class and its
>>>>>> dependencies.
>>>>>>
>>>>>> Thanks,
>>>>>> Krishantha.
>>>>>>
>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> org.wso2.carbon.automation.extensions.servers.carbonserver.CarbonServerExtension
>>>>>>>
>>>>>>> Thanks
>>>>>>>
>>>>>>> On Tue, May 5, 2015 at 6:29 PM, Nuwan Wimalasekara <[email protected]>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> Hi Krishantha,
>>>>>>>> I tried generating coverage in ESB. It is working fine and Coverage
>>>>>>>> reports generated. However the coverage report aggregation seems not
>>>>>>>> working when there are multiple tests modules. We need to fix the 
>>>>>>>> issue.
>>>>>>>>
>>>>>>>> test-automation-framework - 4.3.2-SNAPSHOT
>>>>>>>> carbon-platform-integration-utils - 4.3.1-SNAPSHOT
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Nuwanw
>>>>>>>>
>>>>>>>> On Wed, Apr 29, 2015 at 10:41 PM, Krishantha Samaraweera <
>>>>>>>> [email protected]> wrote:
>>>>>>>>
>>>>>>>>> Correction : Step #1 configuration should be as follows.
>>>>>>>>>
>>>>>>>>> <execution>
>>>>>>>>>     <id>copy-jacoco-dependencies</id>
>>>>>>>>>     <phase>compile</phase>
>>>>>>>>>     <goals>
>>>>>>>>>         <goal>copy-dependencies</goal>
>>>>>>>>>     </goals>
>>>>>>>>>     <configuration>
>>>>>>>>>
>>>>>>>>> <outputDirectory>${project.build.directory}/jacoco</outputDirectory>
>>>>>>>>>         <includeTypes>jar</includeTypes>
>>>>>>>>>         <includeArtifactIds>org.jacoco.agent</includeArtifactIds>
>>>>>>>>>     </configuration>
>>>>>>>>> </execution>
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>> Krishantha.
>>>>>>>>>
>>>>>>>>> On Thu, Apr 30, 2015 at 2:50 AM, Krishantha Samaraweera <
>>>>>>>>> [email protected]> wrote:
>>>>>>>>>
>>>>>>>>>> Hi all,
>>>>>>>>>>
>>>>>>>>>> New coverage implementation using Jacoco has been committed to
>>>>>>>>>> master branch of carbon-platform-integration. I tried my best to 
>>>>>>>>>> adhere to
>>>>>>>>>> existing Emma based design and reuse same instrumentation and 
>>>>>>>>>> filters text
>>>>>>>>>> files. Note that this new coverage implementation was done to 
>>>>>>>>>> support for
>>>>>>>>>> JDK 1.7 and 1.8. We need to test the new implementation thoroughly 
>>>>>>>>>> before
>>>>>>>>>> the release.
>>>>>>>>>>
>>>>>>>>>> I've done initial testing with AS and everything seems to work.
>>>>>>>>>> Automation team will start verifying coverage with products already
>>>>>>>>>> migrated JDK 1.7. Specially products with multiple test modules 
>>>>>>>>>> (ESB, G-Reg
>>>>>>>>>> & BPS)
>>>>>>>>>>
>>>>>>>>>> Lets focus on testing following scenarios before the release.
>>>>>>>>>>
>>>>>>>>>> Test Scenarios for coverage :
>>>>>>>>>>
>>>>>>>>>> 1. Coverage generation with patches applied.
>>>>>>>>>> 2. Merge coverage reports in multiple test modules.
>>>>>>>>>> 3. WebApp class coverage.
>>>>>>>>>> 4. Coverage generation after restart and impact to coverage
>>>>>>>>>> numbers.
>>>>>>>>>>
>>>>>>>>>> To get started with Jacoco coverage :
>>>>>>>>>>
>>>>>>>>>> 1. Edit your test module pom and replace emma copy dependency
>>>>>>>>>> execution configuration with below.
>>>>>>>>>>
>>>>>>>>>> <execution>
>>>>>>>>>>     <id>copy-emma-dependencies</id>
>>>>>>>>>>     <phase>compile</phase>
>>>>>>>>>>     <goals>
>>>>>>>>>>         <goal>copy-dependencies</goal>
>>>>>>>>>>     </goals>
>>>>>>>>>>     <configuration>
>>>>>>>>>>
>>>>>>>>>> <outputDirectory>${project.build.directory}/emma</outputDirectory>
>>>>>>>>>>         <includeTypes>jar</includeTypes>
>>>>>>>>>>         <includeArtifactIds>emma
>>>>>>>>>>         </includeArtifactIds>
>>>>>>>>>>     </configuration>
>>>>>>>>>> </execution>
>>>>>>>>>>
>>>>>>>>>> 2. Include jacoco argent as a dependency to root pom.
>>>>>>>>>>
>>>>>>>>>> <dependency>
>>>>>>>>>>             <groupId>org.jacoco</groupId>
>>>>>>>>>>             <artifactId>org.jacoco.agent</artifactId>
>>>>>>>>>>             <version>${jacoco.agent.version}</version>
>>>>>>>>>> </dependency>
>>>>>>>>>>
>>>>>>>>>> <jacoco.agent.version>0.7.4.201502262128</jacoco.agent.version>
>>>>>>>>>>
>>>>>>>>>> 3. Remove following system properties from surefire plugin.
>>>>>>>>>>
>>>>>>>>>> <emma.home>${basedir}/target/emma</emma.home>
>>>>>>>>>> <emma.output>${basedir}/target/emma</emma.output>
>>>>>>>>>>
>>>>>>>>>> You will find following log entries in console with required
>>>>>>>>>> details to view the report once coverage generation completed. 
>>>>>>>>>> Available
>>>>>>>>>> report formats are XML, HTML and CSV
>>>>>>>>>>
>>>>>>>>>> INFO
>>>>>>>>>>  
>>>>>>>>>> [org.wso2.carbon.automation.extensions.servers.carbonserver.CarbonServerManager]
>>>>>>>>>> - Jacoco coverage dump file path :
>>>>>>>>>> /Users/krishantha/git/wso2/product-as/modules/integration/tests-integration/tests/target/jacoco.exec
>>>>>>>>>> INFO
>>>>>>>>>>  
>>>>>>>>>> [org.wso2.carbon.automation.extensions.servers.carbonserver.CarbonServerManager]
>>>>>>>>>> - Jacoco class file path :
>>>>>>>>>> /Users/xxx/product-as/modules/integration/tests-integration/tests/target/wso2as-6.0.0-NAPSHOT/repository/components/plugins
>>>>>>>>>> INFO
>>>>>>>>>>  
>>>>>>>>>> [org.wso2.carbon.automation.extensions.servers.carbonserver.CarbonServerManager]
>>>>>>>>>> - Jacoco coverage report path :
>>>>>>>>>> /Users/krishantha/git/wso2/product-as/modules/integration/tests-integration/tests/target/jacoco/coverage
>>>>>>>>>>
>>>>>>>>>> Thanks,
>>>>>>>>>> Krishantha.
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> Krishantha Samaraweera
>>>>>>>>>> Senior Technical Lead - Test Automation
>>>>>>>>>> Mobile: +94 77 7759918
>>>>>>>>>> WSO2, Inc.; http://wso2.com/
>>>>>>>>>> lean . enterprise . middlewear.
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Krishantha Samaraweera
>>>>>>>>> Senior Technical Lead - Test Automation
>>>>>>>>> Mobile: +94 77 7759918
>>>>>>>>> WSO2, Inc.; http://wso2.com/
>>>>>>>>> lean . enterprise . middlewear.
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Nuwan Wimalasekara
>>>>>>>> Senior Software Engineer - Test Automation
>>>>>>>> WSO2, Inc.: http://wso2.com
>>>>>>>> lean. enterprise. middleware
>>>>>>>>
>>>>>>>> phone: +94 71 668 4620
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Waruna Perera
>>>>>>> Senior Software Engineer - Test Automation
>>>>>>> Mobile: +94 77 3867037
>>>>>>> WSO2, Inc.; http://wso2.com/
>>>>>>> lean . enterprise . middlewear.
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Krishantha Samaraweera
>>>>>> Senior Technical Lead - Test Automation
>>>>>> Mobile: +94 77 7759918
>>>>>> WSO2, Inc.; http://wso2.com/
>>>>>> lean . enterprise . middlewear.
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Nuwan Wimalasekara
>>>>> Senior Software Engineer - Test Automation
>>>>> WSO2, Inc.: http://wso2.com
>>>>> lean. enterprise. middleware
>>>>>
>>>>> phone: +94 71 668 4620
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Krishantha Samaraweera
>>>> Senior Technical Lead - Test Automation
>>>> Mobile: +94 77 7759918
>>>> WSO2, Inc.; http://wso2.com/
>>>> lean . enterprise . middlewear.
>>>>
>>>
>>>
>>>
>>> --
>>> Nuwan Wimalasekara
>>> Senior Software Engineer - Test Automation
>>> WSO2, Inc.: http://wso2.com
>>> lean. enterprise. middleware
>>>
>>> phone: +94 71 668 4620
>>>
>>>
>>>
>>>
>>
>>
>> --
>> Nuwan Wimalasekara
>> Senior Software Engineer - Test Automation
>> WSO2, Inc.: http://wso2.com
>> lean. enterprise. middleware
>>
>> phone: +94 71 668 4620
>>
>>
>>
>>
>
>
> --
> Krishantha Samaraweera
> Senior Technical Lead - Test Automation
> Mobile: +94 77 7759918
> WSO2, Inc.; http://wso2.com/
> lean . enterprise . middlewear.
>



-- 
Krishantha Samaraweera
Senior Technical Lead - Test Automation
Mobile: +94 77 7759918
WSO2, Inc.; http://wso2.com/
lean . enterprise . middlewear.
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to