Grails 无法从命令行运行单个测试规范

Grails 无法从命令行运行单个测试规范,grails,gradle,Grails,Gradle,发行时 grails test-app PostIntegrationSpec 从命令行中,我得到以下错误: :test FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':test'. > No tests found for given includes: [PostIntegrationSpec] * Try: Run with --sta

发行时

grails test-app PostIntegrationSpec
从命令行中,我得到以下错误:

:test FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':test'.
> No tests found for given includes: [PostIntegrationSpec]

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 6.115 secs 
| Tests FAILED Test execution failed
测试就在那里,如果通过IntelliJ的JUnit运行测试,它们就会成功运行。此外,grails测试应用程序集成工作正常。我想gradle可能会有问题,但现在仍然无法找到问题所在。可能是错误的插件

我使用的是一个开箱即用的grails创建应用程序配置,并且

| Grails Version: 3.1.9
| Groovy Version: 2.4.7
| JVM Version: 1.8.0_25
一种方法是

./gradlew iT --tests *PostIntegration*

从命令行运行测试时,您需要包括该包:

grails test-app com.example.PostIntegrationSpec

谢谢,我试过了。但是gradle命令发出的Hanks似乎有问题。那是为了我。我想了解这个问题though@thomi如果测试是在
src/integration test/groovy
下定义的,并且出于某种原因确实想使用
grails测试应用程序
,那么可以使用
grails测试应用程序-integration posintegrationspec
grails测试应用程序-integration posintegration