Remove some of the unused dependencies for tests in each module#548
Conversation
tonidero
left a comment
There was a problem hiding this comment.
This is the result of a first pass. It's possible we can remove more dependencies, but didn't want to spend much more time on this.
| testImplementation 'androidx.test.ext:junit:1.1.1' | ||
| testImplementation 'org.robolectric:robolectric:4.3' | ||
| testImplementation 'com.squareup.okhttp3:mockwebserver:4.2.0' | ||
| testImplementation 'org.mockito:mockito-core:3.0.0' |
There was a problem hiding this comment.
Mockito seems to be unused so I removed it on all the modules
| androidTestImplementation 'androidx.test:rules:1.3.0' | ||
| androidTestImplementation 'androidx.test:core-ktx:1.3.0' | ||
| androidTestImplementation 'androidx.test.ext:junit-ktx:1.1.2' | ||
| androidTestImplementation 'org.assertj:assertj-core:3.13.2' |
There was a problem hiding this comment.
We don't have instrumentation tests on this module, so I removed all of these. Did the same for some of the other modules. Only module with instrumentation tests is the integration-tests module
| implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion" | ||
| implementation 'androidx.core:core-ktx:1.3.1' | ||
| implementation 'androidx.appcompat:appcompat:1.2.0' | ||
| testImplementation 'junit:junit:4.12' |
There was a problem hiding this comment.
junit4 should already be added by some of the other dependencies (I believe robolectric adds it)
| testImplementation 'androidx.test:rules:1.4.0' | ||
| testImplementation 'androidx.test.ext:junit:1.1.3' | ||
| testImplementation 'org.robolectric:robolectric:4.6.1' | ||
| testImplementation 'com.squareup.okhttp3:mockwebserver:4.2.0' |
There was a problem hiding this comment.
mockwebserver is only used on the common module, so I just left it on that module.
| } | ||
| } | ||
|
|
||
| dependencies { |
There was a problem hiding this comment.
I removed the dependencies block from the library.gradle since these are added to every module, even those that don't need it. I think it's fine to have some of the other config in this gradle file (like flavors, java version,...). However, I feel that dependencies belong on each module. Lmk if there are any concerns
| testImplementation 'androidx.test:runner:1.4.0' | ||
| testImplementation 'androidx.test:rules:1.4.0' | ||
| testImplementation 'androidx.test.ext:junit:1.1.3' | ||
| testImplementation 'org.robolectric:robolectric:4.6.1' |
There was a problem hiding this comment.
Note that the versions on the library.gradle file were higher in general than the ones on each module. I believe when there is a conflict of versions, gradle will pick the one with the highest version. So I used the higher version libraries for all the modules. These are all test dependencies so it shouldn't affect users in any case
| ext.testLibrariesVersion = "1.4.0" | ||
| ext.testJUnitVersion = "1.1.3" | ||
| ext.robolectricVersion = "4.6.1" | ||
| ext.mockkVersion = "1.10.0" | ||
| ext.assertJVersion = "3.13.2" |
Description
We are adding a bunch of dependencies that are unused on each module. This PR removes some of the easier to remove dependencies. I also removed all the dependencies from
library.gradlesince those are imported on every module. I feel that dependencies belong to each module but lmk if you think otherwise.