microsoft / jmeter-performance-analyzer-devops-extension

This task enables to run Performance testng using Apache Jmeter, Analyze report and post results. This task uses Apache Jmeter 5.5 and expects a valid parametrized JMX File, Any input Files, and property file for JMX. The task runs the jmx files according to the configured values in JMX and publishes the result to build artifacts and $web of your storage container. Provides control to fail pipeline if JMeter test fails More details at https://marketplace.visualstudio.com/items?itemName=id-az-pipeline.jmeter-perf-analyzer. You need to enable static hosting in the storage container in order to be able to view html results.
Other
10 stars 5 forks source link

Pipeline is failing: illegal operation on a directory, copyfile #3

Closed davibaldin closed 1 year ago

davibaldin commented 1 year ago

Environment: Azure DevOps Services Error: illegal operation on a directory, copyfile '/home/azagent/_work/25/s' -> '/home/azagent/_work/25/s/apache-jmeter-5.5/bin/s' Version: latest

      - job: jmeter
        displayName: JMeter Test
        steps:
          - task: perfanalyzer@1
            inputs:
              jmxSource: 'sourceCode'
              jmxsourceRunFilePath: '$(System.DefaultWorkingDirectory)/jmeter.jmx'
              #jmxPropertySource: 'sourceCode'
              jmxInputFilesSource: 'sourceCode'
              publishResultsToBuildArtifact: true
              artifactNameReport: 'PerfAnalyzerReport'
              artifactNameLog: 'PerfAnalyzerLogs'
              failPipelineIfJMeterFails: false
              #jmeterURI: 'https://dlcdn.apache.org//jmeter/binaries/apache-jmeter-5.5.tgz'
              #jmeterFolderName: 'apache-jmeter-5.5'
              #jmeterLogFolder: 'CurrentLog'
              #jmeterReportFolder: 'CurrentReport'
              #telemetryDataCollection: true
