• Jmeter-Maven-Plugin高级应用:Test Results File Format-Test Results


    Test Results File Format

    Test Results


    Disabling The <testResultsTimestamp>

    By default this plugin will add a timestamp to each results file that it generates. If you do not want a timestamp added you can disable this behaviour by setting the<testResultsTimestamp> configuration setting to false.

    +---+
    <project>
        [...]
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.lazerycode.jmeter</groupId>
                        <artifactId>jmeter-maven-plugin</artifactId>
                        <version>2.0.3</version>
                        <executions>
                            <execution>
                                <id>jmeter-tests</id>
                                <goals>
                                    <goal>jmeter</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <testResultsTimestamp>false</testResultsTimestamp>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        [...]
    </project>
    +---+

    Enabling <appendResultsTimestamp>

    When <testResultsTimestamp> is set to true the default positioning of the timestamp is at the start of the results filename. You can set the <appendResultsTimestamp&gt to true to make the plugin add the timestamp to the end of the results filename.

    +---+
    <project>
        [...]
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.lazerycode.jmeter</groupId>
                        <artifactId>jmeter-maven-plugin</artifactId>
                        <version>2.0.3</version>
                        <executions>
                            <execution>
                                <id>jmeter-tests</id>
                                <goals>
                                    <goal>jmeter</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <appendResultsTimestamp>true</appendResultsTimestamp>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        [...]
    </project>
    +---+

    Setting The <resultsFileNameDateFormat>

    The default format for the timestamp added to results filenames created by the plugin is a basic ISO_8601 date format (YYYMMDD). You can modify the format of the timestamp by setting the<resultsFileNameDateFormat> configuration setting, we use a JodaTime DateTimeFormatter (See http://joda-time.sourceforge.net/apidocs/org/joda/time/format/DateTimeFormat.html)

    +---+
    <project>
        [...]
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.lazerycode.jmeter</groupId>
                        <artifactId>jmeter-maven-plugin</artifactId>
                        <version>2.0.3</version>
                        <executions>
                            <execution>
                                <id>jmeter-tests</id>
                                <goals>
                                    <goal>jmeter</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <resultsFileNameDateFormat>MMMM, yyyy</resultsFileNameDateFormat>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        [...]
    </project>
    +---+

    Choosing The <resultsFileFormat>

    JMeter is capable of creating .jtl (an XML format) test results and csv test results. By default this plugin uses the .jtl format so that it can scan the result file for failures. You can switch thos to csv format if you would prefer, but the plugin is currently unable to parse .csv files for failures and .csv files will not work with the JMeter Analysis Maven Plugin.

    +---+
    <project>
        [...]
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.lazerycode.jmeter</groupId>
                        <artifactId>jmeter-maven-plugin</artifactId>
                        <version>2.0.3</version>
                        <executions>
                            <execution>
                                <id>jmeter-tests</id>
                                <goals>
                                    <goal>jmeter</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <resultsFileFormat>csv</resultsFileFormat>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        [...]
    </project>
    +---+

    Specify the <resultsDirectory>

    By default all JMeter test result will be written to${project.base.directory}/target/jmeter/results. To can modify this by setting the<resultsDirectory> to an explicit file location.

    +---+
    <project>
        [...]
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.lazerycode.jmeter</groupId>
                        <artifactId>jmeter-maven-plugin</artifactId>
                        <version>2.0.3</version>
                        <executions>
                            <execution>
                                <id>jmeter-tests</id>
                                <goals>
                                    <goal>jmeter</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <resultsDirectory>/tmp/jmeter</resultsDirectory>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        [...]
    </project>
    +---+

    Setting <ignoreResultFailures>

    By default the this plugin will stop maven execution if any failures are found within the .jtl results file (it is currently unable to scan .csv results files so any failures in a csv file will be ignored). If you don't want the maven execution to stop you can tell the plugin to ignore failures using the<ignoreResultFailures> configuration setting.

    +---+
    <project>
        [...]
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.lazerycode.jmeter</groupId>
                        <artifactId>jmeter-maven-plugin</artifactId>
                        <version>2.0.3</version>
                        <executions>
                            <execution>
                                <id>jmeter-tests</id>
                                <goals>
                                    <goal>jmeter</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <ignoreResultFailures>true</ignoreResultFailures>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        [...]
    </project>
    +---+

    Setting <suppressJMeterOutput>

    By default all JMeter output is printed to the console. If you do not want to see all of the output generated by JMeter you can turn it off by setting the <suppressJMeterOutput> configurations setting to true.

    +---+
    <project>
        [...]
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.lazerycode.jmeter</groupId>
                        <artifactId>jmeter-maven-plugin</artifactId>
                        <version>2.0.3</version>
                        <executions>
                            <execution>
                                <id>jmeter-tests</id>
                                <goals>
                                    <goal>jmeter</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <suppressJMeterOutput>true</suppressJMeterOutput>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        [...]
    </project>
    +---+

    Setting <skipTests>

    You can now use the <skipTests> configurations setting to make maven skip the performance tests. Suggested configuration is as follows:

    +---+
    <project>
        [...]
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.lazerycode.jmeter</groupId>
                        <artifactId>jmeter-maven-plugin</artifactId>
                        <version>2.0.3</version>
                        <executions>
                            <execution>
                                <id>jmeter-tests</id>
                                <goals>
                                    <goal>jmeter</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <skipTests>${skipTests}</skipTests>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        [...]
    </project>
    +---+

    This will allow you to run:

    mvn verify –DskipTests=true
    

    And the performance test step will be skipped

  • 相关阅读:
    战争迷雾Fog Of War
    [UE4]运行时UMG组件跟随鼠标的逻辑:拖拽UMG组件(蓝图)
    [UE4]FString常用API
    用PNG作为Texture创建Material
    [UE4]C++代码操作SplineMesh
    [UE4]Visual Studio的相关插件安装:UE4.natvis和UnrealVS Extension
    TSubobjectPtr和C++传统指针的区别
    组件Slate教程 & UMG widget构造初始化函数中获取其内部组件
    设置UMG的ComboBox(String)字体大小
    UMG设置组件自适应居中或靠边
  • 原文地址:https://www.cnblogs.com/ceshi2016/p/5987010.html
Copyright © 2020-2023  润新知