task runGatling(type: JavaExec) {
description = 'Test load the Spring Boot web service with Gatling'
group = 'Load Test'
classpath = sourceSets.test.runtimeClasspath
jvmArgs = [
// workaround for https://github.com/gatling/gatling/issues/2689
"-Dgatling.core.directory.binaries=${sourceSets.test.output.classesDirs.toString()}",
"-Dlogback.configurationFile=${logbackGatlingConfig()}"
]
main = 'io.gatling.app.Gatling'
args = [
'--simulation', 'com.mypackage.loadtesting.Simulation',
'--results-folder', "${buildDir}/gatling-results",
'--binaries-folder', sourceSets.test.output.classesDirs.toString() // ignored because of above bug
]
}
def logbackGatlingConfig() {
return sourceSets.test.resources.find { it.name == 'logback-gatling.xml' };
}
但是跑步的时候
runGatling
,我发现以下错误:
> Task :runGatling FAILED
Caching disabled for task ':runGatling' because:
Caching has not been enabled for the task
Task ':runGatling' is not up-to-date because:
Task has not declared any outputs despite executing actions.