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
{{ message }}
Repository navigation
Is there a folder layout convention for test sources files and test resources files? #160
In https://gradle.github.io/playframework/#project_layout, it describes a /test folder to hold test files. But didn't mention about test sources files and test resources files.
Is there a convention for test resources files?
I see some play apps are having /test/ folder to contain test sources files and /test/resources to contain test resources files, I am wondering if this is a good approach and if it is following gradle play best practice convention.
In my understanding a normal approach is to have different dedicated folder for test sources files and test resources files, e.g. /test/java for test sources files and /test/resources/ for test resources files.
We came across this as well when migrating from sbt to gradle.
In sbt, test/resources is reserved for testing resources, however during migration we found that our test resources weren't being picked up while running tests. According to running
sourceSets.test {
println(resources.srcDirs)
}
we see that by default the test resources directory is set to src/test/resources.
Activity
Sineaggi commentedon Jan 6, 2022
We came across this as well when migrating from sbt to gradle.
In sbt,
test/resourcesis reserved for testing resources, however during migration we found that our test resources weren't being picked up while running tests. According to runningsourceSets.test { println(resources.srcDirs) }we see that by default the test resources directory is set to
src/test/resources.mwxxhdb commentedon May 26, 2022
sourceSets { test { resources { srcDirs= ["test/resources"] } } }