You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, dependencies declared in testFixturesRuntimeOnly configuration (with the java-test-fixtures plugin) aren't propagated to the testRuntimeClasspath (I haven't tested but I suppose that's also the case when importing the project's test fixtures in another project).
Expected Behavior
Dependencies declared as testFixturesRuntimeOnly are propagated to the runtime classpath of anything that uses the test fixtures library.
Current Behavior
Dependencies declared as testFixturesRuntimeOnly are only available in the project's testFixturesRuntimeClasspath (which almost nobody ever use I suppose).
Context
I have unit and functional tests (using separate source sets) and want to share a JUnit 5 ArgumentProvider between them, so I thought about using the java-test-fixtures. I'm declaring the junit-jupiter-api and junit-jupiter-params as testFixturesApi, and that works well. But declaring the junit-jupiter-engine as testFixturesRutimeOnly doesn't make it available at runtime to the test and functionalTest tasks (through in the testRuntimeClasspath and functionalTestRuntimeClasspath, respectively).
I'm writing a new plugin (to share dependency capabilities to detect conflicts in logging frameworks; see #11300) and started with the sample project from gradle init from Gradle 5.6.4, then I added the java-test-fixtures plugin.
As a workaround, because functionalTestRuntimeOnly extends testRuntimeOnly, I could declare junit-jupiter-engine as testRuntimeOnly; but I was actually thinking about removing that inheritance (extension) between the source sets / configurations, specifically because they ought to be inherited (as dependencies) through the test fixtures.
I could also declare it as testFixturesImplementation even though I won't actually use it from the test fixture's code.
There must be other use-cases where you'd want to add a runtime dependency to test fixtures. Also, the testFixturesRuntimeOnly and testFixturesRuntimeClasspath configurations currently exist and are properly provisioned (looking at gradle dependencies), but are never actually used. I also noticed that testFixturesApiElements and testFixturesRuntimeElements configurations exist, but they are empty.
The text was updated successfully, but these errors were encountered:
(fwiw, I backed up due to #11094, and am now using nebula.integtest to wire up my functional tests' source set: the shared code is in the test source set, and available from the integTest source set; not ideal but it works)
Currently, dependencies declared in
testFixturesRuntimeOnly
configuration (with thejava-test-fixtures
plugin) aren't propagated to thetestRuntimeClasspath
(I haven't tested but I suppose that's also the case when importing the project's test fixtures in another project).Expected Behavior
Dependencies declared as
testFixturesRuntimeOnly
are propagated to the runtime classpath of anything that uses the test fixtures library.Current Behavior
Dependencies declared as
testFixturesRuntimeOnly
are only available in the project'stestFixturesRuntimeClasspath
(which almost nobody ever use I suppose).Context
I have unit and functional tests (using separate source sets) and want to share a JUnit 5
ArgumentProvider
between them, so I thought about using thejava-test-fixtures
. I'm declaring thejunit-jupiter-api
andjunit-jupiter-params
astestFixturesApi
, and that works well. But declaring thejunit-jupiter-engine
astestFixturesRutimeOnly
doesn't make it available at runtime to thetest
andfunctionalTest
tasks (through in thetestRuntimeClasspath
andfunctionalTestRuntimeClasspath
, respectively).I'm writing a new plugin (to share dependency capabilities to detect conflicts in logging frameworks; see #11300) and started with the sample project from
gradle init
from Gradle 5.6.4, then I added thejava-test-fixtures
plugin.As a workaround, because
functionalTestRuntimeOnly
extendstestRuntimeOnly
, I could declarejunit-jupiter-engine
astestRuntimeOnly
; but I was actually thinking about removing that inheritance (extension) between the source sets / configurations, specifically because they ought to be inherited (as dependencies) through the test fixtures.I could also declare it as
testFixturesImplementation
even though I won't actually use it from the test fixture's code.There must be other use-cases where you'd want to add a runtime dependency to test fixtures. Also, the
testFixturesRuntimeOnly
andtestFixturesRuntimeClasspath
configurations currently exist and are properly provisioned (looking atgradle dependencies
), but are never actually used. I also noticed thattestFixturesApiElements
andtestFixturesRuntimeElements
configurations exist, but they are empty.The text was updated successfully, but these errors were encountered: