我正在尝试通过 Gatling 运行一个简单的性能测试。我使用 maven 来运行该过程。为了在代码更改破坏我的 gatling-tests 时轻松获取,我希望 maven-build 失败。我已确保添加<failOnError>true</failOnError>
到我的 pom.xml 文件中。
我当前的脚本是这样的:
class MySim extends Simulation {
val httpProtocol = http.baseURL("http://localhost:8080")
val scn = scenario("Test")
.exec(http("request_1")
.get("""/helloworld""")
.check(status.is(200))
)
setUp(scn.inject(ramp(1 users) over (1 seconds))).protocols(httpProtocol)
}
我使用 maven(使用 gatling-maven-plugin)运行构建,mvn clean gatling:execute
它总是会成功。(即使服务器没有运行)。我正在寻找一种方法来确保当 gatling-test 失败(或失败百分比过高)时 maven 构建失败。