afranken / jmeter-analysis-maven-plugin

Plugin that parses JMeter result files and computes performance indicators such as average request duration
58 stars 40 forks source link

Running `jmeter-analysis:analyze` without a phase doesn’t read the configuration #41

Closed alfonsomunozpomer closed 8 years ago

alfonsomunozpomer commented 8 years ago

I’m playing with jmeter-maven-plugin-example and if I run mvn -Pperformance verify both jmeter-maven-plugin and jmeter-analysis-maven-plugin are run and everything’s fine.

However, if I run first mvn -Pperformance jmeter:jmeter and then mvn -Pperformance jmeter-analysis:analyze I get this error:

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building jmeter-maven-plugin-example DEV-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- jmeter-analysis-maven-plugin:1.0.6:analyze (default-cli) @ jmeter-maven-plugin-example ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.236 s
[INFO] Finished at: 2016-07-06T14:56:56+01:00
[INFO] Final Memory: 9M/309M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.lazerycode.jmeter:jmeter-analysis-maven-plugin:1.0.6:analyze (default-cli) on project jmeter-maven-plugin-example: The parameters 'source' for goal com.lazerycode.jmeter:jmeter-analysis-maven-plugin:1.0.6:analyze are missing or invalid -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginParameterException

My source parameter, according to the POM file, is:

<source>${project.build.directory}/jmeter/results/*</source>

And target/jmeter/results contains the jtl file.

Is there anything I’m not doing right?

Thanks in advance.

alfonsomunozpomer commented 8 years ago

I’ve run both cases with -X and noticed that verify shows this:

[DEBUG] Configuring mojo 'com.lazerycode.jmeter:jmeter-analysis-maven-plugin:1.0.6:analyze' with basic configurator -->
[DEBUG]   (f) maxSamples = 50000
[DEBUG]   (f) preserveDirectories = false
[DEBUG]   (f) processAllFilesFound = false
[DEBUG]   (f) remoteResourcesFromUntilDateFormat = yyyyMMdd'T'HHmmssZ
[DEBUG]   (f) source = /Users/test/jmeter-maven-plugin-example/target/jmeter/results/*
[DEBUG]   (f) sourceDirFailed = true
[DEBUG]   (f) targetDirectory = /Users/test/jmeter-maven-plugin-example/target/reports
[DEBUG] -- end configuration --

Whereas jmeter-analysis:analyze displays this (the source parameter is missing):

[DEBUG] Configuring mojo 'com.lazerycode.jmeter:jmeter-analysis-maven-plugin:1.0.6:analyze' with basic configurator -->
[DEBUG]   (f) maxSamples = 50000
[DEBUG]   (f) preserveDirectories = false
[DEBUG]   (f) processAllFilesFound = false
[DEBUG]   (f) remoteResourcesFromUntilDateFormat = yyyyMMdd'T'HHmmssZ
[DEBUG]   (f) sourceDirFailed = true
[DEBUG]   (f) targetDirectory = /Users/test/jmeter-maven-plugin-example/target
[DEBUG] -- end configuration --
alfonsomunozpomer commented 8 years ago

It turns out the <configuration> should be outside the <execution> element in the POM file. I’m opening an issue in the example project.