【发布时间】:2014-10-29 03:37:58
【问题描述】:
我正在尝试通过 Gatling 运行一个简单的性能测试。我使用 maven 来运行该过程。为了在代码更改破坏我的 gatling-tests 时轻松获取,我希望 maven-build 失败。我确保在我的 pom.xml 文件中添加<failOnError>true</failOnError>。
我当前的脚本是这样的:
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)
}
我使用mvn clean gatling:execute 使用maven(带有gatling-maven-plugin)运行构建,这将始终成功。 (即使服务器没有运行)。我正在寻找一种方法来确保当 gatling-test 失败(或失败百分比过高)时 maven 构建失败。
【问题讨论】:
标签: scala maven maven-plugin gatling