How to know the result of the JMeter test from command line? - jmeter

I would like to know if there any flag for the following command to know the test result on the command line itself?
jmeter.bat -n -t "../Tests/testPlan.jmx" -l "../Tests/testResult.xml"
I don't want to open testResult.xml to learn if the test is pass or fail.
Regards
Chaitanya

Use Summary properties
The Non-GUI mode needs other properties set in order to print to System.out. See the blog above.
# Write messages to System.out
summariser.out=true

As far as I know there isn't. You can check all the options available here. Although, if the output is more or less similar you could write a script to automate that process.

Actually there is some other command-line way: http://code.google.com/p/jmeter-plugins/wiki/JMeterPluginsCMD

Related

Replace a specific character in Jenkins shell step

I have a variable $svn_tag in a Jenkins job.
Its value is branches/sprint-77.
I want the output branches-sprint-77, but I didn't get any output.
I tried these two methods:
$svn_tag|tr "/" -
${svn_tag////-}
It is giving output in bash script, but it is not working in the Jenkins job.
What am I doing wrong?
Your first approach does not make sense, not the least because you try to run `$svn_tagĀ“ as a command. Your second approach works for me:
svn_tag=branches/sprint-77
echo ${svn_tag////-}
prints branches-sprint-77.
For the safe side, you could also check your bash version, by doing a
echo bash=$BASH_VERSION
though I don't think that this feature is version-dependent. Mine is 4.4.12(3)-release.
Use code like below
${svn_tag.replaceAll('/', '-')}

Command line interaction using Ruby

I have a Rails application and am trying to communicate with a Java program via the CLI.
When I run the Java code using system:
system "java askQuestion"
it prompts for user input and waits for an answer, such as "What is your age?"
I want to pass a value in from a variable, and capture the output.
How can I interact with the CLI and run the command?
I did research but I couldn't find anything or I missed the correct term to search.
Solution: IO.popen
update -->
I found here what exactly I want and share maybe help someone else too , http://ruby.bastardsbook.com/chapters/external-programs/
Kernel#system just executes the command in a subshell, returning the result (true/false) of process start.
To catch the output, use backticks (or %x||).
To interact with a shell, one might use IO#popen, but in your case I would just stick to executing
output = `echo 37 | java askQuestion`
The above will pass the output of echo (37 in this particular case) to the Java process. The response of the Java process will be stored in the output variable.

shell script to groovy script using gant

I have written a shell script with commands like:
version=$1;
sed -i 's/def version = ".*"/def version = "'$version'"/' $file;
grails package-plugin;
echo -n 'Enter description of new version: ';
read desc;
git commit -m "$desc";
I want to convert it into a groovy script i.e, to create a custom grails-command that does the same thing, using GANT.
I searched a lot. But, I'm unable to find the proper methods in Apache Ant API to run a linux command like above.
Please suggest me a solution to my shell-script code with equivalent GANT script
Atleast suggest me where to start with to achieve my task.
Thank you very much in advance...
Well at last, I have figured it out how to perform the above said task.
Thanx to Grails documentation and Apache Ant tasks manual . .
After taking a whole day time, I observed that for any task to be performed:
one can refer to Apache Ant manual first,
Find it in the index,
and then knowing its usage along with necessary arguments and examples given in XML,
Then observe how XML syntax is converted to corresponding Groovy script i.e., GANT script
For e.g., observe the mkdir task and its corresponding usage in grails doc example i.e., use ant variable, then . task-name [ arguments-map ]
For those shell commands which don't have a direct task in Apache Ant manual, use exec() to run the command
That's it ... task complete :)

Erlang Output to text file

I am new to Erlang and I am trying to find an easy way to output Erlang command results to a test file in Windows command line. This is what I tried so far:
c:\Windows\Temp>erl example.erl "main" -e > output.txt
if its a small script perhaps you can use escript as described in here
escript provides support for running short Erlang programs without
having to compile them first and an easy way to retrieve the command
line arguments
then you can get what you want to work the way you want
escript myfunctions_tests > output.txt

Is there a way to add to OS X's install.log from within a shell script?

Is there a way to add an entry to OS X's /var/log/install.log file from within a shell script?
Optimally the method wouldn't require root access as I don't think I'll have it.
The problem I'm having is I'm executing a shell script as part of an installation-check (p15 of Apple's Distribution Definition XML Schema) step from within an OS X installer package via the Javascript System.run() command (p30 of Apple's Installer Javascript Reference), but I can't see any output from that shell script.
I know the shell script is executing, because when I use the "logger" command from within the script, my log text appears inside /var/log/system.log. But in order to get a complete picture of what's going on, I'd need to merge it by hand with /var/log/install.log, which is where the general output of the installer, and any Javascript logging I do, ends up.
Any help would be appreciated. I've tried using the "logger" command's -f flag to use /var/log/install.log, e.g.
logger -f /var/log/install.log sometext
...but no dice; sometext still gets added to /var/log/system.log.
Read up on bash scripting.
You can add a line to a file like this
echo "My line here" >> /var/log/system.log
If it gives a Permission denied error, you need root access.
OK. Long time passed, and I found out the following.
In normal scenarios, anything written by pre and post install scripts (mine are python and bash) to stdout will be logged by the installer daemon to the /var/log/install.log. I experimented various tools to create my installer packages, and they usually did this.
However, in my own deployment installer, for some reason, only things written to stderr get logged to the /var/log/install.log - so you might want to try that too.
A little late, but just had the same problem and was able to add logs to install.log from AppleScript using logger with the LOG_INSTALL facility:
logger -p 'install.error' "My error message"
That's not an answer per se, but maybe a hint? Installer man pages mention a "LOG_INSTALL facility", whose output is the desired /var/log/install.log
But what is this "facility" and where is it available - I can't find. I really need to write my pre/post script failures and specific scenarios to that log.

Resources