avito-tech/avito-android

Should we abandon testFixtures usage?

dsvoronin opened this issue · 3 comments

There is a problem that really hurts our productivity:

# we use testFixtures, and it has problems when project includes android modules
# temporary set this to false in `~/.gradle/gradle.properties` to work with modules that uses testFixtures as a workaround
# https://issuetracker.google.com/issues/139438142
# https://docs.gradle.org/current/userguide/java_testing.html#sec:java_test_fixtures
# You can also use Android Studio to work with project, it seems like it has no such problem

Should we drop it for more straightforward approach, at least temporary?

First thing comes to mind is just place fixtures in runtimeClasspath and package it this regular code?
It looks dirty, but we can use some additional instruments to point out it's "testing only" purpose.
Like maybe https://kotlinlang.org/docs/reference/opt-in-requirements.html custom annotation, or maybe you know better ways.

What about an old and straightforward solution with standalone modules?

What about an old and straightforward solution with standalone modules?

well, its better in any way than my variant

only thing i struggle with is understanding the dependencies in separate test modules, but i'm in

Test fixtures are coming to AGP 7.0