Successfuly Initialized MS Telemetry.
Successfuly Initialized MS Classic Telemetry.
Successfuly Initialized Telemetry.
01-Aug-2022 17:45:29:149 +0000: 03619c48-82c8-4dc7-9a11-84133a8b418f - Current Working directory: /home/azagent/_work/25/s
Created Telemetry Props Count: 42
01-Aug-2022 17:45:29:166 +0000: 03619c48-82c8-4dc7-9a11-84133a8b418f - JMETER_URL https://dlcdn.apache.org//jmeter/binaries/apache-jmeter-5.5.tgz
01-Aug-2022 17:45:29:167 +0000: 03619c48-82c8-4dc7-9a11-84133a8b418f - JMETER_FILE_Folder apache-jmeter-5.5
01-Aug-2022 17:45:29:168 +0000: 03619c48-82c8-4dc7-9a11-84133a8b418f - JMETER_BIN_Folder apache-jmeter-5.5/bin
01-Aug-2022 17:45:29:168 +0000: 03619c48-82c8-4dc7-9a11-84133a8b418f - JMETER_ABS_BIN_Folder /home/azagent/_work/25/s/apache-jmeter-5.5/bin
01-Aug-2022 17:45:29:169 +0000: 03619c48-82c8-4dc7-9a11-84133a8b418f - Current Working directory: /home/azagent/_work/25/s
01-Aug-2022 17:45:29:170 +0000: 03619c48-82c8-4dc7-9a11-84133a8b418f - Start Downloading JMeter Binary
01-Aug-2022 17:45:29:171 +0000: 03619c48-82c8-4dc7-9a11-84133a8b418f - Downloading File: https://dlcdn.apache.org//jmeter/binaries/apache-jmeter-5.5.tgz to location: apache-jmeter.tgz
01-Aug-2022 17:45:30:088 +0000: 03619c48-82c8-4dc7-9a11-84133a8b418f - Download https://dlcdn.apache.org//jmeter/binaries/apache-jmeter-5.5.tgz Completed to :apache-jmeter.tgz
01-Aug-2022 17:45:30:106 +0000: 03619c48-82c8-4dc7-9a11-84133a8b418f - Completed Downloading JMeter Binary
01-Aug-2022 17:45:30:107 +0000: 03619c48-82c8-4dc7-9a11-84133a8b418f - Start Unzipping JMeter Binary
01-Aug-2022 17:45:33:380 +0000: 03619c48-82c8-4dc7-9a11-84133a8b418f - Completed Unzipping JMeter Binary
01-Aug-2022 17:45:33:388 +0000: 03619c48-82c8-4dc7-9a11-84133a8b418f - Change Directory to JMeter Bin Path /home/azagent/_work/25/s/apache-jmeter-5.5/bin completed. Current Working Directory: /home/azagent/_work/25/s/apache-jmeter-5.5/bin
01-Aug-2022 17:45:33:391 +0000: 03619c48-82c8-4dc7-9a11-84133a8b418f - Start handleJMeterJMXFile. Current Working directory/home/azagent/_work/25/s/apache-jmeter-5.5/bin
01-Aug-2022 17:45:33:396 +0000: 03619c48-82c8-4dc7-9a11-84133a8b418f - Copying JMX Source File from Source: /home/azagent/_work/25/s/jmeter.jmx to destination: /home/azagent/_work/25/s/apache-jmeter-5.5/bin/jmeter.jmx
01-Aug-2022 17:45:33:400 +0000: 03619c48-82c8-4dc7-9a11-84133a8b418f - Start Copying File to destination /home/azagent/_work/25/s/apache-jmeter-5.5/bin/jmeter.jmx from source /home/azagent/_work/25/s/jmeter.jmx
01-Aug-2022 17:45:33:402 +0000: 03619c48-82c8-4dc7-9a11-84133a8b418f - Completed handleJMeterJMXFile JMXFileName: jmeter.jmx
01-Aug-2022 17:45:33:406 +0000: 03619c48-82c8-4dc7-9a11-84133a8b418f - Start Handle Property Files. Current Working directory: /home/azagent/_work/25/s/apache-jmeter-5.5/bin
01-Aug-2022 17:45:33:410 +0000: 03619c48-82c8-4dc7-9a11-84133a8b418f - Copying JMX Property File from Source: /home/azagent/_work/25/s to destination: /home/azagent/_work/25/s/apache-jmeter-5.5/bin/s
01-Aug-2022 17:45:33:411 +0000: 03619c48-82c8-4dc7-9a11-84133a8b418f - Start Copying File to destination /home/azagent/_work/25/s/apache-jmeter-5.5/bin/s from source /home/azagent/_work/25/s
##[error]Error: EISDIR: illegal operation on a directory, copyfile '/home/azagent/_work/25/s' -> '/home/azagent/_work/25/s/apache-jmeter-5.5/bin/s'
01-Aug-2022 17:45:33:420 +0000: 03619c48-82c8-4dc7-9a11-84133a8b418f - Error: EISDIR: illegal operation on a directory, copyfile '/home/azagent/_work/25/s' -> '/home/azagent/_work/25/s/apache-jmeter-5.5/bin/s'
01-Aug-2022 17:45:33:425 +0000: 03619c48-82c8-4dc7-9a11-84133a8b418f - Please note this extension is in beta version. We will be fixing the issues as reported and hence it is important for us to be able to analyze logs and fix the issue. If you encounter any issue please create a github issue here https://github.com/microsoft/jmeter-performance-analyzer-devops-extension/issues
##[error]EISDIR: illegal operation on a directory, copyfile '/home/azagent/_work/25/s' -> '/home/azagent/_work/25/s/apache-jmeter-5.5/bin/s'
Finishing: perfanalyzer
5-k commented 1 year ago

Hi there,

I see that you have commented out the jmxPropertySource. If your jmx does not have any property file please change that to none, the default value is sourceCode. It's trying to find the source for property file which isn't there.

Also jmxInputFileSource is set to sourcecode, and no path for folder is provided.

If you do not have input set both them to none

jmxPropertySource: 'none' jmxInputFilesSource: 'none'

Let me know if this helps.

