Compare commits

..

1 Commits

Author SHA1 Message Date
aa385b00a9 ci: Instrumentation tests coverage in ci.
All checks were successful
Check PR code / BuildAndTestAndCoverage (pull_request) Successful in 29m6s
2025-03-23 21:43:41 +01:00
3 changed files with 12 additions and 13 deletions

View File

@ -35,9 +35,6 @@ jobs:
pkill -SIGTERM crashpad_handler || true
sleep 5
pkill -SIGKILL crashpad_handler || true
- name: Change url until I find a better way to do it
run: |
sed -i "s/val defaultUrl = \"http:\/\/10\.0\.2\.2\:8888\"/val defaultUrl = \"http:\/\/172\.17\.0\.1\:8888\"/g" ./androidApp/src/androidTest/kotlin/bou/amine/apps/readerforselfossv2/android/CommonTests.kt
- name: Tests
uses: reactivecircus/android-emulator-runner@v2
with:
@ -46,9 +43,9 @@ jobs:
./gradlew androidApp:clearScreenshotsTask || true
./gradlew androidApp:createScreenshotDirectory
adb logcat -G 16M
./gradlew JacocoDebugCodeCoverage || true
env SELFOSS_URL=172.17.0.1:8888 ./gradlew JacocoDebugCodeCoverage || true
./gradlew androidApp:fetchScreenshots
adb logcat 'audio_hw_generic:S' '*:I' -d > ./androidApp/build/reports/androidTests/connected/screenshots/logs.txt
adb logcat '*:I' -d > ./androidApp/build/reports/androidTests/connected/screenshots/logs.txt
- uses: actions/upload-artifact@v3
if: always()
with:

View File

@ -272,12 +272,6 @@ tasks.withType<Test> {
)
showStandardStreams = true
}
if (this.name == "connectedAndroidTest") {
configure<JacocoTaskExtension> {
isIncludeNoLocationClasses = true
excludes = listOf("jdk.internal.*")
}
}
}
aboutLibraries {
@ -317,3 +311,12 @@ tasks.register<Exec>("fetchScreenshots") {
reportsDirectory.mkdirs()
}
}
tasks.withType(Test::class) {
if (this.name == "connectedAndroidTest") {
configure<JacocoTaskExtension> {
isIncludeNoLocationClasses = true
excludes = listOf("jdk.internal.*")
}
}
}

View File

@ -32,8 +32,7 @@ import java.io.FileOutputStream
import java.io.IOException
import java.util.Locale
// For now, do not move this as it is modified by the integration tests
val defaultUrl = "http://10.0.2.2:8888"
val defaultUrl = (System.getenv("SELFOSS_URL") ?: "").ifEmpty { "http://10.0.2.2:8888" }
fun performLogin(someUrl: String? = null) {
Log.i("AUTOMATION", "The url used will be ${if (!someUrl.isNullOrEmpty()) someUrl else defaultUrl}")