我想一个新的测试用例grails-test-suite-web
子模块grails-core
项目添加到现有的测试org.codehaus.groovy.grails.web.mapping.ReverseUrlMappingTests
。如何使用Gradle在grails-core项目中运行单个测试?
我有运行使用摇篮单个测试用例的一个问题。当我这样做:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':test'.
> Could not find matching test for pattern: ReverseUrlMappingTests
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
这个测试可以在完整的测试周期./gradlew test
运行,但它的浪费时间,当我们想红 - 绿 - 重构只有一个简单的测试:
./gradlew -Dtest.single=ReverseUrlMappingTests :grails-test-suite-web:test
它以结束案件。我也注意到,当我尝试以相同的方式运行spock.lang.Specification子类测试时发生同样的问题。
这是我的问题:是否有可能使用Gradle运行单个grails-core测试?
它的Grails的核心2.4.x
分支克隆
喂杰夫, 感谢您的支持!我没有检查你的建议,它没有工作 - https://gist.github.com/wololock/23bf63e1c855b1df8fbb。我在'build.gradle'中发现了'singleTest'任务 - 使用这个任务的运行测试取得了诀窍。我们应该更新维基页面https://grails.org/GrailsDevEnvironment吗?或者这是一种异常? – 2014-12-01 19:03:06
为什么你有围绕测试模式的引号? – 2014-12-01 19:04:02
'zsh:找不到匹配项:-Dtest.single = **/* ReverseUrlMappingTests *'如果我不带引号运行 – 2014-12-01 19:04:31