Read examples on using yaml here

https://github.com/microsoft/jmeter-performance-analyzer-devops-extension/blob/main/InputTaskYAML.md

Relevant to you: Pipeline Inputs from Source Code with only jmx and no property file and no input file (search in the above link)

davibaldin commented 1 year ago

Hi 5-k,

Thanks for the reply. I did as suggested and I got a different error:

      - job: jmeter
        displayName: JMeter Test
        steps:
          - task: perfanalyzer@1
            inputs:
              jmxSource: 'sourceCode'
              jmxsourceRunFilePath: '$(System.DefaultWorkingDirectory)/jmeter.jmx'
              jmxPropertySource: 'none'
              jmxInputFilesSource: 'none'
              publishResultsToBuildArtifact: true
              artifactNameReport: 'PerfAnalyzerReport'
              artifactNameLog: 'PerfAnalyzerLogs'
              failPipelineIfJMeterFails: false
              #jmeterURI: 'https://dlcdn.apache.org//jmeter/binaries/apache-jmeter-5.5.tgz'
              #jmeterFolderName: 'apache-jmeter-5.5'
              #jmeterLogFolder: 'CurrentLog'
              #jmeterReportFolder: 'CurrentReport'
              #telemetryDataCollection: true

Error:

01-Aug-2022 19:04:27:587 +0000: 92d6d15a-9365-4d0a-9024-11aa2b693fcb - Start handleJMeterJMXFile. Current Working directory/home/azagent/_work/5/s/apache-jmeter-5.5/bin
01-Aug-2022 19:04:27:590 +0000: 92d6d15a-9365-4d0a-9024-11aa2b693fcb - Copying JMX Source File from Source: /home/azagent/_work/5/s/jmeter.jmx to destination: /home/azagent/_work/5/s/apache-jmeter-5.5/bin/jmeter.jmx
01-Aug-2022 19:04:27:591 +0000: 92d6d15a-9365-4d0a-9024-11aa2b693fcb - Start Copying File to destination /home/azagent/_work/5/s/apache-jmeter-5.5/bin/jmeter.jmx from source /home/azagent/_work/5/s/jmeter.jmx
01-Aug-2022 19:04:27:593 +0000: 92d6d15a-9365-4d0a-9024-11aa2b693fcb - Completed handleJMeterJMXFile JMXFileName: jmeter.jmx
01-Aug-2022 19:04:27:595 +0000: 92d6d15a-9365-4d0a-9024-11aa2b693fcb - No Property File Configuration Enabled. Skipping Property Configuration Step.
01-Aug-2022 19:04:27:596 +0000: 92d6d15a-9365-4d0a-9024-11aa2b693fcb - No Input File Configuration Enabled. Skipping Input File Configuration Step.
01-Aug-2022 19:04:27:598 +0000: 92d6d15a-9365-4d0a-9024-11aa2b693fcb - Running JMeter Without Property File: jmeter -n -t jmeter.jmx  -l CurrentLog/log.jtl -j CurrentLog/jmeter.log -f -e -o CurrentReport
stderr: /bin/sh: 1: jmeter: not found

