Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/jenkins/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
Jenkins在’;它实际上失败了_Jenkins_Jmeter_Jenkins Plugins_Performance Testing_Qa - Fatal编程技术网

Jenkins在’;它实际上失败了

Jenkins在’;它实际上失败了,jenkins,jmeter,jenkins-plugins,performance-testing,qa,Jenkins,Jmeter,Jenkins Plugins,Performance Testing,Qa,我有类似的问题,这阻碍了我。我需要和詹金斯一起进行JMeter测试。但是当JMeter构建实际失败时,Jenkins会验证它是否成功。我想知道我做错了什么,这样当断言失败时jmeter就不会返回fail。 我运行了一个名为jMeter的Windows批处理脚本。以下是方法: 命令行 cd C:\apache-jmeter-3.1\bin jmeter -n -c -t C:\Users\maria\Desktop\Automation\WIP\Test-page.jmx -l C:\Users\

我有类似的问题,这阻碍了我。我需要和詹金斯一起进行JMeter测试。但是当JMeter构建实际失败时,Jenkins会验证它是否成功。我想知道我做错了什么,这样当断言失败时jmeter就不会返回fail。 我运行了一个名为jMeter的Windows批处理脚本。以下是方法:

命令行

cd C:\apache-jmeter-3.1\bin
jmeter -n -c -t C:\Users\maria\Desktop\Automation\WIP\Test-page.jmx -l C:\Users\maria\Desktop\Automation\WIP\Test-page.xml
Created the tree successfully using C:\Users\maria\Desktop\Automation\WIP\Test-page.jmx
Starting the test @ Fri Dec 30 11:05:58 GMT 2016 (1483095958952)
Waiting for possible Shutdown/StopTestNow/Heapdump message on port 4445
summary =      1 in 00:00:00 =    3.1/s Avg:   206 Min:   206 Max:   206 Err:     1 (100.00%)
Tidying up ...    @ Fri Dec 30 11:05:59 GMT 2016 (1483095959326)
... end of run


Performance: Recording JMeter reports 'C:\Users\maria\Desktop\Automation\WIP\Test-page.xml'
Performance: Parsing JMeter report file 'C:\Jenkins\jobs\Test demo\builds\3\performance-reports\JMeter\Test-page.xml'.
Performance: Percentage of errors greater or equal than 0% sets the build as unstable
Performance: Percentage of errors greater or equal than 0% sets the build as failure


Finished: SUCCESS
并将结果保存在.xml中,以使用性能插件(v2.0)和Jenkins版本验证报告。2.32.1

控制台

cd C:\apache-jmeter-3.1\bin
jmeter -n -c -t C:\Users\maria\Desktop\Automation\WIP\Test-page.jmx -l C:\Users\maria\Desktop\Automation\WIP\Test-page.xml
Created the tree successfully using C:\Users\maria\Desktop\Automation\WIP\Test-page.jmx
Starting the test @ Fri Dec 30 11:05:58 GMT 2016 (1483095958952)
Waiting for possible Shutdown/StopTestNow/Heapdump message on port 4445
summary =      1 in 00:00:00 =    3.1/s Avg:   206 Min:   206 Max:   206 Err:     1 (100.00%)
Tidying up ...    @ Fri Dec 30 11:05:59 GMT 2016 (1483095959326)
... end of run


Performance: Recording JMeter reports 'C:\Users\maria\Desktop\Automation\WIP\Test-page.xml'
Performance: Parsing JMeter report file 'C:\Jenkins\jobs\Test demo\builds\3\performance-reports\JMeter\Test-page.xml'.
Performance: Percentage of errors greater or equal than 0% sets the build as unstable
Performance: Percentage of errors greater or equal than 0% sets the build as failure


Finished: SUCCESS
正如你所看到的,我有一个错误。但是性能插件使构建成功

插件设置

Jmeter属性

jmeter.save.saveservice.assertion_results=all
jmeter.save.saveservice.output_format=xml
jmeter.save.saveservice.response_data=true
测试用例

我尝试过但没有成功:

  • 旧版本的性能插件(v1.11和v16)
  • .jtl格式
  • .xml
  • .csv
  • 最后在命令行中添加“echo”
  • 设置
    jmeter.save.saveservice.response\u data=true
  • 没有办法让性能插件计算错误并提高“失败”标志:(

    请提供帮助。

    将“在单个生成上使用错误阈值”从0设置为
    1


    这意味着,如果JMeter测试用例中至少有1个错误,jenkins构建将失败,其中0忽略了错误计数(如果我没有记错的话)。

    听起来像是性能插件问题,我相信您应该通过

    同时,为了解决这个问题,我建议为JMeter构建步骤返回非零退出代码,最快和最简单的方法是使用工具作为包装器运行JMeter测试。Taurus具有强大的功能,您可以定义构建失败的条件。如果满足条件,Taurus将完成执行步骤code
    3
    。Jenkins足够聪明,可以使用非零退出代码自动使命令行任务失败

    最小工作Taurus配置文件:

    ---
    execution:
      scenario: my-test
    
    scenarios:
      my-test:
        script: C:\Users\maria\Desktop\Automation\WIP\Test-page.jmx
    
    services:
    - module: passfail
      criteria:
      - succ<100%, stop as failed
    

    但是在这种情况下,您在设置失败标准方面没有太大的灵活性

    我将我的选择评估模式设置为标准模式,将错误阈值上的单选按钮设置为并将不稳定失败

    设置为1,可能您正面临一个错误。在这种情况下,您可以建议链接吗这是一个解决方法吗?我不知道这个问题的任何解决方法。我对Jenkins和Jmeter完全不熟悉,但在我看到的所有教程中,他们设置0使构建失败,甚至出现一个错误。我尝试了1;42;100这样的值,但没有区别。我想这确实是一个错误。