mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 04:13:53 +01:00
Run Instrumentation tests and generates unified code coverage (#4828)
* Run instrumentation tests on CI and generate unified coverage report * Fix ci * Fix failing tests and use mac machine for HAXM * Fix failing tests * Fix coverage failure * Try with ubuntu latest * Change API level to 23 * Fix Failing Test * Add prod APK generator workflow back
This commit is contained in:
parent
c6fda6dadb
commit
9205f37605
16 changed files with 98 additions and 25 deletions
|
|
@ -18,9 +18,11 @@ project.afterEvaluate {
|
|||
.all { variant ->
|
||||
def variantName = variant.name
|
||||
def unitTestTask = "test${variantName.capitalize()}UnitTest"
|
||||
def androidTestCoverageTask = "create${variantName.capitalize()}CoverageReport"
|
||||
|
||||
tasks.create(name: "${unitTestTask}Coverage", type: JacocoReport, dependsOn: [
|
||||
"$unitTestTask"
|
||||
"$unitTestTask",
|
||||
"$androidTestCoverageTask",
|
||||
]) {
|
||||
group = "Reporting"
|
||||
description = "Generate Jacoco coverage reports for the ${variantName.capitalize()} build"
|
||||
|
|
@ -102,8 +104,13 @@ project.afterEvaluate {
|
|||
def variantSourceSets = variant.sourceSets.java.srcDirs.collect { it.path }.flatten()
|
||||
sourceDirectories.setFrom(project.files(variantSourceSets))
|
||||
|
||||
def androidTestsData = fileTree(dir:
|
||||
"${buildDir}/outputs/code_coverage/${variantName}AndroidTest/connected/",
|
||||
includes: ["**/*.ec"])
|
||||
|
||||
executionData(files([
|
||||
"$project.buildDir/jacoco/${unitTestTask}.exec"
|
||||
"$project.buildDir/jacoco/${unitTestTask}.exec",
|
||||
androidTestsData
|
||||
]))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue