在Teamcity CI / CD中運行Jmeter測試作為自動化測試


-2

我想將Jmeter測試添加為TeamCity CI中的構建步驟部署服務器。如果測試失敗,構建將無法完成。請詳細告知。

我目前正在使用Jmeter來測試在獨立計算機上運行不同方案/線程的Rest API。我的意圖是將這些測試放入具有TeamCity的現有CI / CD中。當我們部署新版本時,jmeter測試將作為自動化測試運行,如果任何測試失敗,則構建將回滾並生成失敗報告

0

If you can add plugins to TeamCity you can consider using JMeter plugin for TeamCity, it will allow you to set up performance metrics calculation:

enter image description here

and view the performance statistics:

enter image description here

There is also possibility to Check reference values so you can conditionally mark build as passed or failed depending on SLAs or other criteria

References:


If you cannot add plugins to TeamCity you can just use Taurus tool as a wrapper for JMeter test, it provides powerful Pass/Fail Criteria subsystem which returns non-zero exit status code in case if criteria are not met, if TeamCity receives non-zero status code it automatically marks the build as failed.