Jmeter-Maven-Plugin高级应用:Test Results File Format-Test Results
2016-10-22 10:50
483 查看
Test Results File Format
Test Results
Disabling The <testResultsTimestamp>Enabling <appendResultsTimestamp>
Setting The <resultsFileNameDateFormat>
Choosing The <resultsFileFormat>
Specifying the <resultsDirectory>
Setting <ignoreResultFailures>
Setting <suppressJMeterOutput>
Setting <skipTests>
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> 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
相关文章推荐
- Jmeter-Maven-Plugin高级应用:Modifying Properties
- Jmeter-maven-plugin高级应用
- Jmeter-Maven-Plugin高级应用:Proxy Configuration
- Jmeter-Maven-Plugin高级应用:Adding additional libraries to the classpath
- Jmeter-Maven-Plugin高级应用:Selecting Tests To Run
- Jmeter-Maven-Plugin高级应用:Configuring the jvm that the jmeter process runs in
- Jmeter-maven-plugin高级应用
- Jmeter-Maven-Plugin高级应用:Remote Server Configuration
- Jmeter-Maven-Plugin高级应用:Log Levels
- 【jmeter-maven-plugin】二、高级配置之 -- 选择测试脚本
- Jmeter-maven-plugin高级配置之分布式设置
- Jmeter-maven-plugin高级配置之选择测试脚本
- Jmeter-maven-plugin高级配置之压测结果文件格式
- Jmeter-maven-plugin高级配置之选择测试脚本(转)
- 【jmeter-maven-plugin】三、高级配置之 -- 检测结果
- [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-t
- maven报错:org.apache.maven.plugins:maven-surefire-plugin:2.7.1:test (default-test) on project
- 应用maven/hudson实施jmeter性能自动化
- maven package:Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.5:test
- maven打包报错:Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.5:test