Gradle : How to generate coverage report for Integration test using jacoco

后端 未结 4 1805
离开以前
离开以前 2021-02-02 13:02

I am new to gradle. I am using the below code. But it generates coverage for unit test cases. But it didn\'t generate for integration test cases. I have my test classes in the p

4条回答
  •  别跟我提以往
    2021-02-02 13:56

    I believe the most full answer will look like:

    tasks.withType(Test) {
        finalizedBy jacocoTestReport
    }
    
    project.jacocoTestReport {
        getExecutionData().setFrom(fileTree(buildDir).include("/jacoco/*.exec"))
    
        reports {
            csv.enabled true
        }
    }
    

    At least it's fully suited for my needs with integration and functional testing.

提交回复
热议问题