Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring boot gatlingwithgradle:Task尽管执行了操作,但并没有声明任何输出_Spring Boot_Gradle_Gatling_Scala Gatling - Fatal编程技术网

Spring boot gatlingwithgradle:Task尽管执行了操作,但并没有声明任何输出

Spring boot gatlingwithgradle:Task尽管执行了操作,但并没有声明任何输出,spring-boot,gradle,gatling,scala-gatling,Spring Boot,Gradle,Gatling,Scala Gatling,根据本教程,我尝试在基于gradle的Spring Boot项目中设置gatling: 以下是我写的任务: task runGatling(type: JavaExec) { description = 'Test load the Spring Boot web service with Gatling' group = 'Load Test' classpath = sourceSets.test.runtimeClasspath jvmArgs = [

根据本教程,我尝试在基于gradle的Spring Boot项目中设置gatling:

以下是我写的任务:

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.
@梁乔治是对的,解决了我的问题。谢谢:)

以下是
build.gradle
配置:

plugins {
    id 'scala'
    id "com.github.lkishalmi.gatling" version "3.3.0"
}

dependencies {
    compile 'org.scala-lang:scala-library:2.12.10'
}
模拟文件必须位于目录
src/gatling/simulations


然后运行
gradlew-gatlingRun
命令,它执行负载测试,默认情况下在
build/reports/gatling
目录中生成报告。

为什么不使用?它检查后端可用性?是的,它解决了我的问题:)谢谢