jenkinsjmeterjenkins-pipelinejmeter-maven-plugin

Creating parser with percentiles:'0,50,90,100,' filterRegex:null Cannot detect file type because of error: Failed to copy jmeter-newtest.csv


Build is failing in execute jmeter stage, I'm attaching both error and jmeter build stage below

could some hlep me in this

Jenkins pipelnie :

stage('Execute Jmeter') {
              when {
              expression { return pipelineStages.contains("JMETER-TEst") }
          }
        steps{
            sh 'pwd'
}
        post{
           always{
             dir("/target/jmeter/results/"){
                 sh 'pwd'
                 perfReport 'jmeter-newtest.csv'
            }
         }
       }     
    }

Error :

Creating parser with percentiles:'0,50,90,100,' filterRegex:null

Cannot detect file type because of error: Failed to copy /target/jmeter/results/jmeter-newtest.csv to /data/jenkins/jobs/project-service/branches/adding-jmeter-build-step/builds/19/temp/jmeter-newtest.csv

Solution

  • I don't think you have /target/jmeter/results/, it looks like an absolute path and I believe you need the relative path to the Jenkins workspace folder

    So my expectation is that if you change /target/jmeter/results/ to target/jmeter/results/ your script should start working as expected.

    I also don't think you need to change the working directory, Performance Plugin can scan for result file(s) using Fileset syntax so you can just do something like:

    perfReport '**/*jmeter-newtest.csv'
    

    More information: How to Use the Jenkins Performance Plugin