Status Update
Comments
uc...@google.com <uc...@google.com>
ar...@google.com <ar...@google.com> #2
This is a good idea and definitely worth investigating.
I think there's something to be said about what scope these coroutines would run in, but it should be possible to pass it back from adapter internally.
ma...@gmail.com <ma...@gmail.com> #3
Thanks for the suggestion!
sa...@gmail.com <sa...@gmail.com> #4
Using the scope of the adapter in case of a configuration change would cancel the coroutine, and the cachedIn operator wouldn't cache the mapped value, and some operations would have to be done multiple times.
Maybe using the scope on the producing side of the PageEvents, like in PageFetcher, could be an option.
co...@gmail.com <co...@gmail.com> #5
Branch: androidx-master-dev
commit debb2cb10010710d92c0da93b7ea6870fbc4d834
Author: Dustin Lam <dustinlam@google.com>
Date: Fri Jun 26 19:45:32 2020
Add suspend version of transform functions
RelNote: "Made existing PagingData operators accept suspending methods
and introduced new mapSync, flatMapSync, and filterSync non-suspending
operators for Java users. The existing transformation methods have been
moved to extension functions so Kotlin users will need to import them."
Fixes: 159983232
Test: ./gradlew paging:paging-common:test
Change-Id: I342390a7b1eb98ac87072998744a9e46c99a1000
M paging/common/api/3.0.0-alpha03.txt
M paging/common/api/current.txt
M paging/common/api/public_plus_experimental_3.0.0-alpha03.txt
M paging/common/api/public_plus_experimental_current.txt
M paging/common/api/restricted_3.0.0-alpha03.txt
M paging/common/api/restricted_current.txt
M paging/common/src/main/kotlin/androidx/paging/PageEvent.kt
M paging/common/src/main/kotlin/androidx/paging/PagingData.kt
M paging/common/src/main/kotlin/androidx/paging/Separators.kt
M paging/common/src/test/kotlin/androidx/paging/PageEventTest.kt
M paging/common/src/test/kotlin/androidx/paging/SeparatorsTest.kt
M paging/integration-tests/testapp/src/main/java/androidx/paging/integration/testapp/v3/V3Activity.kt
M paging/samples/src/main/java/androidx/paging/samples/CachedInSample.kt
M paging/samples/src/main/java/androidx/paging/samples/InsertSeparatorsUiModelSample.kt
M paging/samples/src/main/java/androidx/paging/samples/java/InsertSeparatorsJavaUiModelSample.java
ol...@gmail.com <ol...@gmail.com> #6
ce...@gmail.com <ce...@gmail.com> #7
co...@gmail.com <co...@gmail.com> #8
ol...@gmail.com <ol...@gmail.com> #9
ar...@google.com <ar...@google.com> #10
Thanks for the feedback. Currently there are no plans to support JUnit5 in Android Studio.
au...@gmail.com <au...@gmail.com> #11
Intellij already supports JUnit5. I think this is relevant to AGP and Android's UI testing toolchain.
sa...@gmail.com <sa...@gmail.com> #12
hr...@gmail.com <hr...@gmail.com> #13
There may be legitimate reasons for that decision. Might the developer community get to know what those reasons are?
co...@gmail.com <co...@gmail.com> #14
support via third party plugin. If you serous about Unit Testing on Android, let us know what the plans are and where you going with it or I need to report to my company it's better for us to build our own custom test Api since we not getting any direction from Google.
I find it pathetic Google is pushing Junit4 from 2006, its 2021 now!
sa...@gmail.com <sa...@gmail.com> #15
lu...@gmail.com <lu...@gmail.com> #16
As Google clearly don't care for developers. Perhaps I should buy VisualStudio/Xamarin and use Microsoft tools as alternative, like NUnit, sure it must have a good support for it, as their focus is on developer tools, I guess they would care more about complaints, or at least admit they won't be putting resources on it and actually close the thread, so we can look for alternatives.
By this point, I don't think Android will ever support JUnit5. We developers should do that on our own.
sz...@gmail.com <sz...@gmail.com> #17
thanks
kl...@gmail.com <kl...@gmail.com> #18
By the way, JUnit 5 works well with unit tests. The only necessay implementation steps are adding this into the modules's build.gradle:
- Enabling junit platform
tasks.withType(Test) { useJUnitPlatform()}
- Adding Junit dependency
dependencies { implementation("org.junit.jupiter:junit-jupiter:5.7.2") }
sz...@gmail.com <sz...@gmail.com> #19
I can manage that with mannodermaus as well but still interested why this did not happened yet.
wi...@gmail.com <wi...@gmail.com> #20
to...@yahoo.com <to...@yahoo.com> #21
cp...@gmail.com <cp...@gmail.com> #22
at...@gmail.com <at...@gmail.com> #23
id...@gmail.com <id...@gmail.com> #24
my...@gmail.com <my...@gmail.com> #25
md...@gmail.com <md...@gmail.com> #26
an...@gmail.com <an...@gmail.com> #27
I hear the following sentence at almost every Google I/O: "We listen to our developers!". Well, I would really like Google to listen to us on this one.
hf...@gmail.com <hf...@gmail.com> #28
mm...@gmail.com <mm...@gmail.com> #30
jg...@gmail.com <jg...@gmail.com> #31
vi...@veeva.com <vi...@veeva.com> #32
+1
ma...@gmail.com <ma...@gmail.com> #33
[Deleted User] <[Deleted User]> #34
pe...@gmail.com <pe...@gmail.com> #35
The ideal scenario, if possible, would be to have something, that doesn't depend on specific testing library, like JUnit
in this case.
ma...@betterme.world <ma...@betterme.world> #36
re...@amazon.com <re...@amazon.com> #37
ky...@gmail.com <ky...@gmail.com> #38
rh...@gmail.com <rh...@gmail.com> #39
Hey there, just checking if there has been any updates? Or projected timeline?
hh...@gmail.com <hh...@gmail.com> #40
de...@gmail.com <de...@gmail.com> #41
ar...@google.com <ar...@google.com> #42
We understand that many of you in the Android developer community have been asking for JUnit 5 support when running instrumented tests against your Android projects. We appreciate your passion for staying at the forefront of testing practices and incorporating the latest tools into your development workflow.
The desire to leverage JUnit5's enhanced features and capabilities for Android instrumentation testing is entirely understandable. Therefore, we want to be transparent about the current challenges that prevent us from fully supporting JUnit5 for Android instrumentation tests at this time.
The Roadblocks
The primary hurdle lies in the deep-rooted integration of JUnit4 within the Android testing ecosystem. Our AndroidX Test libraries, Compose Test, and Benchmark libraries all rely heavily on JUnit4's rules and runners. While creating JUnit5-compatible artifacts is technically achievable, there are clear challenges in the process.
To seamlessly support JUnit5, we would need to embark on a substantial undertaking:
- Revamp the Core: Adapt the existing test runner or build a new one to proficiently discover and execute JUnit5 tests.
- Parallel APIs: Develop a parallel set of JUnit5 APIs to mirror the functionality of the current JUnit4-based AndroidX Test APIs (e.g., ActivityScenarioRule).
- Continuous Maintenance: Commit to ongoing maintenance efforts, including adding JUnit5 equivalents for every new API we introduce.
- Robolectric Migration: Assist in migrating the Robolectric framework to support JUnit5, as it's currently tightly coupled with JUnit4.
On top of those reasons, it is important to note that Googleās own internal testing infrastructure relies heavily on these same libraries. We want to maintain a level of uniformity within Googleās own infrastructure, and migrating to JUnit5 APIs will be a large and separate undertaking.
When we evaluated the benefits of JUnit5 against the effort and resources required to do it, both for internal Google testing infrastructure and for the broader Android developer community, we determined it doesnāt offer a big enough improvement for us to do it.
Looking Ahead
We remain committed to closely monitoring the evolving needs of the Android developer community. As the landscape shifts and resources permit, we'll revisit the feasibility of full JUnit5 support for Android instrumentation tests.
In the meantime, we appreciate your understanding and patience as we navigate these complexities.
ar...@google.com <ar...@google.com>
ri...@gmail.com <ri...@gmail.com> #43
de...@gmail.com <de...@gmail.com> #44
ke...@littleblackhat.com <ke...@littleblackhat.com> #45
ad...@rwmobi.uk <ad...@rwmobi.uk> #46
ub...@gmail.com <ub...@gmail.com> #47
No longer addressing technical debt would seem to imply sunsetting Android as far as Google is concerned. I suppose iOS is here to stay, and HarmonyOS will likely be a relevant player in the global market.
to...@yahoo.com <to...@yahoo.com> #48
hypocrisy is rife...
Here is just a single issue were Google tells ALL developers worldwide to change/add-to their code because Google says-so:
I cannot be bothered listing the many-many-many areas where things became "deprecated/replaced" instead of "fixed". i.e. again: all developers to dump certain code and start with an entirely new approach.
I'm sure other people can add similar issues....
de...@gmail.com <de...@gmail.com> #49
Thanks #46 but I'm already contributing to those repos and toolings. In fact, I'd be more than happy to mentor you if you ever want to try doing open source seeing that
ad...@rwmobi.uk <ad...@rwmobi.uk> #50
da...@gmail.com <da...@gmail.com> #51
I also wish junit5 was supported for Android development. However I understand the Android team doesn't have infinite capacity. They can't do everything we want. What they said is simply that the upfront effort to support junit5 and than maintain it is too big for the returned value compared to doing something else that is more important for the community.
It is also quite ridiculous to suggest they fork some community effort. Google, like any big company, has very strict standard with code style and quality, they cannot just take a 3rd party software and fork it.
We are developers, 90% of our job is to chose between trade-offs. You should get this is a trade off and stop with the unreasonable requests. I'm glad they finally answered this ticket even if the outcome is not what I was hoping for.
Be thankful Google Android isn't ignoring you all, they are people, they really thought about this and they were forced to say no because at the end of the day the amount of work their team can deliver is finite.
ri...@gmail.com <ri...@gmail.com> #52
de...@gmail.com <de...@gmail.com> #53
they cannot just take a 3rd party software and fork it.
Robolectric was used to be a community open source project and they merged it into AndroidJUnit4. Dagger is also forked from Square. We have history in the past where taking over open source project has been successful. And Google has recently started embracing open source projects as well, such as deprecating Volley in favor of Retrofit. I don't think code style and quality matters. I do appreciate Google giving us an answer though even though it's not what we want to hear.
Description
There is 3rd party gradle plugin that supports JUnit5: