Skip to content

Commit

Permalink
Merge pull request #617 from ooni/fix/test-usability
Browse files Browse the repository at this point in the history
Fix : Duplicate content root and update dependencies to enable more fluent runs from the IDE
  • Loading branch information
aanorbel authored Oct 6, 2023
2 parents 44ea55b + c8c98d4 commit eca92d2
Show file tree
Hide file tree
Showing 20 changed files with 87 additions and 32 deletions.
47 changes: 15 additions & 32 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,6 @@ android {
}
}

// Shared test code between Unit and Instrumented tests
sourceSets {
androidTest {
java.srcDirs += "src/sharedTest/java"
resources.srcDirs += "src/sharedTest/resources"
}
test {
java.srcDirs += "src/sharedTest/java"
resources.srcDirs += "src/sharedTest/resources"
}
}

flavorDimensions 'testing', 'license'
productFlavors {
stable {
Expand Down Expand Up @@ -153,36 +141,31 @@ dependencies {

// Testing
// Unit Testing
testImplementation project(':shared-test')
testImplementation 'junit:junit:4.13.2'
testImplementation 'androidx.test:core:1.4.0'
testImplementation 'androidx.test:runner:1.4.0'
testImplementation 'androidx.test:rules:1.4.0'
testImplementation 'org.mockito:mockito-core:4.6.1'
testImplementation 'androidx.test:core:1.5.0'
testImplementation 'androidx.test:runner:1.5.2'
testImplementation 'androidx.test:rules:1.5.0'
testImplementation 'org.mockito:mockito-core:5.3.1'
testImplementation 'org.mockito:mockito-inline:4.6.1'
testImplementation 'org.robolectric:robolectric:4.5.1'
testImplementation 'org.robolectric:robolectric:4.10.3'
testImplementation 'com.github.blocoio:faker:1.2.8'
testImplementation 'org.ooni:oonimkall:2023.07.18-162729'
testAnnotationProcessor 'com.google.dagger:dagger-compiler:2.36'

// Instrumentation Testing
androidTestImplementation project(':shared-test')
androidTestImplementation 'tools.fastlane:screengrab:2.0.0'
androidTestImplementation 'com.github.blocoio:faker:1.2.8'
androidTestImplementation 'androidx.test:runner:1.4.0'
androidTestImplementation 'androidx.test:rules:1.4.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.4.0'
androidTestImplementation('androidx.test.espresso:espresso-contrib:3.4.0') {
exclude group: 'com.android.support', module: 'appcompat'
exclude group: 'com.android.support', module: 'support-v4'
exclude module: 'recyclerview-v7'
}
androidTestImplementation('androidx.test.espresso:espresso-core:3.4.0') {
exclude group: 'com.android.support', module: 'appcompat'
exclude group: 'com.android.support', module: 'support-v4'
exclude module: 'recyclerview-v7'
}
androidTestImplementation('com.schibsted.spain:barista:3.9.0')
androidTestImplementation 'androidx.test:runner:1.5.2'
androidTestImplementation 'androidx.test:rules:1.5.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.5.1'
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.5.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
androidTestImplementation 'com.schibsted.spain:barista:3.9.0'
androidTestAnnotationProcessor "com.google.dagger:dagger-compiler:2.36"

}

static def versionCodeDate() {
Expand Down
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ include ':app'
include ':engine'
include ':engine-experimental'
include ':applogger'
include ':shared-test'
1 change: 1 addition & 0 deletions shared-test/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
66 changes: 66 additions & 0 deletions shared-test/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
plugins {
id 'com.android.library'
}

android {
namespace 'org.openobservatory.ooniprobe.shared.test'
compileSdk 33

defaultConfig {
minSdk 21
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
flavorDimensions = ['testing', 'license']
productFlavors {
stable {
dimension 'testing'
}
experimental {
dimension 'testing'
}
dev {
dimension 'testing'
}

fdroid {
dimension 'license'
}
full {
dimension 'license'
}
}
}

dependencies {
implementation project(":engine")
implementation project(":app")

// Dependency Injection (https://dagger.dev/)
implementation 'com.google.dagger:dagger:2.36'
annotationProcessor 'com.google.dagger:dagger-compiler:2.36'

// Database Library (https://github.com/agrosner/DBFlow)
implementation 'com.github.Raizlabs.DBFlow:dbflow-core:4.2.4'
implementation 'com.github.Raizlabs.DBFlow:dbflow:4.2.4'
annotationProcessor 'com.github.Raizlabs.DBFlow:dbflow-processor:4.2.4'

// Gson Serialization Library (https://github.com/google/gson)
implementation 'com.google.code.gson:gson:2.8.9'

implementation 'com.github.blocoio:faker:1.2.8'
implementation 'commons-io:commons-io:2.6'

// Networking Library (https://square.github.io/retrofit/)
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.squareup.okhttp3:logging-interceptor:4.9.1'

implementation 'androidx.appcompat:appcompat:1.6.1'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}
4 changes: 4 additions & 0 deletions shared-test/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

</manifest>

0 comments on commit eca92d2

Please sign in to comment.