Rethinking settings propagation to inner test modules #3463
Replies: 5 comments 1 reply
-
I guess the question is what should we propagate or not? Like Maybe we just need to make it easier to opt out of propagating things we don't want? e.g. |
Beta Was this translation helpful? Give feedback.
-
There was a question on Gitter recently touching the same topic:
I think we need two kind of |
Beta Was this translation helpful? Give feedback.
-
I see two variants. Implement it in the inner traitWe would need to provide an accessor the the outer settings, so users can use them if needed. Downside is, that we can't easily control it via shared modules which typically handle the outer level. Implement in the outer traitThis makes sharing the setup easier, since we support moving common setups into shared modules. We could have a Downside is, we get yet another location where tests are configured. And since the test modules are also ConsiderationsWe could split |
Beta Was this translation helpful? Give feedback.
-
I'm not that much of a fan of having |
Beta Was this translation helpful? Give feedback.
-
So, the actual issue is, that once a more complex How about introducing an additional configuration target for compiler options dedicated to this case and not automatically ineriting the value of the outer module? It could be FTR, we have a similar concept with compiler plugin provision in |
Beta Was this translation helpful? Give feedback.
-
While implementing and testing #3460, I discovered a downside of our current inner test sub-module approach. Since the inner
JavaTests
trait automatically initializes it's compiler setup from its outer module (e.g.def javacOptions = T{ outer.javacOptions() }
), compiler plugins likeerror-prone
are automatically applied to all test sources. It's rather hard to later disable it in the actual modules, esp. if othertrait
s contribute to the configuration too. But disabling it in tests is most likely what users want, since test typically use bad code practices for some reasons, e.g. ignoring return values, self-comparisions, static initializations.Therefore, we should find a way to better handle it. We could make inheriting optional/configurable. Or provide a dedicated
testJavacOptions
to contain options to forward to tests.Originally posted by @lefou in #3460 (comment)
Beta Was this translation helpful? Give feedback.
All reactions