Code in the unitTest source set that depends on code in the testInfrastructure source set will compile in Gradle, but produces errors in IDEA because IDEA considers test code in testInfrastructure to be out of scope for test code in the unitTest source set. This can be temporarily fixed by marking the testInfrastructure source directory as a '[production] sources root', but this will revert back on a subsequent check out.
Source sets that are declared as libraries are marked as test sources in Intellij IDEA, which then causes their code to be out of scope for test sets.
For example, take the following declaration:
Code in the
unitTest
source set that depends on code in thetestInfrastructure
source set will compile in Gradle, but produces errors in IDEA because IDEA considers test code intestInfrastructure
to be out of scope for test code in theunitTest
source set. This can be temporarily fixed by marking thetestInfrastructure
source directory as a '[production] sources root', but this will revert back on a subsequent check out.