Test.single does not function without full project path when buildSrc exists

When I am in a sub-project directory, I can execute a single test without specifying the entire project path id.

gradle test -Dtest.single=SomeTest

However, when a buildSrc directory exists, it executes the tests against buildSrc before the directory’s project and reports an error when it cannot find the test pattern specified in buildSrc. It is a little misleading when you are trying to understand why it reports cannot find the test pattern specified and you assume it is talking about the local project.

It actually is a little worse than that. Even when I specify the entire project path id, I cannot run a single test because it attempts to match buildSrc first.

Perhaps there is a way to exclude tests from buildSrc when running your project scripts. It seems a little counter intuitive to always run the tests for buildSrc when you are trying to run the tests for a project.

‘-Dtest.single’ is superceded by the ‘–tests’ command line parameter (see Gradle User Guide). Can you verify if that works better for you? Also, please make sure to try with the latest Gradle version.