空手道 - 加特林 - 失败的请求不会显示为 KO
Karate - gatling - failed requested are not shown as KO
我正在使用 karate 0.9.6,maven gatling 插件 - 3.1.0(也尝试使用 3.0.2 - 结果相同)
模拟完成后,我看到以下统计数据
> Global (OK=33 KO=0 )
> POST /token (OK=10 KO=0 )
> POST /endpoint1 (OK=10 KO=0 )
> POST /endpoint2 (OK=8 KO=0 )
> POST /endpoint3 (OK=3 KO=0 )
> GET /endpoint4 (OK=1 KO=0 )
> POST /endpoint5 (OK=1 KO=0 )
在这种情况下,我应该在全局 (OK + KO) 中看到 60 个请求,因为这是已执行的请求数量,但只有 33 个,所以 gatling 似乎没有考虑失败的测试。查看控制台我可以看到失败的请求
我的场景是这样的
Scenario: Perf test
Given call read('classpath:some-reusable.feature') {args} #calling first 3 requests (token, endpoint1, endpoint2)
When call read('classpath:another-reusable.feature') {arg} #calling endpoint3 to endpoint5
Then match assertions
以上场景在正常情况下完美运行。
这里重要的是,两个可重用功能都调用“通用”功能,其中定义了所有可能的 API 调用,因此结构是
scr/java/test
|
|__api
| |_generic1.feature (contains defined paths along with path to requests folder and HTTP methods)
| |_...
| |_genericN.feature
|
|__reusables
| |_resubale1.feature (contains call read('classpath:api/genericN.feature@operation') and some
| basic assertions like match responseStatus == correctStatus)
|
|__scenarios
|_myTest.feature (contains call read('classpath:reusables/reusable1.feature') and other assertions that are required in test)
我创建了另一个场景,其中包含所有调用(因此没有重复使用其他功能的场景)
Scenario: Perf test
Given path '/somePath'
When method get
Then match assertions
Given path '/somePath1'
When method post
Then match assertions
它开始按预期工作
所以,问题是 - 是否可以使其与现有结构一起使用?还是我需要更改 approach/create 单独的场景?
我们正在积极开发下一个版本,所以如果您可以尝试一下,那将会有所帮助:https://github.com/intuit/karate/wiki/1.0-upgrade-guide
最近还记录了一个可能相关的问题:https://github.com/intuit/karate/issues/1382
所以 - 如果您在开发版本中看到同样的问题,我请求您遵循这个过程,以便我们获得最简单的复制方法:https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue - 我们可以看看。
当然,如果您能参与调查并贡献代码,那就再好不过了!
我正在使用 karate 0.9.6,maven gatling 插件 - 3.1.0(也尝试使用 3.0.2 - 结果相同)
模拟完成后,我看到以下统计数据
> Global (OK=33 KO=0 )
> POST /token (OK=10 KO=0 )
> POST /endpoint1 (OK=10 KO=0 )
> POST /endpoint2 (OK=8 KO=0 )
> POST /endpoint3 (OK=3 KO=0 )
> GET /endpoint4 (OK=1 KO=0 )
> POST /endpoint5 (OK=1 KO=0 )
在这种情况下,我应该在全局 (OK + KO) 中看到 60 个请求,因为这是已执行的请求数量,但只有 33 个,所以 gatling 似乎没有考虑失败的测试。查看控制台我可以看到失败的请求
我的场景是这样的
Scenario: Perf test
Given call read('classpath:some-reusable.feature') {args} #calling first 3 requests (token, endpoint1, endpoint2)
When call read('classpath:another-reusable.feature') {arg} #calling endpoint3 to endpoint5
Then match assertions
以上场景在正常情况下完美运行。
这里重要的是,两个可重用功能都调用“通用”功能,其中定义了所有可能的 API 调用,因此结构是
scr/java/test
|
|__api
| |_generic1.feature (contains defined paths along with path to requests folder and HTTP methods)
| |_...
| |_genericN.feature
|
|__reusables
| |_resubale1.feature (contains call read('classpath:api/genericN.feature@operation') and some
| basic assertions like match responseStatus == correctStatus)
|
|__scenarios
|_myTest.feature (contains call read('classpath:reusables/reusable1.feature') and other assertions that are required in test)
我创建了另一个场景,其中包含所有调用(因此没有重复使用其他功能的场景)
Scenario: Perf test
Given path '/somePath'
When method get
Then match assertions
Given path '/somePath1'
When method post
Then match assertions
它开始按预期工作
所以,问题是 - 是否可以使其与现有结构一起使用?还是我需要更改 approach/create 单独的场景?
我们正在积极开发下一个版本,所以如果您可以尝试一下,那将会有所帮助:https://github.com/intuit/karate/wiki/1.0-upgrade-guide
最近还记录了一个可能相关的问题:https://github.com/intuit/karate/issues/1382
所以 - 如果您在开发版本中看到同样的问题,我请求您遵循这个过程,以便我们获得最简单的复制方法:https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue - 我们可以看看。
当然,如果您能参与调查并贡献代码,那就再好不过了!