Skip to content

Commit

Permalink
fixed coverage reports
Browse files Browse the repository at this point in the history
  • Loading branch information
compscidr committed May 12, 2023
1 parent 8fa2d6a commit 967f7a7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 18 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ jobs:
run: ./gradlew jacocoTestReportDebug
- name: Clean Packages
run: bash ./scripts/clean-packages.sh
# - name: On-Device Instrumented Tests with CoverageReport
# run: ./gradlew coverageReport
- name: On-Device Instrumented Tests
run: ./gradlew connectedCheck
- uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -62,7 +60,7 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: instrumentedtests
files: ./app/build/reports/jacoco.xml
files: ./app/build/reports/coverage/androidTest/debug/connected/report.xml

- name: Export environment variables
run: |
Expand Down
26 changes: 12 additions & 14 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ plugins {
id 'io.github.reactivecircus.app-versioning' version '1.1.2'
id 'de.mannodermaus.android-junit5'
id 'org.jmailen.kotlinter'
id 'jacoco'
//id 'org.jetbrains.dokka'
}

Expand Down Expand Up @@ -58,18 +59,20 @@ android {
testOptions {
unitTests.all {
useJUnitPlatform()
// jacoco {
// includeNoLocationClasses = true
// excludes = ['jdk.internal.*']
// }
jacoco {
includeNoLocationClasses = true
excludes = [
'jdk.internal.*',
]
}
}
// should let the tests run with with gradle via -DincludeTags="tag1,tag2" -DexcludeTags="tag3,tag4"
// https://github.com/mannodermaus/android-junit5/wiki/Configuration
// https://junit.org/junit5/docs/current/user-guide/#writing-tests-tagging-and-filtering
// https://www.vogella.com/tutorials/AndroidTesting/article.html
junitPlatform {
filters {
includeTags 'TEST1'
//includeTags 'TEST1'
//excludeTags 'TEST2'
}
}
Expand Down Expand Up @@ -142,22 +145,17 @@ dependencies {
configurations.testImplementation {
exclude module: 'logback-android'
}
//
//jacoco {
// toolVersion = '0.8.7'
//}

jacoco {
toolVersion = '0.8.7'
}

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = "11"
}
}

//rootCoverage {
// includeAndroidTestResults true
// generateXml true
//}

// https://github.com/ReactiveCircus/app-versioning
appVersioning {
overrideVersionCode { gitTag, providers, variantInfo ->
Expand Down
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ plugins {
id "com.android.application" version "$agp_version" apply false
id "org.jetbrains.kotlin.android" version "$kotlin_version" apply false
id "org.jetbrains.kotlin.plugin.serialization" version "$kotlin_version"
//id "nl.neotech.plugin.rootcoverage" version '1.6.0'
id "org.jetbrains.kotlin.jvm" version "$kotlin_version" apply false
}

Expand Down

0 comments on commit 967f7a7

Please sign in to comment.