Jv2 Analysis

Jenkins V2 is with Cygwin and LoadRunner Analysis

I have been struggling with Jenkins Version 2 and my LoadRunner solutions elsewhere on this site. Mainly due to Jenkins not picking up the cygwin environment properly and with windows paths with spaces. For now, I am just going to paste my working temporary script below, from which details can be picked out and used. This page is an exercice in techniques more than anything:

 

UCS_test1
===================================================================================================



####!c:/cygwin/bin/bash

#sleep to wait for reboot controller to finish properly
#sleep 600s

#tidy up the workspace
echo tiding up workspace: ${WORKSPACE}
echo $PATH
PATH=/usr/bin:/cygdrive/c/cygwin/bin:$PATH
echo $PATH
cd "${WORKSPACE}"
ls

echo "It is now $(date)"




===================================================================================================





####!/bin/bash
#### Proper header for a Bash script.

#!c:/cygwin/bin/bash
echo "It is now $(date)"
echo $PATH
PATH=/usr/bin:/cygdrive/c/cygwin/bin:$PATH
echo $PATH
cd "${WORKSPACE}"
echo "workspace ="
pwd

echo save lrr location to disk for next step
xml_file=$(ls -rt1 *.xml|tail -1)
grep 'result folder to' ${xml_file} | tail -1 | awk 'BEGIN {FS="result folder to "} {print $2}' > lrr_location.txt
cat lrr_location.txt

echo ======================================================
loc1=$(cat lrr_location.txt)
cd "${loc1}"
pwd
echo =============listing before removing reports:===============
ls
rm --recursive -f Report85
rm --recursive -f Session85
rm -f Report85.html
echo =============listing AFTER removing reports:=================
ls
pwd
cd "${WORKSPACE}"
echo now in workspace:
pwd
echo ======================================================

echo test new lrr find solution
find "$(pwd)" -type f -name "*.lrr"

lrr2_location=$(find "$(pwd)" -type f -name "*.lrr")
echo lrr2_location is: ${lrr2_location}

echo try changing to window format
echo ${lrr2_location} | sed 's#/#\\#g'
echo finished...

echo try changing to window format more
lrr3_location=$(echo ${lrr2_location} | sed 's#/#\\#g')
echo ${lrr3_location}
echo ${lrr3_location} | sed 's#\\cygdrive\\c#c\:#g | sed 's#\\cygdrive\\z#z\:#g''
lrr4_location=$(echo ${lrr3_location} | sed 's#\\cygdrive\\c#c\:#g' | sed 's#\\cygdrive\\z#z\:#g' ) #Added the z drive change on for master/slave
echo lrr4_location is ${lrr4_location}
echo finished more...

lrr5_location=$(echo ${lrr4_location} | sed 's#Program Files (x86)#Progra~2#g')
echo lrr5_location is ${lrr5_location}
echo finished even more...

if [ -s lrr_location.txt ]; then
   res_folder=$(grep 'result folder to' ${xml_file} | tail -1 | awk 'BEGIN {FS="result folder to "} {print $2}')
   echo res_folder is $res_folder

   lrr_location=$(grep 'result folder to' ${xml_file} | tail -1 | awk 'BEGIN {FS="result folder to "} {print $2}')
   echo lrr_location is now $lrr_location
  
   res=$(grep 'launcher with arguments : ' ${xml_file} | tail -1 | awk 'BEGIN {FS="launcher with arguments : \""} {print $2}' | awk 'BEGIN {FS="\" "} {print $1}')
   echo res is: ${res}

echo lrr5_location - again - is ${lrr5_location}
res="${lrr5_location}"
echo NEW RES IS ${res}
   echo current directory is:
   pwd

   echo lets get 85th percentiles:
  
   echo I am here:
   pwd
   echo .
   #echo /cygdrive/c/Progra~2/HP/LoadRunner/bin/AnalysisUI.exe -RESULTPATH "${res}" -TEMPLATENAME Percentile85
   #/cygdrive/c/Progra~2/HP/LoadRunner/bin/AnalysisUI.exe -RESULTPATH "${res}" -TEMPLATENAME Percentile85
  
   ###echo cmd /c "c:\Progra~2/HP/LoadRunner/bin/AnalysisUI.exe" -RESULTPATH "${res}" -TEMPLATENAME Percentile85
   ##cmd /c "c:\Progra~2/HP/LoadRunner/bin/AnalysisUI.exe" -RESULTPATH "${res}" -TEMPLATENAME Percentile85
   ###cmd /c "c:\Progra~2/HP/LoadRunner/bin/AnalysisUI.exe -RESULTPATH c:\Progra~2\Jenkins\jobs\UCS_test1\workspace\1fc986\LRR\LRR.lrr -TEMPLATENAME Percentile85"
  
   echo this next line does work - using windows cmd
   cmd /c "c:\Progra~2/HP/LoadRunner/bin/AnalysisUI.exe -RESULTPATH ${lrr5_location} -TEMPLATENAME Percentile85"

  
   sleep 10
   mv "${res_folder}/Report85" .
   mv "${res_folder}/Report85.html" .
   #mv "${res_folder}/Report90" .
   #mv "${res_folder}/Report90.html" .
   #mv "${res_folder}/Report95" .
   #mv "${res_folder}/Report95.html" .
   mv "${res_folder}/Session85" .
   #mv "${res_folder}/Session90" .
   #mv "${res_folder}/Session95" .
else
   echo cannot find lrr_location. exiting script.
fi

echo "It is now $(date)"






===================================================================================================




rem c:\Progra~2/HP/LoadRunner/bin/AnalysisUI.exe -RESULTPATH c:\Progra~2\Jenkins\jobs\UCS_test1\workspace\1fc986\LRR\LRR.lrr -TEMPLATENAME Percentile85





===================================================================================================


   Archiving to show here



===================================================================================================


jtl files to show here


 

 

[Home] [About (CV)] [Contact Us] [JMeter Cloud] [webPageTest] [_64 images] [asset moniitor] [Linux Monitor] [Splunk ETL] [Splunk API] [AWS bash] [LR Rules OK] [LR Slave] [LR CI Graphs] [LoadRunner CI] [LR CI Variables] [LR Bamboo] [LR Methods] [LR CI BASH] [Bash methods] [Jenkins V2] [J V2 Pipeline1] [Jv2 Jobs] [Jv2 Analysis] [Jv2 Analysis2] [Streaming vid] [How fast] [Finding Issues] [Reporting] [Hand over] [VB Scripts] [JMeter tips] [JMeter RAW] [Dynatrace] [Documents] [FAQ] [Legal]

In the Cartesian Elements Ltd group of companies