01-Aug-2022 19:04:27:610 +0000: 92d6d15a-9365-4d0a-9024-11aa2b693fcb - promise complete: 127
01-Aug-2022 19:04:27:612 +0000: 92d6d15a-9365-4d0a-9024-11aa2b693fcb - Publishing data to build artifacts: Log 
01-Aug-2022 19:04:27:613 +0000: 92d6d15a-9365-4d0a-9024-11aa2b693fcb - Current Working directory: /home/azagent/_work/5/s/apache-jmeter-5.5/bin
01-Aug-2022 19:04:27:613 +0000: 92d6d15a-9365-4d0a-9024-11aa2b693fcb - Host Type is: build
##[error]Unable to process command '##vso[artifact.upload artifacttype=Container;artifactname=PerfAnalyzerLogs;containerfolder=PerfAnalyzerLogs;localpath=/home/azagent/_work/5/s/apache-jmeter-5.5/bin/CurrentReport;]/home/azagent/_work/5/s/apache-jmeter-5.5/bin/CurrentReport' successfully. Please reference documentation (http://go.microsoft.com/fwlink/?LinkId=817296)
##[error]Path does not exist: /home/azagent/_work/5/s/apache-jmeter-5.5/bin/CurrentReport
01-Aug-2022 19:04:27:614 +0000: 92d6d15a-9365-4d0a-9024-11aa2b693fcb - Completed Uploading Artifacts from : /home/azagent/_work/5/s/apache-jmeter-5.5/bin/CurrentReport to location: /home/azagent/_work/5/s/apache-jmeter-5.5/bin/CurrentReport
01-Aug-2022 19:04:27:615 +0000: 92d6d15a-9365-4d0a-9024-11aa2b693fcb - Task Completed.
01-Aug-2022 19:04:27:615 +0000: 92d6d15a-9365-4d0a-9024-11aa2b693fcb - Completed: Publishing data to build artifacts: Log 
01-Aug-2022 19:04:27:619 +0000: 92d6d15a-9365-4d0a-9024-11aa2b693fcb - Publishing data to build artifacts: Report 
01-Aug-2022 19:04:27:619 +0000: 92d6d15a-9365-4d0a-9024-11aa2b693fcb - Current Working directory: /home/azagent/_work/5/s/apache-jmeter-5.5/bin
01-Aug-2022 19:04:27:620 +0000: 92d6d15a-9365-4d0a-9024-11aa2b693fcb - Host Type is: build
##[error]Unable to process command '##vso[artifact.upload artifacttype=Container;artifactname=PerfAnalyzerReport;containerfolder=PerfAnalyzerReport;localpath=/home/azagent/_work/5/s/apache-jmeter-5.5/bin/CurrentReport;]/home/azagent/_work/5/s/apache-jmeter-5.5/bin/CurrentReport' successfully. Please reference documentation (http://go.microsoft.com/fwlink/?LinkId=817296)
##[error]Path does not exist: /home/azagent/_work/5/s/apache-jmeter-5.5/bin/CurrentReport
01-Aug-2022 19:04:27:620 +0000: 92d6d15a-9365-4d0a-9024-11aa2b693fcb - Completed Uploading Artifacts from : /home/azagent/_work/5/s/apache-jmeter-5.5/bin/CurrentReport to location: /home/azagent/_work/5/s/apache-jmeter-5.5/bin/CurrentReport
01-Aug-2022 19:04:27:621 +0000: 92d6d15a-9365-4d0a-9024-11aa2b693fcb - Completed: Publishing data to build artifacts: Report 
01-Aug-2022 19:04:27:622 +0000: 92d6d15a-9365-4d0a-9024-11aa2b693fcb - Reading File: CurrentLog/log.jtl
01-Aug-2022 19:04:27:627 +0000: 92d6d15a-9365-4d0a-9024-11aa2b693fcb - closing code: 127
##[error]Unhandled: ENOENT: no such file or directory, open 'CurrentLog/log.jtl'
Finishing: perfanalyzer

In the agent I've install jmeter (even it is not instructed to do so) and then I run the command directly in the agent's home folder:

$ cd /home/azagent/_work/5/s#
$ jmeter -n -t jmeter.jmx  -l CurrentLog/log.jtl -j CurrentLog/jmeter.log -f -e -o CurrentReport
Creating summariser <summary>
Created the tree successfully using jmeter.jmx
Starting standalone test @ 2022 Aug 1 19:09:18 UTC (1659380958471)
Waiting for possible Shutdown/StopTestNow/HeapDump/ThreadDump message on port 4445
Warning: Nashorn engine is planned to be removed from a future JDK release
summary +    494 in 00:00:10 =   48.2/s Avg:  3296 Min:  2120 Max:  5958 Err:     0 (0.00%) Active: 200 Started: 200 Finished: 0
summary +    506 in 00:00:06 =   81.7/s Avg:  2511 Min:   889 Max:  3751 Err:     0 (0.00%) Active: 0 Started: 200 Finished: 200
summary =   1000 in 00:00:16 =   60.8/s Avg:  2899 Min:   889 Max:  5958 Err:     0 (0.00%)
Tidying up ...    @ 2022 Aug 1 19:09:36 UTC (1659380976207)
... end of run

