【问题标题】:Tracking testng test performance over multiple runs在多次运行中跟踪 testng 测试性能
【发布时间】:2019-02-09 19:27:05
【问题描述】:

我正在考虑扩展我现有的 CI,它使用 testng 作为测试框架。我有一套测试,其性能(每次测试花费的时间)我想跟踪每个测试的性能以及每个测试随时间的变化。例如,在该套件运行 5 次后,我可以看到我的测试表现得更好或更差。

我知道 testng 默认输出包含 time 属性的 xml 报告。目前我在 testng 的documentation 中没有看到任何专门解决此问题的内容。

目前,我认为唯一的方法是提取相关信息(方法/类名和时间)并将其编译为单独的文件,以便稍后报告。您知道任何更好的内置解决方案吗?

<testsuite name="PerformanceTests" tests="1" failures="0" timestamp="26 Apr 2018 17:05:51 GMT" **time="356.232"** errors="0">
  <testcase name="testModifyFail" time="2.127" classname="PerformanceTests"/>
<testsuite/>

【问题讨论】:

    标签: java performance testng performance-testing performance-monitor


    【解决方案1】:
    1. TestNG 可以在JUnit format 中输出测试结果
    2. Jenkins 有Performance Plugin 可以构建性能统计和趋势图表并将它们添加到构建仪表板。从理论上讲,如果某些指标超过可接受的阈值,您甚至可以将构建标记为不稳定或失败。

    因此,您可以配置性能插件以从 test-output/junitreports 读取结果,它应该可以为您解决问题。

    查看How to Use the Jenkins Performance Plugin,详细了解将性能测试结果添加到 CI 管道的概念。

    【讨论】:

      猜你喜欢
      • 2023-03-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-11-25
      • 1970-01-01
      • 1970-01-01
      • 2020-06-03
      相关资源
      最近更新 更多