mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 04:13:53 +01:00
Fix Instrumentation Tests (#4832)
* Fix AboutActivity Instrumentation Tests * Fix WelcomeActivity Instrumentation Tests * Fix SearchActivity Instrumentation Tests * Fix SignupTest Instrumentation Tests * Fix LoginActivityTest Instrumentation Tests * Fix SettingsActivity Instrumentation Tests * Fix LoginActivity Instrumentation Tests * Update loginUser * Add logoutUser * Fix logoutUser * Update github action to use env variables * Fix github action to use env variables * Fix github action * Fix github action * Fix github action * Fix github action * Fix github action * Fix github action * Fix github action * Fix github action * Fix github action * Fix github action * Fix github action * Remove scroll * Add wait time * Fix keyboard issue * Disable animation * Enable animation * Enable animation * Disable animation * Fix compile error * Remove AVD Cache * Set timezone and dns * Add AVD cache * Add API level * Update API level to 24 * Add sleep timer * Add scroll * Remove logout * Ignore some tests * update logout * update logout * Fix scroll layout problem * Fix scroll layout problem * Ignore orientation test * Update tests * Update tests * Update API level to 29 * Change device and API level to 27 * Use AndroidJUnit4 * Change API to 28 * Try with macos * Use nested scrollview * Update Profile Activity Test * Update Profile Activity Test * Turn off rotation * Change device * Remove failing test * Change API to 24 * Add rotation lock for failing test * Change API to 24 * Add sleep * Remove text * Remove child * Force rotation on back press * Force open more sheet * Change device to pixel 5 * Change device to 13.5inch * Update tests * Ignore failing test * Use linux * Update tests * Use repo secrets instead * Add mainactivity tests * Remove content description * Different workflows for PR and branch, PR workflow will need maintainer approval to prevent secrets getting leaked * Run instrumentation tests only for push and not for PRs * Fix FileNotFound Exception * Update MainActivity and Profile tests * Fix coverage path issue * Add wait time for map to load * Open contribution * Update settings tests * Update main activity tests * Fix failing test * Fix failing test * Increase login time * Separate settings test * Update review tests * Ignore uploadCancelledAfterLocationPickedTest * Update MainActivity Tests * Update UploadCancelledTest * Update UploadCancelledTest * Update device * Fix Init release error * Fix failing test * Fix failing test * Try with long click * Update UploadCancelledTest.kt * Fix Leaderboard Test * Update testContributions * Set GPS coordinates * Add zoomControllers to excludes * Add ExploreActivityTest * Remove failing condition * Merge tests * Remove failing test * Remove failing test * Fix failing test * Fix failing test * Update AboutActivityTest.kt * Update jacoco.gradle
This commit is contained in:
parent
0df272c250
commit
36510a4301
22 changed files with 1070 additions and 648 deletions
163
jacoco.gradle
163
jacoco.gradle
|
|
@ -18,81 +18,85 @@ project.afterEvaluate {
|
|||
.all { variant ->
|
||||
def variantName = variant.name
|
||||
def unitTestTask = "test${variantName.capitalize()}UnitTest"
|
||||
def androidTestCoverageTask = "create${variantName.capitalize()}CoverageReport"
|
||||
def androidTestCoverageTask = "create${variantName.capitalize()}CoverageReport"
|
||||
|
||||
tasks.create(name: "${unitTestTask}Coverage", type: JacocoReport, dependsOn: [
|
||||
def excludes = [
|
||||
// data binding
|
||||
'android/databinding/**/*.class',
|
||||
'**/android/databinding/*Binding.class',
|
||||
'**/android/databinding/*',
|
||||
'**/androidx/databinding/*',
|
||||
'**/BR.*',
|
||||
// android
|
||||
'**/R.class',
|
||||
'**/R$*.class',
|
||||
'**/BuildConfig.*',
|
||||
'**/Manifest*.*',
|
||||
'**/*Test*.*',
|
||||
'android/**/*.*',
|
||||
// butterKnife
|
||||
'**/*$ViewInjector*.*',
|
||||
'**/*$ViewBinder*.*',
|
||||
'**/*ViewBinding*.*',
|
||||
// dagger
|
||||
'**/*_MembersInjector.class',
|
||||
'**/Dagger*Component.class',
|
||||
'**/Dagger*Component$Builder.class',
|
||||
'**/*Module_*Factory.class',
|
||||
'**/di/*',
|
||||
'**/*_Factory*.*',
|
||||
'**/*Module*.*',
|
||||
'**/*Dagger*.*',
|
||||
'**/*Hilt*.*',
|
||||
// kotlin
|
||||
'**/*MapperImpl*.*',
|
||||
'**/*$ViewInjector*.*',
|
||||
'**/*$ViewBinder*.*',
|
||||
'**/BuildConfig.*',
|
||||
'**/*Component*.*',
|
||||
'**/*BR*.*',
|
||||
'**/Manifest*.*',
|
||||
'**/*$Lambda$*.*',
|
||||
'**/*Companion*.*',
|
||||
'**/*Module*.*',
|
||||
'**/*Dagger*.*',
|
||||
'**/*Hilt*.*',
|
||||
'**/*MembersInjector*.*',
|
||||
'**/*_MembersInjector.class',
|
||||
'**/*_Factory*.*',
|
||||
'**/*_Provide*Factory*.*',
|
||||
'**/*Extensions*.*',
|
||||
// sealed and data classes
|
||||
'**/*$Result.*',
|
||||
'**/*$Result$*.*',
|
||||
// model
|
||||
'**/**/model/*',
|
||||
'**/**/models/*',
|
||||
'**/model/*',
|
||||
// concurrency
|
||||
'**/concurrency/*',
|
||||
// kvstore
|
||||
'**/kvstore/*',
|
||||
// db
|
||||
'**/db/*',
|
||||
// data
|
||||
'**/data/*',
|
||||
// zoom controllers are part of external library
|
||||
'**/**/zoomControllers/*',
|
||||
]
|
||||
|
||||
tasks.create(name: "${unitTestTask}UnifiedCoverage", type: JacocoReport, dependsOn: [
|
||||
"$unitTestTask",
|
||||
"$androidTestCoverageTask",
|
||||
]) {
|
||||
group = "Reporting"
|
||||
description = "Generate Jacoco coverage reports for the ${variantName.capitalize()} build"
|
||||
description = "Generate Jacoco unified coverage reports for the ${variantName.capitalize()} build"
|
||||
|
||||
reports {
|
||||
html.enabled = true
|
||||
xml.enabled = true
|
||||
}
|
||||
|
||||
def excludes = [
|
||||
// data binding
|
||||
'android/databinding/**/*.class',
|
||||
'**/android/databinding/*Binding.class',
|
||||
'**/android/databinding/*',
|
||||
'**/androidx/databinding/*',
|
||||
'**/BR.*',
|
||||
// android
|
||||
'**/R.class',
|
||||
'**/R$*.class',
|
||||
'**/BuildConfig.*',
|
||||
'**/Manifest*.*',
|
||||
'**/*Test*.*',
|
||||
'android/**/*.*',
|
||||
// butterKnife
|
||||
'**/*$ViewInjector*.*',
|
||||
'**/*$ViewBinder*.*',
|
||||
'**/*ViewBinding*.*',
|
||||
// dagger
|
||||
'**/*_MembersInjector.class',
|
||||
'**/Dagger*Component.class',
|
||||
'**/Dagger*Component$Builder.class',
|
||||
'**/*Module_*Factory.class',
|
||||
'**/di/*',
|
||||
'**/*_Factory*.*',
|
||||
'**/*Module*.*',
|
||||
'**/*Dagger*.*',
|
||||
'**/*Hilt*.*',
|
||||
// kotlin
|
||||
'**/*MapperImpl*.*',
|
||||
'**/*$ViewInjector*.*',
|
||||
'**/*$ViewBinder*.*',
|
||||
'**/BuildConfig.*',
|
||||
'**/*Component*.*',
|
||||
'**/*BR*.*',
|
||||
'**/Manifest*.*',
|
||||
'**/*$Lambda$*.*',
|
||||
'**/*Companion*.*',
|
||||
'**/*Module*.*',
|
||||
'**/*Dagger*.*',
|
||||
'**/*Hilt*.*',
|
||||
'**/*MembersInjector*.*',
|
||||
'**/*_MembersInjector.class',
|
||||
'**/*_Factory*.*',
|
||||
'**/*_Provide*Factory*.*',
|
||||
'**/*Extensions*.*',
|
||||
// sealed and data classes
|
||||
'**/*$Result.*',
|
||||
'**/*$Result$*.*',
|
||||
// model
|
||||
'**/**/model/*',
|
||||
// concurrency
|
||||
'**/concurrency/*',
|
||||
// kvstore
|
||||
'**/kvstore/*',
|
||||
// db
|
||||
'**/db/*',
|
||||
// data
|
||||
'**/data/*',
|
||||
]
|
||||
|
||||
def javaClasses = fileTree(dir: variant.javaCompileProvider.get().destinationDir,
|
||||
excludes: excludes)
|
||||
def kotlinClasses = fileTree(dir: "${buildDir}/tmp/kotlin-classes/${variantName}",
|
||||
|
|
@ -116,7 +120,34 @@ project.afterEvaluate {
|
|||
]))
|
||||
}
|
||||
|
||||
tasks.create(name: "${unitTestTask}Coverage", type: JacocoReport, dependsOn: [
|
||||
"$unitTestTask"
|
||||
]) {
|
||||
group = "Reporting"
|
||||
description = "Generate Jacoco coverage reports for the ${variantName.capitalize()} build"
|
||||
|
||||
reports {
|
||||
html.enabled = true
|
||||
xml.enabled = true
|
||||
}
|
||||
|
||||
def javaClasses = fileTree(dir: variant.javaCompileProvider.get().destinationDir,
|
||||
excludes: excludes)
|
||||
def kotlinClasses = fileTree(dir: "${buildDir}/tmp/kotlin-classes/${variantName}",
|
||||
excludes: excludes)
|
||||
|
||||
classDirectories.setFrom(files([
|
||||
javaClasses,
|
||||
kotlinClasses
|
||||
]))
|
||||
|
||||
def variantSourceSets = variant.sourceSets.java.srcDirs.collect { it.path }.flatten()
|
||||
sourceDirectories.setFrom(project.files(variantSourceSets))
|
||||
|
||||
executionData(files([
|
||||
"$project.buildDir/jacoco/${unitTestTask}.exec"
|
||||
]))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue