Compare commits

..

1 Commits

Author SHA1 Message Date
1bc0caac29 ci: Instrumentation tests coverage in ci.
All checks were successful
Check PR code / BuildAndTestAndCoverage (pull_request) Successful in 30m53s
2025-03-22 09:24:12 +01:00
2 changed files with 3 additions and 55 deletions

View File

@ -44,20 +44,20 @@ jobs:
api-level: 29
script: |
./gradlew androidApp:createScreenshotDirectory
./gradlew JacocoDebugCodeCoverage || true
./gradlew androidApp:connectedAndroidTest || true
./gradlew androidApp:fetchScreenshots
- uses: actions/upload-artifact@v3
if: always()
with:
name: failure-espresso
path: androidApp/build/reports/androidTests/connected/screenshots
path: build/reports/androidTests/connected/screenshots
retention-days: 2
overwrite: true
include-hidden-files: true
- uses: actions/upload-artifact@v3
with:
name: coverage-espresso
path: androidApp/build/reports/jacoco/JacocoDebugCodeCoverage
path: androidApp/build/reports/coverage/androidTest/githubConfig/debug/connected
retention-days: 1
overwrite: true
include-hidden-files: true

View File

@ -10,7 +10,6 @@ plugins {
id("com.mikepenz.aboutlibraries.plugin")
id("org.jetbrains.kotlinx.kover")
id("app.cash.sqldelight") version "2.0.2"
jacoco
}
fun Project.execWithOutput(
@ -65,15 +64,6 @@ fun versionNameFromGit(): String {
return gitVersion()
}
val exclusions =
listOf(
"**/R.class",
"**/R\$*.class",
"**/BuildConfig.*",
"**/Manifest*.*",
"**/*Test*.*",
)
android {
compileOptions {
isCoreLibraryDesugaringEnabled = true
@ -124,39 +114,6 @@ android {
installation {
installOptions("-g", "-r")
}
val androidTests = "connectedAndroidTest"
tasks.register<JacocoReport>("JacocoDebugCodeCoverage") {
// Depend on unit tests and Android tests tasks
dependsOn(listOf(androidTests))
// Set task grouping and description
group = "Reporting"
description = "Execute UI and unit tests, generate and combine Jacoco coverage report"
// Configure reports to generate both XML and HTML formats
reports {
xml.required.set(true)
html.required.set(true)
}
// Set source directories to the main source directory
sourceDirectories.setFrom(layout.projectDirectory.dir("src/main"))
// Set class directories to compiled Java and Kotlin classes, excluding specified exclusions
classDirectories.setFrom(
files(
fileTree(layout.buildDirectory.dir("intermediates/javac/")) {
exclude(exclusions)
},
fileTree(layout.buildDirectory.dir("tmp/kotlin-classes/")) {
exclude(exclusions)
},
),
)
// Collect execution data from .exec and .ec files generated during test execution
executionData.setFrom(
files(
fileTree(layout.buildDirectory) { include(listOf("**/*.exec", "**/*.ec")) },
),
)
}
}
}
flavorDimensions.add("build")
@ -311,12 +268,3 @@ tasks.register<Exec>("fetchScreenshots") {
reportsDirectory.mkdirs()
}
}
tasks.withType(Test::class) {
if (this.name == "connectedAndroidTest") {
configure<JacocoTaskExtension> {
isIncludeNoLocationClasses = true
excludes = listOf("jdk.internal.*")
}
}
}