[ 
https://issues.apache.org/jira/browse/FLINK-5092?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15748145#comment-15748145
 ] 

ASF GitHub Bot commented on FLINK-5092:
---------------------------------------

Github user BorisOsipov commented on the issue:

    https://github.com/apache/flink/pull/2836
  
    @zentol Yes plugin cannot detect out of box cross-module coverage, but 
there are some tricks how it could be done.
    
    I've implemented and tested one of them.
    I squash older commits and split my works to two commits.
    The first one adds coverage plugin and change surefire configuration.
    The second one adds:
    
    - new maven submodule for coverage report aggregation.
    - change shade maven plugin configuration. When tests run with coverage 
profile shaded jar doesn't replace original jar(shadedArtifactAttached=true). 
It needs because maven-shade-plugin changes class files and it makes impossible 
coverage reports aggregations, because jacoco requires the same classes on data 
collecting and report phases.
    
    Changes in shade configuration made some test broken:
    - `ClassLoaderITCase`
    - `ZooKeeperLeaderElectionITCase`
    - `JobManagerHACheckpointRecoveryITCase`
    
    I investigate that they cannot run correctly without shading and there is 
no way to fix it.
    I think it is not a big problem.
    
    So you can get full coverage report by running command `mvn clean install 
-Pcoverage -Dmaven.test.failure.ignore=true` and open 
`flink/flink-test-utils-parent/flink-test-utils-coverage/target/site/jacoco-aggregate/index.html`
    
    What do you think about these changes?
    I glad to answer you questions if you have


> Add integration with Sonarqube and code coverage
> ------------------------------------------------
>
>                 Key: FLINK-5092
>                 URL: https://issues.apache.org/jira/browse/FLINK-5092
>             Project: Flink
>          Issue Type: Improvement
>          Components: Tests
>            Reporter: Boris Osipov
>            Assignee: Boris Osipov
>
> It would be good to have the opportunity to generate test coverage reports 
> for Flink and analyze code by SonarQube.
> Parts of tasks:
> - add generate test coverage reports for Flink with new maven profile
> - implement integration with https://analysis.apache.org/



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to