unbroken-dome / gradle-testsets-plugin

A plugin for the Gradle build system that allows specifying test sets (like integration or acceptance tests).
MIT License
230 stars 50 forks source link

Test sets that import test library sets fail to compile in Intellij IDEA #95

Closed markslater closed 4 years ago

markslater commented 5 years ago

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:

testSets {
    libraries { testInfrastructure }
    unitTest {
        imports libraries.testInfrastructure
    }
}

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.