android / architecture-samples

A collection of samples to discuss and showcase different architectural tools and patterns for Android apps.
Apache License 2.0
44.3k stars 11.62k forks source link

Project uses outdated approach to sharing dependencies between unit and instrumented tests #910

Closed dturner closed 1 year ago

dturner commented 1 year ago

Using a sharedTest folder is no longer the recommended approach to sharing code between unit and instrumented tests. It's also pretty confusing in the Project explorer -> Android view to see where to add a new test, since the sharedTest folder just shows up as a duplicate "test" folder:

image

Suggest implementing the recommendation from https://b.corp.google.com/issues/232420188#comment19 which is to create a module containing shared test code. This results in a clearer structure:

image

dturner commented 1 year ago

Note that after #911 is merged MainCoroutineRule will show in red inside TasksDaoTest as the indexer won't index the sharedTest folder. This is another reason to create a separate test module.