Please, let me know if I can provide any other information,

Regards,

Davi

5-k commented 1 year ago

Pushed a hotfix version 1.3.83 for the same. Try again with the latest version.

Thanks

davibaldin commented 1 year ago

I'm getting the same error:

Starting: perfanalyzer
==============================================================================
Task         : JMeter Performance Analyzer
Description  : Run Performance Test using Apache JMeter, Publish and Analyze Results
Version      : 1.3.83
Author       : Microsoft
Help         : This task enables to run Performance testng using Apache Jmeter, Analyze report and post results. This task uses Apache Jmeter 5.5 and expects a valid parametrized JMX File, Any input Files, and property file for JMX. The task runs the jmx files according to the configured values in JMX and publishes the result to build artifacts and $web of your storage container. Provides control to fail pipeline if JMeter test fails<br/><br/>More details at <a><u>[https://marketplace.visualstudio.com/items?itemName=id-az-pipeline.jmeter-perf-analyzer</u></a>](https://marketplace.visualstudio.com/items?itemName=id-az-pipeline.jmeter-perf-analyzer%3C/u%3E%3C/a%3E) <br/><br/> Samples: <a><u>([https://github.com/microsoft/jmeter-performance-analyzer-devops-extension/blob/main/samples</u></a>](https://github.com/microsoft/jmeter-performance-analyzer-devops-extension/blob/main/samples%3C/u%3E%3C/a%3E)
==============================================================================
Successfuly Initialized MS Telemetry.
Successfuly Initialized MS Classic Telemetry.
Successfuly Initialized Telemetry.
Running Pipeline Host: build
Created Telemetry Props Count: 42
01-Aug-2022 19:34:13:332 +0000: 3a1a1e09-0103-49f7-9628-d5f5b0cb9d24 - Start Copying File to destination /home/azagent/_work/25/s/apache-jmeter-5.5/bin/jmeter.jmx from source /home/azagent/_work/25/s/jmeter.jmx
01-Aug-2022 19:34:13:335 +0000: 3a1a1e09-0103-49f7-9628-d5f5b0cb9d24 - Completed handleJMeterJMXFile JMXFileName: jmeter.jmx
01-Aug-2022 19:34:13:337 +0000: 3a1a1e09-0103-49f7-9628-d5f5b0cb9d24 - No Property File Configuration Enabled. Skipping Property Configuration Step.
01-Aug-2022 19:34:13:339 +0000: 3a1a1e09-0103-49f7-9628-d5f5b0cb9d24 - No Input File Configuration Enabled. Skipping Input File Configuration Step.
01-Aug-2022 19:34:13:344 +0000: 3a1a1e09-0103-49f7-9628-d5f5b0cb9d24 - Running JMeter Without Property File: .\jmeter -n -t jmeter.jmx  -l CurrentLog/log.jtl -j CurrentLog/jmeter.log -f -e -o CurrentReport
stderr: /bin/sh: 1: 
stderr: .jmeter: not found
stderr: 

01-Aug-2022 19:34:13:374 +0000: 3a1a1e09-0103-49f7-9628-d5f5b0cb9d24 - closing code: 127
01-Aug-2022 19:34:13:375 +0000: 3a1a1e09-0103-49f7-9628-d5f5b0cb9d24 - promise complete: 127
01-Aug-2022 19:34:13:383 +0000: 3a1a1e09-0103-49f7-9628-d5f5b0cb9d24 - Publishing data to build artifacts: Log 
01-Aug-2022 19:34:13:386 +0000: 3a1a1e09-0103-49f7-9628-d5f5b0cb9d24 - Current Working directory: /home/azagent/_work/25/s/apache-jmeter-5.5/bin
01-Aug-2022 19:34:13:388 +0000: 3a1a1e09-0103-49f7-9628-d5f5b0cb9d24 - Host Type is: build
##[error]Unable to process command '##vso[artifact.upload artifacttype=Container;artifactname=PerfAnalyzerLogs;containerfolder=PerfAnalyzerLogs;localpath=/home/azagent/_work/25/s/apache-jmeter-5.5/bin/CurrentReport;]/home/azagent/_work/25/s/apache-jmeter-5.5/bin/CurrentReport' successfully. Please reference documentation (http://go.microsoft.com/fwlink/?LinkId=817296)
##[error]Path does not exist: /home/azagent/_work/25/s/apache-jmeter-5.5/bin/CurrentReport
01-Aug-2022 19:34:13:391 +0000: 3a1a1e09-0103-49f7-9628-d5f5b0cb9d24 - Completed Uploading Artifacts from : /home/azagent/_work/25/s/apache-jmeter-5.5/bin/CurrentReport to location: /home/azagent/_work/25/s/apache-jmeter-5.5/bin/CurrentReport
01-Aug-2022 19:34:13:395 +0000: 3a1a1e09-0103-49f7-9628-d5f5b0cb9d24 - Task Completed.
01-Aug-2022 19:34:13:396 +0000: 3a1a1e09-0103-49f7-9628-d5f5b0cb9d24 - Completed: Publishing data to build artifacts: Log 
01-Aug-2022 19:34:13:397 +0000: 3a1a1e09-0103-49f7-9628-d5f5b0cb9d24 - Publishing data to build artifacts: Report 
01-Aug-2022 19:34:13:399 +0000: 3a1a1e09-0103-49f7-9628-d5f5b0cb9d24 - Current Working directory: /home/azagent/_work/25/s/apache-jmeter-5.5/bin
01-Aug-2022 19:34:13:402 +0000: 3a1a1e09-0103-49f7-9628-d5f5b0cb9d24 - Host Type is: build
##[error]Unable to process command '##vso[artifact.upload artifacttype=Container;artifactname=PerfAnalyzerReport;containerfolder=PerfAnalyzerReport;localpath=/home/azagent/_work/25/s/apache-jmeter-5.5/bin/CurrentReport;]/home/azagent/_work/25/s/apache-jmeter-5.5/bin/CurrentReport' successfully. Please reference documentation (http://go.microsoft.com/fwlink/?LinkId=817296)
##[error]Path does not exist: /home/azagent/_work/25/s/apache-jmeter-5.5/bin/CurrentReport
01-Aug-2022 19:34:13:404 +0000: 3a1a1e09-0103-49f7-9628-d5f5b0cb9d24 - Completed Uploading Artifacts from : /home/azagent/_work/25/s/apache-jmeter-5.5/bin/CurrentReport to location: /home/azagent/_work/25/s/apache-jmeter-5.5/bin/CurrentReport
01-Aug-2022 19:34:13:404 +0000: 3a1a1e09-0103-49f7-9628-d5f5b0cb9d24 - Completed: Publishing data to build artifacts: Report 
01-Aug-2022 19:34:13:405 +0000: 3a1a1e09-0103-49f7-9628-d5f5b0cb9d24 - Reading File: CurrentLog/log.jtl
##[error]Unhandled: ENOENT: no such file or directory, open 'CurrentLog/log.jtl'
Finishing: perfanalyzer
5-k commented 1 year ago

Linux and MAcos Based agents are supported in the new version. Pushed Minor Upgrade to v 1.4.34

5-k commented 1 year ago

@davibaldin can you confirm if the fix resolved the issue?

davibaldin commented 1 year ago

Hi 5-k, it is resolved.

Thank you very much!!

Starting: perfanalyzer

Task : JMeter Performance Analyzer Description : Run Performance Test using Apache JMeter, Publish and Analyze Results Version : 1.4.34

5-k commented 1 year ago

Hi @davibaldin Are you using the html reporting with continuous export into a public https link using azure blob storage. If you are not, I can schedule a call to explain and make use the feature. The feature helps to visualize report, it might be a great addition for your use case.

Regards Prateek