Skip to content

TestFixtures refactoring - #1515

Open
SimonMarquis wants to merge 7 commits into
android:mainfrom
SimonMarquis:test-fixtures-agp-8.5.0
Open

SimonMarquis wants to merge 7 commits into
android:mainfrom
SimonMarquis:test-fixtures-agp-8.5.0

Conversation

@SimonMarquis

@SimonMarquis SimonMarquis commented Jun 23, 2024 •

Copy link
Copy Markdown
Contributor

Support for Kotlin TestFixtures on Android modules was added in AGP 8.5.0!

A lot more cleanup could be done, especially on test classes that redefine over and over again topics, newsResources, etc.

This is a new take on this PR:

To close this issue from 2022:


The main changes are split by commits:

  • AGP 8.5.0 update with enableTestFixturesKotlinSupport flag
  • :core:data-test, :sync:test and :core:datastore-test have been merged as testFixtures sourceSet of their respective module.
  • :core:testing content has been migrated when possible to already existing modules.
  • :sync:work has been move to it's parent :sync module that was previously empty.

  • Regenerate graphs
  • Wait for android.experimental.enableTestFixturesKotlinSupport to promote from experimental?
  • Wait for KSP on testFixtures?

@keyboardsurfer

Copy link
Copy Markdown
Member

This PR has a lot of conflicts. Do you want to continue and resolve these, @SimonMarquis ?

@SimonMarquis

Copy link
Copy Markdown
Contributor Author

@keyboardsurfer yes, I'd love to see this integrated in the repository at some point (the initial PoC was on Nov 19, 2022 😅).
But before I re-start working on this and fix conflicts, can you tell me if this is definitely something that will be merged in the repository or not?
Thanks

@keyboardsurfer

Copy link
Copy Markdown
Member

Good to hear that you're interested in picking this back up again. @JoseAlcerreca can you chime in on the likelihood of this PR being integrated into main?

@dturner

dturner commented Dec 19, 2024

Copy link
Copy Markdown
Collaborator

Just to add my 2 pence, I am strongly in favour of anything that tidies up our test architecture and TestFixtures seems to do that.

@emartynov emartynov left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super. LGTM. Just a couple of questions came here.

Comment thread core/model/build.gradle.kts
@SimonMarquis

Copy link
Copy Markdown
Contributor Author

Just to add my 2 pence, I am strongly in favour of anything that tidies up our test architecture and TestFixtures seems to do that.

Does that mean "yes", or "maybe"? 😅

@SimonMarquis
SimonMarquis marked this pull request as draft September 21, 2025 08:16
@SimonMarquis
SimonMarquis marked this pull request as ready for review September 21, 2025 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants