-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
[FR]: Migrate project to testFixtures #451
Comments
This looks like an interesting addition, however I'd like to wait for support by Jetbrains (through https://youtrack.jetbrains.com/issue/KT-50667) before adding this to the project. |
Just to clarify, testFixture are officially supported. |
Blocked by this issue: https://issuetracker.google.com/issues/259523353 |
For anyone interested in updates, I've pushed a new PR that enables "almost" proper Android test fixtures thanks to AGP 8.5.0: |
Is there an existing issue for this?
Describe the problem
Even though test fixtures are not completely supported by the Android Gradle Plugin (specifically with Kotlin sources) we can still benefit a lot from this feature on JVM modules, and this should definitely be part of Android dev's best practices!
Describe the solution
This would remove a lot of code duplication and prevent unecessary hacks like shared
sourcesSet
and gradle fixturesmodule
s that could impact build times, especially in large code bases.In the current state of the code base, it sheds ~1000 lines of code.
At my current company, we chose to use
kotlin.Random
as receiver for these testFixtures to make them more explicit about their behavior (being random by default), but this can be changed here if needed.Next steps will be to migrate:
:core:data-test
,:core:datastore-test
,:sync-test
FakeStringDecoder
,TestAuthorsRepository
,TestNewsRepository
,TestTopicsRepository
,TestUserDataRepository
These next steps could already be done, but would need to rewrite classes in Java to be visible, and I don't think this is a path we want to go for this project.
So I guess we'll wait for the full Android/Kotlin support.
Additional context
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: