我正在尝试清理我们的功能测试的jmeter docker+ci管道。我看到taurus有一种干净的方式来在容器中运行jmeter脚本,它完成了下载我想要的jmeter版本+安装我的脚本使用的插件的繁重工作-非常好。
现在,我需要在junit.xml中生成报告,以便保持报告的一致性。到目前为止,我使用的是一个修改过的https://github.com/tguzik/m2u分支,用于将jtl报告转换为junit.xml。
感谢任何帮助,我可以获得请求,响应(代码和主体)的所有样本到junit.xml (至少对失败的样本)?
我试过几个金牛座yaml的变体。
reporting:
- module: console
- module: final_stats
summary: true
percentiles: true
test-duration: true
- module: junit-xml
filename: report/report.xml
data-source: sample-labelsreporting:
- module: console
- module: final_stats
summary: true
percentiles: true
test-duration: true
- module: passfail
- module: junit-xml
filename: report/report.xml
data-source: pass-fail此外,还在passfail模块上添加了特定的passfail标准变体。无济于事
在摆弄了几个小时之后,我相信没有一种简单的方法可以将任何有意义的东西从taurus中的junit - .xml模块转换成junit-xml报告。看起来是赤骨。我还注意到它可能会弄乱默认的jenkins junit插件测试结果摘要。
因此,我决定使用以下yaml设置,并继续使用m2u.jar将jtl转换为junit.xml。
modules:
jmeter:
path: ~/.bzt/jmeter-taurus/bin/jmeter
download-link: https://archive.apache.org/dist/jmeter/binaries/apache-jmeter-{version}.zip
version: 5.3
force-ctg: true
detect-plugins: true
plugins:
- jpgc-json=2.2
- jmeter-ftp
- jpgc-casutg
xml-jtl-flags:
xml: true
fieldNames: true
time: true
timestamp: true
latency: true
connectTime: false
success: true
label: true
code: true
message: true
threadName: true
dataType: false
encoding: false
assertions: true
subresults: true
responseData: false
samplerData: false
responseHeaders: false
requestHeaders: true
responseDataOnError: true
saveAssertionResultsFailureMessage: true
bytes: true
threadCounts: false
url: true
execution:
- write-xml-jtl: full
scenario:
script: v_jmxfilename
properties:
environment: v_env
reporting:
- module: console
- module: final_stats
summary: true
percentiles: true
test-duration: true
# - module: junit-xml
# filename: report/junit-report.xml
# data-source: sample-labels发布于 2020-08-20 00:31:17
根据目前的JUnit-XML-Reporter文档,这是不可能的:
本文以Jenkins JUnit插件可解析的JUnit XML格式提供测试结果。Reporter有两个选项:
filename (报表文件的完整路径,可选。默认情况下,工件标签中的xunit.xml (要使用的数据源: sample-labels或pass-fail)如果样本标签用作源数据,报告将包含带有测试错误的urls。如果pass-fail用作源数据,报告将包含Pass/Fail标准信息。请注意,您必须将pass-fail模块放在reporters列表中的junit-xml模块之前。
金牛座不仅仅是针对JMeter的,它支持更多的工具,而且并不是所有的工具都提供了存储请求和响应数据的可能性,所以我能想到的选项有:
m2u.jarhttps://stackoverflow.com/questions/63473866
复制相似问题