Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tarea gradle para generar reporte cobertura con jacoco #77

Closed
CarlosM4rtinez opened this issue Jul 2, 2020 · 1 comment
Closed

Tarea gradle para generar reporte cobertura con jacoco #77

CarlosM4rtinez opened this issue Jul 2, 2020 · 1 comment

Comments

@CarlosM4rtinez
Copy link

CarlosM4rtinez commented Jul 2, 2020

Hola!, seria interesante que el scaffold de clean architecture venga ya configurado con la tarea jacoco de gradle para generar el reporte de cobertura de pruebas con todo el consolidado de los módulos del proyecto.

`task jacocoRootReport(type: JacocoReport){

dependsOn = subprojects.test
additionalSourceDirs.setFrom files(subprojects.sourceSets.main.allSource.srcDirs)
sourceDirectories.setFrom files(subprojects.sourceSets.main.allSource.srcDirs)
classDirectories.setFrom files(subprojects.sourceSets.main.output)
executionData.setFrom project.fileTree(dir: '.', include: '**/build/jacoco/test.exec')

reports {
    html.enabled = true
    html.destination = file("${buildDir}/jacoco")
    xml.enabled = true
    xml.destination = file("${buildDir}/jacoco/report.xml")
    csv.enabled = false
}

}`

@santitigaga
Copy link
Contributor

Hi @CarlosM4rtinez , you can use jacoco or cobertura in your project. You need generated the scaffold with the option coverage = <jacoco | cobertura> if you dont specify the coverage tool, the default value is jacoco.

Maybe is usefull generate the pipeline too with the task gradle generatePipeline --type=[pipelineType] that use the report of the coverage tool and publish with sonarQube.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants