当我想在teamcity中发布图形(从jmeter-graph-maven-plugin)时,如何指定jtl文件的路径? [英] How can I specify path to jtl files when I want to publish graph (from jmeter-graph-maven-plugin) in teamcity?

查看:214
本文介绍了当我想在teamcity中发布图形(从jmeter-graph-maven-plugin)时,如何指定jtl文件的路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 jmeter-maven-plugin (版本1.10.0)运行JMeter测试-首先,我从IntelliJ运行它,然后从TeamCity运行(对于这两个命令- mvn jmeter- graph:create-graph )

I use jmeter-maven-plugin (version 1.10.0) to run JMeter test - first I run it from IntelliJ, then from TeamCity (for both - command: mvn jmeter-graph:create-graph)

当我要对 jmeter-graph-maven-plugin 使用以下配置时:

When I want to use the following configuration for jmeter-graph-maven-plugin:

<plugin>
    <groupId>de.codecentric</groupId>
    <artifactId>jmeter-graph-maven-plugin</artifactId>
    <version>0.1.0</version>
    <configuration>                           
        <inputFile>${project.build.directory}/jmeter/results/*.jtl</inputFile>
        <graphs>
            <graph>
                 <pluginType>TransactionsPerSecond</pluginType>
                 <outputFile>${project.build.directory}/jmeter/results/TPS.png</outputFile>
            </graph>
        </graphs>
    </configuration>
</plugin>

它可以从IntelliJ运行,但是在TeamCity中,我得到:
错误:java.lang.IllegalArgumentException:找不到指定的JTL文件:/project/XX/opt/team-city-8.0.5/buildAgent/work/xxxxx/JMeter/target/jmeter/results/*.jtl

it works from IntelliJ, but in TeamCity I get:
ERROR: java.lang.IllegalArgumentException: Cannot find specified JTL file: /project/XX/opt/team-city-8.0.5/buildAgent/work/xxxxx/JMeter/target/jmeter/results/*.jtl

结果文件存在(并且以前在 xml-maven-plugin 中使用-甚至配置为* .jtl-xml插件在TeamCity中均正常工作.

Result file exists (and it is previous used in xml-maven-plugin - even configuration is *.jtl - xml plugin works correctly in TeamCity).

当我使用特定的文件名(例如 20150317test-result.jtl 而不是* .jtl)时,它也可以在TeamCity中使用. 如何使用通用文件名?还是在 jmeter-maven-plugin 中有一个选项可以定义一些固定的jtl文件名(然后在 jmeter-graph-maven-plugin 中使用它)?

When I use specific file name (so e.g. 20150317test-result.jtl instead of *.jtl) it works also from TeamCity. How can I use general file name? Or maybe there is an option in jmeter-maven-plugin to define some fixed jtl file name (and then use it in jmeter-graph-maven-plugin)?

推荐答案

我确实解决了此问题. 我将jmeter-graph-maven-plugin配置更改为:

I did workaround for this issue. I changed jmeter-graph-maven-plugin configuration to:

<inputFile>${project.build.directory}/jmeter/results/${fileName}.jtl</inputFile>

现在我使用 mvn jmeter-graph:create-graph -DfileName =%profile%(其中配置文件名称与jmx测试文件相同)运行它.

and now I run it using mvn jmeter-graph:create-graph -DfileName=%profile% (where profile name is the same as jmx test file).

这篇关于当我想在teamcity中发布图形(从jmeter-graph-maven-plugin)时,如何指定jtl文件的路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