Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency Updates - Android Test Batch #17558

Closed
3 of 4 tasks
ParaskP7 opened this issue Nov 29, 2022 · 7 comments · Fixed by #17663
Closed
3 of 4 tasks

Dependency Updates - Android Test Batch #17558

ParaskP7 opened this issue Nov 29, 2022 · 7 comments · Fixed by #17663

Comments

@ParaskP7
Copy link
Contributor

ParaskP7 commented Nov 29, 2022

Parent #17551

This issue is about updating all Android Test related dependencies for the whole project.

This Android Test batch contains the following 3 dependencies:

@peril-wordpress-mobile
Copy link

Fails
🚫

Please add a type label to this issue. e.g. '[Type] Enhancement'

Generated by 🚫 dangerJS

2 similar comments
@peril-wordpress-mobile
Copy link

Fails
🚫

Please add a type label to this issue. e.g. '[Type] Enhancement'

Generated by 🚫 dangerJS

@peril-wordpress-mobile
Copy link

Fails
🚫

Please add a type label to this issue. e.g. '[Type] Enhancement'

Generated by 🚫 dangerJS

@ParaskP7 ParaskP7 mentioned this issue Nov 29, 2022
50 tasks
@ParaskP7
Copy link
Contributor Author

✅ The latest stable version of screengrabVersion is 2.1.1 (see sonatype). As such, this item is now marked as complete.

@ParaskP7
Copy link
Contributor Author

ParaskP7 commented Dec 5, 2022

FYI: As part of this #17605 PR the main WireMock related apacheHttpClientAndroidVersion version got moved to the test section and renamed to wiremockHttpClientVersion (see commit).

Cc @oguzkocer

@oguzkocer
Copy link
Contributor

The most recent wiremockHttpClientVersion (org.apache.httpcomponents:httpclient-android) in Maven Central is 4.3.5.1 which is the version we use at the time of this comment. So, we can mark that one as done.

Here is a screenshot showing that we are fetching this dependency from Maven Central:

Screen Shot 2022-12-12 at 1 50 55 PM

@ParaskP7 ParaskP7 reopened this Dec 13, 2022
@ParaskP7 ParaskP7 assigned ParaskP7 and unassigned oguzkocer Dec 20, 2022
@ParaskP7
Copy link
Contributor Author

❌ After trying to update wiremockVersion to either the latest 2.35.0 or even 3.0.0-beta-2 version, the update proved much more complicated for it to be tackled just as part of this dependency update work.

  1. First and foremost, updating to 2.35.0 required the app to be on a minSdkVersion = 26 while we are currently at 24, see error: com.android.tools.r8.internal.a2: MethodHandle.invoke and MethodHandle.invokeExact are only supported starting with Android O (--min-api 26)
  2. Then, the WireMock dependency coordinates seems to have been long moved from com.github.tomakehurst:wiremock (latest being the 2.27.2) into com.github.tomakehurst:wiremock-jre8 (latest being 2.35.0). However, now, with the introduction of the newest beta (3.0.0-beta-2), the dependency coordinates are once more moved back to com.github.tomakehurst:wiremock. This make me think that the project is taking yet another turn and that we better wait until the 3.0.0 is ready before making any move on it.
  3. By updating to either 2.35.0 or 3.0.0-beta-2, lots of compilation errors start popping-up. Those are mainly related to AssetFileSource.java and the BaseTest.java file, which is using that and the UnlocalizedDateHelper inner class to initialize a WireMockRule.

Suggestion (💡): When the project allows for this update (minSdkVersion = 26) and the newest stable library version becomes available (3.0.0-beta-2), my recommendation would be to completely start over with WireMock, from zero. Then, after setting up the default WireMock configuration and verifying it is working, we should build any custom features needed for our mocking framework to work on top of that newest version of WireMock. With that work, we might even consider removing the need for the mocks module altogether and move its assets into the WordPress module, under the androidTest source-set.

My hope is that with the above move a lot of mocks related complexity will be alleviated and the WireMock setup will be revisited. We might even consider re-evaluating this tool, maybe evaluate other tools and even migrate to such other tool (ie. MockWebServer). Until then, I recommend we hold-off on updating this library in order to avoid spending any unnecessary time fixing something that is already working okay for our needs. 🤔

Cc @oguzkocer @pachlava

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment