Is it possible to generate a junit.xml test report file with Insomnia CLI just like Newman does? - junit

When using Postman, you can specify tests for each of the requests in your collection, then, when executing the collection in a CI/CD environment through Newman, you can specify a command line like this:
newman run my-collection.json -r cli,junit --reporter-junit-export junit.xml
This will generate a file named junit.xml containing the results for each test in your collection.
How can the same be achieved using Insomnia's CLI Inso?

Related

Testcafe: find current working directory from test

I have a working TestCafe test suite which generates a custom xml report generated by code in the test suite. I would like to place this report in the "standard" ./results location that TestCafe uses for its reports, but I can't find an option to retrieve the current working directory (e.g., the bash pwd command).
I'm getting it by adding export pwd=$(pwd) on the command line when I run the test, but I wonder if there's a built-in mechanism in TestCafe to do this?
If you run the tests from the command line, you can just use the reporter option as follows:
testcafe chrome test.js --reporter xunit:results/output.txt
See this question for details: How to save report results from console to a file (TestCafe)?.

Which custom groovy code written in upload programatically summary report to MySQL data base in jmeter

I want the results to be uploaded after the test, how to configure summary report listener in csv file, after the test completion upload MySQL db, what custom code is used uploading programmatically
When you run JMeter in command-line non-GUI mode like
jmeter -n -t testplan.jmx -l result.jtl
you're getting .jtl results file
In order to get the "Summary Report" from the .jtl results file you can use JMeter Plugin Command Line Tool like:
JMeterPluginsCMD.bat --generate-csv summary.csv --input-jtl result.jtl --plugin-type SynthesisReport
At this stage it will be more convenient to use MySQL LOAD DATA statement like it's described in Import CSV File Into MySQL Table
If you still want to use Groovy - take a look at Creating/Inserting data chapter of Working with a relational database page of Groovy documentation

I want to save a CSV with Aggregate Report in JMeter. I need to save this file in my local repository where the JMX file is

I want to save a CSV with Aggregate Report in JMeter. I need to save this file in my local repository where the JMX file is. How I can indicate the path? Please help.
You can generate the CSV file with Aggregate Report data out of the .jtl file containing your test results using JMeter Plugins Command Line Graph Plotting Tool
Install JMeter Plugins Command Line Tool using JMeter Plugins Manager
you may also need to install Synthesis Report if you don't have it
Run your JMeter test in command-line non-GUI mode like:
jmeter -n -t test.jmx -l result.jtl
Once your test is complete you can generate Aggregate Report CSV representation as follows:
JMeterPluginsCMD --generate-csv aggregate-report.csv --input-jtl result.jtl --plugin-type AggregateReport
this aggregate-report.csv is a relative path to the current folder, you can make it absolute like:
JMeterPluginsCMD --generate-csv c:/somefolder/someotherfolder/aggregate-report.csv --input-jtl result.jtl --plugin-type AggregateReport
More information: How to Use the JMeterPluginsCMD Command Line

How to get throughput and response time in Jmeter in Non GUI mode

Actually I don't want to generate HTML file, it is unable to parse for rsp and tsp. I am using Jmeter on server and using from non GUI mode. I normally come across to run many different threads with more than 1 sampler requests. So , I need to get the response time and throughput for those threads on a quick and easy basis.
JTL result and csv file is giving rsp only. I need perfect solution which provides my solution.
even if there is a way to generate a csv file containing results of RSP and TSP which I need, will be fine for me.
** also I cant load the jtl file on jmeter on my system to check results manually.
Any suggestions are welcome.
The easiest option would be going for JMeterPluginsCMD Command Line Tool which can generate a CSV form of the Aggregate Report listener out of the .jtl results file, you will need to execute a command like:
JMeterPluginsCMD.bat --generate-csv report.csv --input-jtl result.jtl --plugin-type AggregateReport
Just replace result.jtl with your .jtl results file name and the tool will create the Aggregate Report for you,
You can install this JMeterPluginsCMD Command Line Tool along with
Synthesis Report using JMeter Plugins Manager
Steps to Generate CSV including Throughput and Responsetime
-1- Need to install JMeter Plugin Manager - Download the jar file "jmeter-plugins-manager-1.1.jar" - Place it in lib/ext
-2- Install command-line graph plotting tool using JMeter Plugin Manager option in "Options"
-3- Install jpgc-synthesis for AggregateReport using JMeter Plugin Mangager
-4- And use the following command
java -jar C:\Performance\apache-jmeter-3.3\lib\cmdrunner-2.2.jar --tool Reporter --generate-csv test.csv --input-jtl testJmeter3.jtl --plugin-type SynthesisReport

Filtering out jenkins console output of a job

I'm quite new in Jenkins and I would like to filter out from the jenkins console output only the json output of my unix script run via a jenkins job
To simplify my scenario, I have a MyScript unix script that returns a json output. A jenkins job wraps the MyScript execution using a "Execute shell" build action.
When I run the jenkins job, MyScript is executed and the jenkins console output returns below output:
Started by remote host ...
Building remotely on ... in workspace ...
Set build name.
New build name is '#11-/products/software/myScript.py'
[ScriptWrapper] $ /bin/sh -xe /tmp/hudson9139846468482145951.sh
+ /products/software/myScript.py -t ...
{'ip': '...', 'host': '...'}
Set build name.
New build name is '#11-/products/software/myScript.py'
Variable with name 'BUILD_DISPLAY_NAME' already exists, ...
Finished: SUCCESS
From the above output I would like to filter out only the json output of my unix script that is "{'ip': '...', 'host': '...'}" .
That it is needed as we call the jenkins job via REST API and we need to get only the json output of the called unix script:
curl -s -k -u ... --request GET "https://<jenkins uri>/jenkins/view/ScriptWrapper/job/ScriptWrapper/19/consoleText"
We tried defining a parsing rules file but in this way we are able only to highlight some lines in the console output in the "Parsed Console Output" jenkins view.
In addition it seems that this "Parsed Console Output" is not accessible via rest api:
curl -s -k -u ... --request GET "https://<jenkins uri>/jenkins/view/ScriptWrapper/job/ScriptWrapper/19/parsed_console"
-> it doesn't work
Is there any way to filter out the jenkins console output?
We are also evaluating the possibility to use the Jenkins Groovy Postbuild Plugin. Do you think it can help ?
I thank you in advance for any suggestion.
If I understand the question correctly, you wish to generate clean output containing only the text you want?
If so, then I'd suggest you modify your shell script to output the desired text to a file, and then use either the "archive artifact" function in Jenkins to make the file content available, or the "html publisher" plugin to "publish" that file.
https://wiki.jenkins-ci.org/display/JENKINS/HTML+Publisher+Plugin
I third option could be to modify your shell script to output "magic cookies" as delimiters around the string you want.
That way you can fetch the entire console output using the REST API, and then easily filter out the text you want using a simple regex.