Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Add option to disable timestamp in result filename #27

Open
nigelcharman opened this issue Dec 14, 2013 · 14 comments
Open

Comments

@nigelcharman
Copy link

Hi

Thanks for the plugin.

The Jenkins JMeter plugin expects to find the same filename on each build, and it creates a graph across all builds that have the same filename.

Since the Gradle plugin creates a unique filename each time, we don't see this graph on Jenkins.

Would you add an option to remove the timestamp from the results file name?

For reference, the Maven JMeter plugin has a boolean property testResultsTimestamp that controls this. See https://github.com/Ronnie76er/jmeter-maven-plugin/wiki/Test-Results-File-Format#wiki-1.

cheers
Nigel

@foragerr
Copy link
Contributor

foragerr commented Apr 5, 2015

@nigelcharman Jenkins jmeter plugin is deprecated in favor of Jenkins performance plugin. The performance plugin takes report names with wildcards, the reports produced by this plugin can be consumed directly.

I am aware I am answering a really old question - I'm just noting that this issue can now be closed.

@djangofan
Copy link

@foragerr I would like to re-open dialog on this issue. I cannot use the "Publish HTML reports" plugin in Jenkins because it is unable to publish (save HTML report files from previous builds) Jmeter reports when the reports have a timestamp on the file name. This has become a problem that is not easy to solve otherwise.

@foragerr
Copy link
Contributor

foragerr commented Jul 1, 2015

I suppose there will be other plugins that expect constant filename as well. This is an easy fix - I will put in a change this weekend.

Except, my previous pull requests are still pending. I'm really tempted to do a hard fork. I've seen some other people say this as well.

@djangofan
Copy link

I tried adding this jmeter option in jmeter.properties , but the plugin seems to ignore it and adds the timestamp anyways:
jmeter.save.saveservice.timestamp_format=none

It would be really great if the plugin actually would honor the configuration of the jmeter.save.saveservice. properties.

@foragerr
Copy link
Contributor

foragerr commented Jul 6, 2015

Does this work for you?

if resultFilenameTimestamp is "none" do not use a timestamp in filename    
else if resultFilenameTimestamp is "useSaveServiceFormat" use jmeter.save.saveservice.timestamp_format
else default to testfilename-yyyyMMdd-HHmm.xml

@djangofan
Copy link

Sounds like it would work fine for Jenkins and I...
On Jul 6, 2015 1:40 PM, "RaGe" [email protected] wrote:

Does this work for you?

if resultFilenameTimestamp is "none" do not use a timestamp in filename

else if resultFilenameTimestamp is "useSaveServiceFormat" use jmeter.save.saveservice.timestamp_format
else default to testfilename-yyyyMMdd-HHmm.xml


Reply to this email directly or view it on GitHub
#27 (comment)
.

@foragerr
Copy link
Contributor

foragerr commented Jul 8, 2015

Need an opinion: When trying to save results with no timestamp, if a results file already exists, should it be overwritten?

@djangofan
Copy link

Yes. When the Jenkins html publisher plug in archives the file on each
build, it makes a copy and so overwriting is not a problem imho
On Jul 8, 2015 7:40 AM, "RaGe" [email protected] wrote:

Need an opinion: When trying to save results with no timestamp, if a
results file already exists, should it be overwritten?


Reply to this email directly or view it on GitHub
#27 (comment)
.

@nigelcharman
Copy link
Author

I agree it should be overwritten. For reference, I just tried the Maven plugin and it overwrites the results file and log.

@foragerr
Copy link
Contributor

foragerr commented Jul 9, 2015

Fix implemented in my fork. I also merged all of the other pending PRs from this repo. I will look into releasing to maven central.

@djangofan Could you try out the changes please? Let me know if you need the plugin binary.

@djangofan
Copy link

@foragerr Yes, I will test it as soon as I get a chance to build a .jar from your project. I looked at your changes and they look like they will work. I'll get back to you as soon as I can, probably this week sometime.

@foragerr
Copy link
Contributor

You can now apply the plugin this way:

apply plugin: 'net.foragerr.jmeter'

buildscript {
    repositories {
        maven {
            url 'https://dl.bintray.com/jmeter-gradle-plugin/jmeter'
        }
    }
    dependencies {
        classpath "net.foragerr.jmeter:jmeter-gradle-plugin:0.1.1-2.13"
    }
}

Also don't forget to include some variation of the following in the jmeterrun config

enableReports = false
enableExtendedReports = true

I moved a bunch of things around, some things can be very broken. I'm trying to write some unit tests. Meanwhile please report any issues here: https://github.com/jmeter-gradle-plugin/jmeter-gradle-plugin/issues

@djangofan
Copy link

@foragerr Ok, I made an attempt to run and it failed. Here is my repo, updated to use your new plugin:
https://github.com/djangofan/launch-jmeter

I created a 'runTestsWithGradle.bat' script. When you run it, it generates a XML output, but it FAILS to generate a HTML report and I am not sure why.

Also, I noticed something I didn't notice before: The 'jmeter.save.saveservice.timestamp_format' property ONLY works with CSV output. If you set the properties for XML output with 'jmeter.save.saveservice.output_format=xml' , then if you have 'jmeter.save.saveservice.timestamp_format=none', then Jmeter pukes (with no error message). Sorry, I didn't notice this before.

Just download the .zip of my repo and run it if you want to try.

@foragerr
Copy link
Contributor

Moving this conversation here: jmeter-gradle-plugin/jmeter-gradle-plugin#4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants